| Type: | Package |
| Title: | Mixed Tempered Stable Distribution |
| Version: | 1.0.4 |
| Date: | 2015-10-22 |
| Depends: | methods, stats, graphics, stats4, MASS |
| Author: | Lorenzo Mercuri, Edit Rroji |
| Maintainer: | Lorenzo Mercuri <lorenzo.mercuri@unimi.it> |
| Description: | We provide detailed functions for univariate Mixed Tempered Stable distribution. |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| Repository: | CRAN |
| Repository/R-Forge/Project: | mixedts |
| Repository/R-Forge/Revision: | 15 |
| Repository/R-Forge/DateTimeStamp: | 2015-10-22 16:15:11 |
| Date/Publication: | 2015-10-25 17:21:21 |
| NeedsCompilation: | no |
| Packaged: | 2015-10-22 16:25:31 UTC; rforge |
Mixed Tempered Stable Distribution
Description
This package provides detailed functions for univariate Mixed Tempered Stable distribution distribution with Gamma density. This distribution encompasses, Variance Gamma and Symmetric Geo-Stable as special cases. The package contains routine for mle estimation, for the computation of density, probability, quantile and random numbers
Details
| Package: | MixedTS |
| Type: | Package |
| License: | GPL (>= 2) |
Author(s)
Lorenzo Mercuri, Edit Rroji
Maintainer: Lorenzo Mercuri <lorenzo.mercuri@unimi.it>
References
Barndorff-Nielsen,O.E., Kent,J. and Sorensen, M. (1982): Normal variance-mean mixtures and z-distributions, International Statistical Review, 50, 145-159.
Kuchler, U. and Tappe, S. (2014): Exponential stockmodels driven by tempered stable processes. Journal of Econometrics,181 (1), 53-63.
Madan, D.B. and Seneta E. (1990): The variance gamma (V.G.) model for share market returns, Journal of Business, 63, 511-524
Rroji, E and Mercuri, L.(2014): Mixed Tempered Stable distribution UNIMI-Research Papers in Economics, Business, and Statistics, 64.
"MixedTS": A class for informations about Mixed Tempered Stable
Description
Mathematical description of the Mixed Tempered Stable distribution.
This class inherits from the class param.MixedTS and is a superclass for MixedTS.qmle-class.
Objects from the Class
This object is built by the following methods:
dMixedTS, pMixedTS, qMixedTS, rMixedTS.
Slots
Data:Object of class
"numeric"containing a random number. This slot is filled when the methodrMixedTSis used.dens:Object of class
"numeric"that contains the density of the MixedTS. This slot is filled bydMixedTS.prob:Object of class
"numeric"that contains the probability of the MixedTS. This slot is filled bypMixedTSandpMixedTS.xMixedTS:Object of class
"numeric"that contains the support for the density and probability.quantile:Object of class
"logical". IfTRUEthe object is built by the methodqMixedTS. IfFALSEthe object is built by the methodqMixedTS.mu0:Object of class
"numeric". Seeparam.MixedTS.mu:Object of class
"numeric". Seeparam.MixedTS.sigma:Object of class
"numeric". Seeparam.MixedTS.a:Object of class
"vector". Seeparam.MixedTS.alpha:Object of class
"numeric". Seeparam.MixedTS.lambda_p:Object of class
"numeric". Seeparam.MixedTS.lambda_m:Object of class
"numeric". Seeparam.MixedTS.Mixing:Object of class
"character". Seeparam.MixedTS.paramMixing:Object of class
"list". Seeparam.MixedTS.MixingLogMGF:Object of class
"OptionalFunction". Seeparam.MixedTS.
Extends
Class "param.MixedTS", directly.
Methods
- plot
signature(x = "MixedTS", ...)
MixedTS.qmle: a class for Maximum Likelihood of Mixed Tempered Stable
Description
This class is constructed by function MixedTS.qmle. It is a subclass for the MixedTS-class
Objects from the Class
Objects can be created by function MixedTS.qmle.
Slots
time:Object of class
"numeric". Computational Time.coef:Object of class
"numeric". Estimated parameters.vcov:Object of class
"matrix". Approximate variance-covariance matrix.min:Object of class
"numeric". Minimum value of objective function.details:Object of class
"list". A list as returned fromconstrOptimnobs:Object of class
"integer". Number of observation.method:Object of class
"character". The optimization method used.Data:Object of class
"numeric". SeeMixedTS-class.dens:Object of class
"numeric". SeeMixedTS-class.prob:Object of class
"numeric". SeeMixedTS-class.xMixedTS:Object of class
"numeric". SeeMixedTS-class.quantile:Object of class
"logical". SeeMixedTS-class.mu0:Object of class
"numeric". SeeMixedTS-class.mu:Object of class
"numeric". SeeMixedTS-class.sigma:Object of class
"numeric". SeeMixedTS-class.a:Object of class
"vector". SeeMixedTS-class.alpha:Object of class
"numeric". SeeMixedTS-class.lambda_p:Object of class
"numeric". SeeMixedTS-class.lambda_m:Object of class
"numeric". SeeMixedTS-class.Mixing:Object of class
"character". SeeMixedTS-class.paramMixing:Object of class
"list". SeeMixedTS-class.MixingLogMGF:Object of class
"OptionalFunction". SeeMixedTS-class.
Extends
Class "MixedTS", directly.
Class "param.MixedTS", by class "MixedTS", distance 2.
Methods
- summary
signature(.Object = "MixedTS.qmle")- coef
signature(.Object = "MixedTS.qmle")- vcov
signature(.Object = "MixedTS.qmle")- logLik
signature(.Object = "MixedTS.qmle")- BIC
signature(.Object = "MixedTS.qmle")- AIC
signature(.Object = "MixedTS.qmle")
Density of Mixed Tempered Stable distribution
Description
This Method returns the density of a Mixed Tempered Stable
Methods
signature(object = "param.MixedTS",x = numeric(), setSup=NULL,setInf=NULL,N=2^10)-
This method returns an object of class
MixedTSwhere the slotdenscontains the value of the density evaluated on thex.setSupandsetInfare used to choose+ infinityand- infinty.Nis the number of point used for discretization infftalgorithm.
Examples
# First Example
# Density of MixedTS with Gamma
ParamEx1<-setMixedTS.param(mu0=0, mu=0, sigma=0.4, a=1.5,
alpha=0.8, lambda_p=4, lambda_m=1,
Mixing="Gamma")
# support
x<-seq(-3,1,length=100)
dens1<-dMixedTS(x=x,object=ParamEx1,setSup=10,setInf=-10,N=2^7)
plot(dens1)
# Density of MixedTS with IG
Mix<-"User"
logmgf<-("lamb/mu1*(1-sqrt(1-2*mu1^2/lamb*u))")
parMix<-list(lamb=1,mu1=1)
ParamEx2<-setMixedTS.param(mu0=0, mu=0, sigma=0.4, a=logmgf,
alpha=0.8, lambda_p=4, lambda_m=1,
Mixing=Mix,paramMixing=parMix)
x<-seq(-3,1,length=100)
dens2<-dMixedTS(x=x,object=ParamEx2,setSup=10,setInf=-10,N=2^7)
plot(dens2)
Maximum Likelihood Estimation for MixedTS distribution
Description
Estimate MixedTS parameters using the Maximum Likelihood Estimation procedure.
Usage
mle.MixedTS(object, start = list(), Data = NULL,
method = "L-BFGS-B", fixed.param = NULL,
lower.param = NULL, upper.param = NULL,
setSup = NULL, setInf = NULL, N = 2^10)
Arguments
object |
an object of class |
start |
a list of parameter for the mle. |
Data |
a numeric object containing the dataset. |
method |
methods for optimization routine. See |
fixed.param |
a list of the model parameter that must be fix during optimization routine. Choosing |
lower.param |
a list containing the lower bound for the parameters. |
upper.param |
a list containing the upper bound for the parameters. |
setSup |
Internal parameter. see documentation for |
setInf |
Internal parameter. see documentation for |
N |
Internal parameter. see documentation for |
Value
The function returns an object of class MixedTS.qmle.
Examples
# First Example:
# We define the Mixed Tempered Stable using the function setMixedTS.param
ParamEx1<-setMixedTS.param(mu0=0, mu=0, sigma=0.4, a=1.5,
alpha=0.8, lambda_p=4, lambda_m=1, Mixing="Gamma")
# We generate a sample using the rMixedTS method
set.seed(100)
Rand1 <- rMixedTS(x=5000,object=ParamEx1, setSup=10,setInf=-10,N=2^9)
# Estimate procedure
## Not run:
est1<-mle.MixedTS(object=Rand1 , setSup=10,setInf=-10,N=2^9)
# Show results
summary(est1)
## End(Not run)
Probability of Mixed Tempered Stable distribution
Description
This Method returns the cdf of a Mixed Tempered Stable
Methods
signature(object = "param.MixedTS",x = numeric(), setSup=NULL,setInf=NULL,N=2^10)-
This method returns an object of class
MixedTSwhere the slotprobcontains the value of the probability evaluated on thex.setSupandsetInfare used to choose+ infinityand- infinty.Nis the number of point used for discretization infftalgorithm.
Examples
# First Example
# Density of MixedTS with Gamma
ParamEx1<-setMixedTS.param(mu0=0, mu=0, sigma=0.4, a=1.5,
alpha=0.8, lambda_p=4, lambda_m=1,
Mixing="Gamma")
# support
x<-seq(-3,1,length=100)
prob1<-pMixedTS(x=x,object=ParamEx1,setSup=10,setInf=-10,N=2^7)
plot(prob1)
# Prob of MixedTS with IG
Mix<-"User"
parMix<-list(lamb=1,mu1=1)
logmgf<-("lamb/mu1*(1-sqrt(1-2*mu1^2/lamb*u))")
ParamEx2<-setMixedTS.param(mu0=0, mu=0, sigma=0.4, a=logmgf,
alpha=0.8, lambda_p=4, lambda_m=1,
Mixing=Mix,paramMixing=parMix)
x<-seq(-3,1,length=100)
prob2<-pMixedTS(x=x,object=ParamEx2,setSup=10,setInf=-10,N=2^7)
plot(prob2)
"param.MixedTS": A mathematical Description of the Mixed Tempered Stable
Description
Main class of the package MixedTS.
Objects from the Class
Objects can be created by calls of the form setMixedTS.
Slots
mu0:a numeric object. mu0 parameter belongs to the real axis.
mu:a numeric object. mu parameter belongs to the real axis
- sigma
a numeric object.
sigmaparameter assumes value from zero to infinity.- a
a vector object. If numeric, the mixing density
Vis a Gamma andais the value of the shape parameter. If string,ais the log of the moment generating function of the mixing densityV.- alpha
a numeric object that takes value from 0 to 2. If alpha is fixed to 2, the Mixed Tempered Stable becomes the Normal Variance Mean mixture.
- lambda_p
a positive numeric object. It is the right tempering parameter of the random variable
X.- lambda_m
a positive numeric object. It is the left tempering parameter of the random variable
X- Mixing
a string object indicating the nature of the mixing density
V. IfMixing="Gamma"(default value), theVrandm variable is a Gamma. IfMixing="Gamma", the user have to specify the log of the moment generating function of theVrandom variable.- paramMixing
a list object. It is an empty list when
Mixing="Gamma". IfMixing="User", it is used to pass the values of the Mixing density parameters defined by the User through slota.MixingLogMGF:This slot contains a function that returns the logarithm of mgf for the Mixing density. The function is built internally using the information contains into the slots
a,paramMixing.Parametrization:String that indicates the parametrization used by user for the MixedTS
Methods
- dMixedTS
signature(object = "param.MixedTS"): Method for computing density of MixedTS. See"dMixedTS-methods"for more details.- pMixedTS
signature(object = "param.MixedTS"): Method for computing probability of MixedTS. See"pMixedTS-methods"for more details.- qMixedTS
signature(object = "param.MixedTS"): Method for computing quantile of MixedTS. See"qMixedTS-methods"for more details.- rMixedTS
signature(object = "param.MixedTS"): Method for computing random numbers of MixedTS. See"rMixedTS-methods"for more details.- initialize
signature(object = "param.MixedTS").- Qparam.MixedTS
signature(object = "param.MixedTS").
Quantile of Mixed Tempered Stable distribution
Description
This Method returns the quantile of a Mixed Tempered Stable.
Methods
signature(object = "param.MixedTS",x = numeric(), setSup=NULL,setInf=NULL,N=2^10)-
This method returns an object of class
MixedTSwhere the slotprobcontains the value of the quantile evaluated on thex(x is the probability).setSupandsetInfare used to choose+ infinityand- infinty.Nis the number of point used for discretization infftalgorithm.
Random number of Mixed Tempered Stable distribution
Description
This Method returns the quantile of a Mixed Tempered Stable.
Methods
signature(object = "param.MixedTS",x = numeric(), setSup=NULL,setInf=NULL,N=2^10)-
This method returns an object of class
MixedTSwhere the slotDatacontains a set of sizexof random numbers.setSupandsetInfare used to choose+ infinityand- infinty.Nis the number of point used for discretization infftalgorithm.
Mixed Tempered Stable distribution
Description
setMixedTS describes the Mixed Tempered Stable distribution introduced in Rroji and Mercuri (2014):
Definition
We say that a continuous random variable Y follows a Mixed Tempered Stable distribution if:
Y= mu0+ mu*V + sigma*sqrt{V}*Z
The conditional distribution of random variable given V=v is a standardized Tempered Stable with parameters (alpha, lambda_p*sqrt{v}, lambda_m) (see Kuchler, U. and Tappe, S. 2014). The distribution of V is infinitely divisible defined on the positive axis.
Usage
setMixedTS.param(mu0 = numeric(), mu = numeric(),
sigma = numeric(), a, alpha = numeric(),
lambda_p = numeric(), lambda_m = numeric(),
param = numeric(), Mixing = "Gamma", paramMixing = list(), Parametrization = "A")
Arguments
mu0 |
a numeric object. |
mu |
a numeric object. |
sigma |
a numeric object. |
a |
a vector object. If numeric, the mixing density |
alpha |
a numeric object that takes value from 0 to 2. If alpha is fixed to 2, the Mixed Tempered Stable becomes the Normal Variance Mean mixture. |
lambda_p |
a positive numeric object. It is the right tempering parameter of the random variable |
lambda_m |
a positive numeric object. It is the left tempering parameter of the random variable |
param |
a numeric object containing the Mixed Tempered Stable parameters. It is not necessary if we use the previous inputs for defining the distribution. See documentation for more details. |
Mixing |
a string object indicating the nature of the mixing density |
paramMixing |
a list object. It is an empty list when |
Parametrization |
a character string. If
where
|
where V is distributed as a Gamma(a, 1).
Details
For particular choices of the tempering parameters the tails of the MixedTS distribution can be heavy or semi-heavy. In particular if the Mixing density is a Gamma, we get the Variance Gamma (Madan and Seneta 1990) and the symmetric Geo-Stable distribution as special cases.
Value
This function returns an object of class "param.MixedTS".
Note
This class of distributions has the Normal Variance Mean Mixture (Barndorff-Nielsen et al. 1982) as special case.
References
Barndorff-Nielsen,O.E., Kent,J. and Sorensen, M. (1982): Normal variance-mean mixtures and z-distributions, International Statistical Review, 50, 145-159.
Kuchler, U. and Tappe, S. (2014): Exponential stockmodels driven by tempered stable processes. Journal of Econometrics,181 (1), 53-63.
Madan, D.B. and Seneta E. (1990): The variance gamma (V.G.) model for share market returns, Journal of Business, 63, 511-524
Rroji, E and Mercuri, L.(2014): Mixed Tempered Stable distribution UNIMI-Research Papers in Economics, Business, and Statistics, 64.
Examples
# Mixed Tempered Stable with Gamma Mixing density.
ParamEx1<-setMixedTS.param(mu0=0, mu=0, sigma=0.4, a=1.5,
alpha=0.8, lambda_p=4, lambda_m=1)
# Mixed Tempered Stable with Inverse Gaussian Mixing density.
## As first step we set the "a" parameter
## equal to the log mgf of the inverse gaussian random variable
# The log mgf of an Ig with parameter (lamb, mu1) is defined as:
logmgf<-("lamb/mu1*(1-sqrt(1-2*mu1^2/lamb*u))")
Mix<-"User"
# The parameters of the mixing density are set by the following command
# line:
parMix<-list(lamb=1,mu1=1)
ParamEx2<-setMixedTS.param(mu0=0, mu=0, sigma=0.4, a=logmgf,
alpha=0.8, lambda_p=4, lambda_m=1,
Mixing=Mix,paramMixing=parMix)