Learn R Programming

CVarE (version 1.1)

rmvt: Multivariate t Distribution.

Description

Random generation from multivariate t distribution (student distribution).

Usage

rmvt(n = 1, mu = rep(0, p), sigma = diag(p), df = Inf)

Arguments

n

number of samples.

mu

mean

sigma

a \(k\times k\) positive definite matrix. If the degree \(\nu\) if bigger than 2 the created covariance is $$var(x) = \Sigma\frac{\nu}{\nu - 2}$$ for \(\nu > 2\).

df

degree of freedom \(\nu\).

Value

a \(n\times p\) matrix with samples in its rows.

Examples

Run this code
# NOT RUN {
CVarE:::rmvt(20, c(0, 1), matrix(c(3, 1, 1, 2), 2), 3)
CVarE:::rmvt(20, sigma = matrix(c(2, 1, 1, 2), 2), df = 3)
CVarE:::rmvt(20, mu = c(3, -1, 2), df = 3)

# }

Run the code above in your browser using DataLab