Learn R Programming

TTmoment (version 1.0)

TTmoment-package: Truncated Multivariate t (TMVT) Distribution

Description

This package includes two functions related to the truncated multivariate t (TMVT) distribution described in Kotz and Nadarajah (2004) with the double truncation. One is to generate random variates from the TMVT distribution, and the other is to compute the first two moments theoretically.

Arguments

Details

Package:
TTmoment
Type:
Package
Version:
1.0
Date:
2015-05-04
License:
GPL-2

References

Hsiu J. Ho, Tsung-I Lin, Hsuan-Yu Chen, Wan-Lun Wang (2012), Some results on the truncated multivariate t distribution. Journal of Statistical Planning and Inference, 142, 25-40.

See Also

TT.GS, TT.moment

Examples

Run this code
# A test example
rho=0.9
S=matrix(c(1, rho ,rho, 1),2,2)
nu=5
p=2
mu = rep(0, p)
Y= TT.GS(n=10000, mu, S, nu, lower=c(1,2), upper=c(4,6))
# Empirical first moment
y.bar=colMeans(Y)
y.bar
# Sample covariance matrix
S.y=cov(Y)
S.y

M.Y=TT.moment(R=S, nu, lower=c(1,2), upper=c(4,6))
# First two moments
M.Y$EX
M.Y$EXX
# Covariance matrix
M.Y$EXX-M.Y$EX%*%t(M.Y$EX)

Run the code above in your browser using DataLab