Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rmvnorm

Generates realizations from a multivariate normal distribution


Description

Generates realizations from a multivariate normal distribution.

Usage

rmvnorm(nsim = 1, mu, V, method = "eigen")

Arguments

nsim

An integer indicating the number of realizations from the distribution.

mu

A vector of length n containing the mean values of the multivariate normal distribution.

V

The covariance matrix of the multivariate normal distribution. The matrix should be symmetric and positive definite. The size must be n times n.

method

The method for performing a decomposition of the covariance matrix. Possible values are "eigen", "chol", and "svd", Eigen value decomposition, Cholesky decomposition, or Singular Value Decomposoition, respectively.

Value

An n \times nsim matrix containing the nsim realizations of the multivariate normal distribution. Each column of the matrix represents a realization of the multivariate normal distribution.

Author(s)

Joshua French

See Also

rmvnorm

Examples

n <- 20
mu <- 1:n
V <- exp(-dist1(matrix(rnorm(n))))
rmvnorm(nsim = 100, mu = mu, V = V, method = "eigen")

SpatialTools

Tools for Spatial Data Analysis

v1.0.4
GPL (>= 2)
Authors
Joshua French <joshua.french@ucdenver.edu>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.