Learn R Programming

MomTrunc (version 4.59)

momentsTMD: Moments for doubly truncated multivariate distributions

Description

It computes the kappa-th raw moment for the doubly truncated p-variate Normal, Skew-normal (SN), Extended Skew-normal (ESN) and Student's t-distribution. It also output some other lower moments (than kappa) involved in the recurrence approach.

Usage

momentsTMD(kappa,lower = NULL,upper = NULL,mu,Sigma,lambda = NULL,tau = NULL,
dist,nu = NULL)

Arguments

kappa

moments vector of length \(p\). All its elements must be integers greater or equal to \(0\).

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 ESN cases. If lambda == 0, the ESN/SN reduces to a normal (symmetric) distribution.

tau

It represents the extension parameter for the ESN distribution. If tau == 0, the ESN reduces to a SN distribution.

dist

represents the folded distribution to be computed. The values are normal, SN , ESN and t for the doubly truncated Normal, Skew-normal, Extended Skew-normal and Student's t-distribution respectively.

nu

It represents the degrees of freedom for the Student's t-distribution.

Value

A data frame containing \(p+2\) columns. The \(p\) first containing the set of moments involved in the recursive approach and the last two columns containing the \(F\) function value (see Galarza and Lachos, 2018) and the expected value. Normal cases (ESN, SN and normal) return prod(kappa)+1 moments while the Student's t-distribution case returns sum(kappa)+1. See example section.

Henceforth, we HIGHLY recomend to check the pdf manual instead because of formulae.

The \(F\) function is simply

$$F_{\kappa}(\mathbf{a,b},\mu,\Sigma,\nu) = \int_{\mathbf{a}}^{\mathbf{b}} \mathbf{x}^\kappa f(\mathbf{x}) \mathrm{d}\mathbf{x},$$ where \(\mathbf{a}\) and \(\mathbf{b}\) are vectors of length \(p\) representing the lower and upper bounds. We have used the short notation \(\mathbf{x}^\kappa = x_1^{\kappa_1} x_2^{\kappa_2}\ldots x_p^{\kappa_p}\). It is easy to see that \(P(\mathbf{a}\le \mathbf{X}\le \mathbf{b})=F_{\mathbf{0}}(\mathbf{a,b},\mu,\Sigma,\nu)\), i.e., the normalizing constant for the doubly truncated density. Then the expected value will be given by \(E[\mathbf{x}^\kappa] = F_\kappa(\mathbf{a,b},\mu,\Sigma,\nu)/F_{\mathbf{0}}(\mathbf{a,b},\mu,\Sigma,\nu)\).

Normal case returns prod(kappa)+1 moments while the Student's t-distribution case returns sum(kappa)+1. See example section. For the extended skew-normal case, we recommend to the readers to check the reference.

Warning

For the Student-t case, the kappa-\(th\) moment can only be computed when sum(kappa) \(\le\) nu-2.

Details

Univariate case is also considered, where Sigma will be the variance \(\sigma^2\).

References

Kan, R., & Robotti, C. (2017). On Moments of Folded and Truncated Multivariate Normal Distributions. Journal of Computational and Graphical Statistics, (just-accepted).

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

meanvarTMD, meanvarFMD,momentsFMD,meanvarFMD,dmvESN,rmvESN

Examples

Run this code
# NOT RUN {
a = c(-0.8,-0.7,-0.6)
b = c(0.5,0.6,0.7)
mu = c(0.1,0.2,0.3)
Sigma = matrix(data = c(1,0.2,0.3,0.2,1,0.4,0.3,0.4,1),
               nrow = length(mu),ncol = length(mu),byrow = TRUE)
value1 = momentsTMD(c(2,0,1),a,b,mu,Sigma,dist="normal")
value2 = momentsTMD(c(2,0,1),a,b,mu,Sigma,dist = "t",nu = 7)
value3 = momentsTMD(c(2,0,1),a,b,mu,Sigma,lambda = c(-2,0,1),dist = "SN")
value4 = momentsTMD(c(2,0,1),a,b,mu,Sigma,lambda = c(-2,0,1),tau = 1,dist = "ESN")
# }

Run the code above in your browser using DataLab