TT.GS: Slice Sampling for the Truncated Multivariate t (TMVT)...

Description Usage Arguments Value Author(s) References Examples

Description

This function generates random variates from the truncated multivariate t (TMVT) distribution by using the slice sampling algorithm.

Usage

1
2
TT.GS(n, mu=rep(0,nrow(S)), S=diag(length(mu)), nu=2, 
lower=rep(-Inf, length(mu)), upper=rep(Inf, length(mu)))

Arguments

n

Number of observations.

mu

Location vector, default is rep(0, length = nrow(S)).

S

Scale matrix, default is diag(length(mu)).

nu

Degree of freedom, nu>2 is required to confirm the existence of the first two moments of TMVT distribution under slice sampling.

lower, upper

Truncation bounds on the random vectors, default is rep(-Inf, length(mu)), rep(Inf, length(mu)).

Value

An n by p matrix

Author(s)

Hsiu J. Ho, Tsung-I Lin, Wan-Lun Wang, Aldo M. Garay, Victor H. Lachos, and Mauricio Castro

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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# 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)

TTmoment documentation built on May 1, 2019, 7:50 p.m.