Density function, distribution function, quantile function and random generator for the SMNG distribution and the logSMNG. It requires the specification of a five prameters vector: mu, delta, gamma, lambda and beta.
beta: Skewness parameter, default set to 0 (symmetric case).
inf_sum: Logical: if FALSE (default) the integral representation of the SMNG density is used, otherwise the infinite sum is employed.
rel_tol: Level of relative tolerance required for the integrate procedure or for the infinite sum convergence check. Default set to 1e-5.
p: Vector of probabilities.
n: Sample size.
Returns
dSMNG and dlSMNG provide the values of the density function at a quantile x for, respectively a SMNG distribution and a log-SMNG.
pSMNG and plSMNG provide the cumulative distribution function at a quantile q.
qSMNG and qlSMNG provide the quantile corresponding to a probability level p.
rSMNG and rlSMNG generate n independent samples from the desired distribution.
Details
The SMNG distribution is a normal scale-mean mixture distribution with a GIG as mixing distribution. The density can be expressed as an infinite sum of Bessel K functions and it is characterized by 5 parameters.
Moreover, if X is SMNG distributed, then Z=exp(X) is distributed as a log-SMNG distribution.
Examples
### Plots of density and cumulative functions of the SMNG distributionx<-seq(-10,10,length.out =500)plot(x,dSMNG(x = x,mu =0,delta =1,gamma =1,lambda =1,beta=2), type="l",ylab="f(x)")lines(x,dSMNG(x = x,mu =0,delta =1,gamma =1,lambda =1,beta=-2),col=2)title("SMNG density function")plot(x,pSMNG(q = x,mu =0,delta =1,gamma =1,lambda =1,beta=2), type="l",ylab="F(x)")lines(x,pSMNG(q = x,mu =0,delta =1,gamma =1,lambda =1,beta=-2),col=2)title("SMNG cumulative function")### Plots of density and cumulative functions of the logSMNG distributionx<-seq(0,20,length.out =500)plot(x,dlSMNG(x = x,mu =0,delta =1,gamma =1,lambda =2,beta =1), type="l",ylab="f(x)",ylim = c(0,1.5))lines(x,dlSMNG(x = x,mu =0,delta =1,gamma =1,lambda =2,beta =-1),col=2)title("logSMNG density function")plot(x,plSMNG(q = x,mu =0,delta =1,gamma =1,lambda =2,beta =1), type="l",ylab="F(x)",ylim = c(0,1))lines(x,plSMNG(q = x,mu =0,delta =1,gamma =1,lambda =2,beta =-1),col=2)title("logSMNG cumulative function")