rtmvt {tmvmixnorm} | R Documentation |
Random number generation for truncated multivariate Student's t distribution subject to linear inequality constraints
Description
rtmvt
simulates truncated multivariate (p-dimensional) Student's t distribution subject to linear inequality constraints. The constraints should be written as a matrix (D
) with lower
and upper
as the lower and upper bounds for those constraints respectively. Note that D
can be non-full rank, which generalizes many traditional methods.
Usage
rtmvt(n, Mean, Sigma, nu, D, lower, upper, int = NULL, burn = 10, thin = 1)
Arguments
n |
number of random samples desired (sample size). |
Mean |
location vector of the multivariate Student's t distribution. |
Sigma |
positive definite dispersion matrix of the multivariate t distribution. |
nu |
degrees of freedom for Student-t distribution. |
D |
matrix or vector of coefficients of linear inequality constraints. |
lower |
lower bound vector for truncation. |
upper |
upper bound vector for truncation. |
int |
initial value vector for Gibbs sampler (satisfying truncation), if |
burn |
burn-in iterations discarded (default as |
thin |
thinning lag (default as |
Value
rtmvt
returns a (n*p
) matrix (or vector when n=1
) containing random numbers which follows truncated multivariate Student-t distribution.
Examples
# Example for full rank
d <- 3
rho <- 0.5
nu <- 10
Sigma <- matrix(0, nrow=d, ncol=d)
Sigma <- rho^abs(row(Sigma) - col(Sigma))
D1 <- diag(1,d) # Full rank
set.seed(1203)
ans.t <- rtmvt(n=1000, Mean=1:d, Sigma, nu=nu, D=D1, lower=rep(-1,d), upper=rep(1,d),
burn=50, thin=0)
apply(ans.t, 2, summary)