Learn R Programming

MomTrunc (version 5.97)

dprmvSN: Multivariate Skew Normal Density and Probabilities and Random Deviates

Description

These functions provide the density function and a random number generator for the multivariate skew normal (SN) distribution with mean vector mu, scale matrix Sigma and skewness parameter lambda.

Usage

dmvSN(x,mu=rep(0,length(lambda)),Sigma=diag(length(lambda)),lambda)
pmvSN(lower = rep(-Inf,length(lambda)),upper=rep(Inf,length(lambda)),
        mu = rep(0,length(lambda)),Sigma,lambda,log2 = FALSE)
rmvSN(n,mu=rep(0,length(lambda)),Sigma=diag(length(lambda)),lambda)

Arguments

x

vector or matrix of quantiles. If x is a matrix, each row is taken to be a quantile.

n

number of observations.

lower

the vector of lower limits of length \(p\).

upper

the vector of upper limits of length \(p\).

mu

a numeric vector of length \(p\) representing the location parameter.

Sigma

a numeric positive definite matrix with dimension \(p\)x\(p\) representing the scale parameter.

lambda

a numeric vector of length \(p\) representing the skewness parameter for SN and SN cases. If lambda == 0, the SN/SN reduces to a normal (symmetric) distribution.

log2

a boolean variable, indicating if the log2 result should be returned. This is useful when the true probability is too small for the machine precision.

References

Cao, J., Genton, M. G., Keyes, D. E., & Turkiyyah, G. M. (2019) "Exploiting Low Rank Covariance Structures for Computing High-Dimensional Normal and Student- t Probabilities" <https://marcgenton.github.io/2019.CGKT.manuscript.pdf>.

Galarza C.E., Matos L.A., Dey D.K. & Lachos V.H. (2019) On Moments of Folded and Truncated Multivariate Extended Skew-Normal Distributions. Technical report. ID 19-14. University of Connecticut <https://stat.uconn.edu/tech-reports-2019/>.

Genz, A., "Numerical computation of multivariate normal probabilities," Journal of Computational and Graphical Statistics, 1, 141-149 (1992) <doi:10.1080/10618600.1992.10477010>.

See Also

dmvESN, pmvESN, rmvESN, meanvarFMD,meanvarTMD,momentsTMD

Examples

Run this code
# NOT RUN {
#Univariate case
dmvSN(x = -1,mu = 2,Sigma = 5,lambda = -2)
rmvSN(n = 100,mu = 2,Sigma = 5,lambda = -2)
#Multivariate case
mu = c(0.1,0.2,0.3,0.4)
Sigma = matrix(data = c(1,0.2,0.3,0.1,0.2,1,0.4,-0.1,0.3,0.4,1,0.2,0.1,-0.1,0.2,1),
               nrow = length(mu),ncol = length(mu),byrow = TRUE)
lambda = c(-2,0,1,2)
#One observation
dmvSN(x = c(-2,-1,0,1),mu,Sigma,lambda)
rmvSN(n = 100,mu,Sigma,lambda)
#Many observations as matrix
x = matrix(rnorm(4*10),ncol = 4,byrow = TRUE)
dmvSN(x = x,mu,Sigma,lambda)

lower = rep(-Inf,4)
upper = c(-1,0,2,5)
pmvSN(lower,upper,mu,Sigma,lambda)
# }

Run the code above in your browser using DataLab