Learn R Programming

MomTrunc (version 4.59)

drmvSN: Multivariate Skew Normal Density 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)
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.

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.

References

C.E. Galarza, L.A. Matos, D.K. Dey & V.H. Lachos. (2019) On Moments of Folded and Truncated Multivariate Extended Skew-Normal Distributions. Technical report. ID 19-14. University of Connecticut.

See Also

pmvESN, 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)
# }

Run the code above in your browser using DataLab