Learn R Programming

lestat (version 1.9)

mtdistribution: A Multivariate t-Distribution

Description

Creates an object representing a multivariate non-centered t-distribution.

Usage

mtdistribution(expectation = c(0,0), degreesoffreedom = 10000, 
     P = diag(length(expectation)))

Arguments

expectation

A vector of length at least 2 specifying the expectation of the distribution. By default, the vector (0,0).

degreesoffreedom

The degrees of freedom parameter.

P

A matrix of size \(k\times k\), where \(k\) is the length of the expectation vector. P plays a similar role in the multivariate t-distribution as the precision matrix does in the multivariate normal distribution. By default, P is the identity matrix.

Value

A multivariate t-distribution.

Details

If \(\mu\) is the expectation, \(\nu\) the degrees of freedom, \(P\) is the last parameter, and \(k\) the dimension, then the probability density function is proportional to $$f(x)=\exp(\nu + (x-\mu)^tP(x-\mu))^{-(\nu+k)/2}$$

See Also

tdistribution, mnormal

Examples

Run this code
# NOT RUN {
plot(mtdistribution())
plot(mtdistribution(c(1,2,3), 3))
plot(mtdistribution(c(1,2), 3, matrix(c(1, 0.5, 0.5, 1), 2, 2)))
# }

Run the code above in your browser using DataLab