rmvt: Multivariate Student Random Deviates

rmvtR Documentation

Multivariate Student Random Deviates

Description

This function provides a random vector generator for the multivariate Student distribution with mean vector mean, scale matrix sigma and degrees of freedom df.

Usage

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

Arguments

n

Number of observations.

sigma

symmetric and positive definite scale matrix

mu

mean vector

df

degree of freedom as integer

Value

The vector samples, stacked in the rows of a matrix.

Note

Note that the covariance matrix is only defined for df > 2, and is given by sigma * df / (df - 2).

Author(s)

Daniel Saban\'es Bov\'e

Examples

## 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))

bfp documentation built on Nov. 1, 2022, 1:05 a.m.

Related to rmvt in bfp...