dmvnormal: Multivariate Gaussian density and simulation

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

View source: R/RcppExports.R

Description

Fast simulation from and evaluation of multivariate Gaussian probability densities.

Usage

1
2
3
dmvnormal(x, mu, sigma)

rmvnormal(n, mu, sigma)

Arguments

x

A p times k matrix of quantiles. Each rows correspond to a realization from the density and each column corresponds to a dimension.

mu

The mean vector of dimension k.

sigma

The variance-covariance matrix of dimension k times k.

n

The number of observations to be simulated.

Details

dmvnormal functions similarly to dmvnorm from the mvtnorm-package and likewise for rmvnormal and rmvnorm.

Value

dmvnormal returns a 1 by p matrix of the probability densities corresponding to each row of x. sigma. Each row corresponds to an observation.

rmvnormal returns a p by k matrix of observations from a multivariate normal distribution with the given mean mu and covariance

Author(s)

Anders Ellern Bilgrau

See Also

dmvnorm and rmvnorm in the mvtnorm-package.

Examples

1
2
3
4
dmvnormal(x = matrix(rnorm(300), 100, 3),
          mu = 1:3,
          sigma = diag(3))
rmvnormal(n = 10, mu = 1:4, sigma = diag(4))

GMCM documentation built on Nov. 6, 2019, 1:08 a.m.