Learn R Programming

e1071 (version 1.1-3)

Mvnorm: The Multivariate Normal Distribution

Description

These functions provide information about the multivariate normal distribution with mean equal to mu and covariance matrix sigma. dmvnorm gives the density and rmvnorm generates random deviates.

Usage

dmvnorm(x, mu, sigma)
rmvnorm(n, mu, sigma)

Arguments

x
Vector or matrix of quantiles. If x is a matrix, each row is taken to be a quantile.
n
Number of observations.
mu
Mean vector, default is rep(0, length = ncol(x)).
sigma
Covariance matrix, default is diag(ncol(x)).

See Also

Normal

Examples

Run this code
dmvnorm(x=c(0,0))
dmvnorm(x=c(0,0), mu=c(1,1))
x <- rmvnorm(n=100, mu=c(1,1))
plot(x)

Run the code above in your browser using DataLab