rmvt | R Documentation |
This function provides a random vector generator for the multivariate
Student distribution with mean vector mean
, scale matrix
sigma
and degrees of freedom df
.
rmvt(n, sigma = diag(2), mu = rep(0, 2), df = 1)
n |
Number of observations. |
sigma |
symmetric and positive definite scale matrix |
mu |
mean vector |
df |
degree of freedom as integer |
The vector samples, stacked in the rows of a matrix.
Note that the covariance matrix is only defined for df > 2
, and
is given by sigma * df / (df - 2)
.
Daniel Saban\'es Bov\'e
## samples from the multivariate Cauchy distribution:
bfp:::rmvt(20)
## here the covariance exists:
sigma <- matrix(c(1, 0.5, 0.5, 1), nrow=2)
df <- 10
## theoretical covariance:
sigma * df / (df - 2)
## this should be close:
cov(bfp:::rmvt(n=100000, sigma=sigma, df=df))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.