mnormal {lestat}R Documentation

A Multivariate Normal Distribution

Description

Creates an object representing a multivariate normal distribution.

Usage

mnormal(expectation = c(0,0), 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).

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 \mu is the expectation vector and P is the precision matrix, then the probability density function is proportional to

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

Value

A multivariate normal probability distribution.

Author(s)

Petter Mostad <mostad@chalmers.se>

See Also

normal

Examples

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

[Package lestat version 1.9 Index]