mnormal: A Multivariate Normal Distribution

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Creates an object representing a multivariate normal distribution.

Usage

1

Arguments

expectation

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

P

A matrix of size k\times k, where k is the length of the expectation vector. P specifies the precision matrix, i.e., the inverse of the covariance matrix.

Details

If μ is the expectation vector and P is the precision matrix, then the probability density function is proportional to

f(x)=\exp(-0.5(x-μ)^tP(x-μ))

Value

A multivariate normal probability distribution.

Author(s)

Petter Mostad <mostad@chalmers.se>

See Also

normal

Examples

1
2
3
plot(mnormal())
plot(mnormal(c(1,2,3)))
plot(mnormal(c(1,2), matrix(c(1, 0.5, 0.5, 1), 2, 2)))

Example output

Loading required package: MASS

lestat documentation built on May 2, 2019, 2:09 p.m.