rmvn_chol: Generate Data from the Multivariate Normal Distribution Using...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/multiNorm-rmvn_chol.R

Description

Generate Data from the Multivariate Normal Distribution Using the Cholesky Decomposition

Usage

1
rmvn_chol(n, mu, sigmacap, varnames = NULL, data_frame = FALSE)

Arguments

n

Positive integer. n variates.

mu

Numeric vector. Parameter. Mean vector \boldsymbol{μ}.

sigmacap

Numeric matrix. Parameter. Covariance matrix \boldsymbol{Σ}.

varnames

Character vector Optional variable names.

data_frame

Logical. If data_frame = TRUE, returns a data.frame. If data_frame = FALSE, returns a matrix.

Value

A matrix (data_frame = FALSE) or data.frame (data_frame = TRUE).

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other Multivariate Normal Distribution Functions: grad_l_mvn_generic(), grad_l_mvn(), hess_l_mvn_generic(), hess_l_mvn(), l_mvn_generic(), l_mvn(), mvn_theta_helper(), negl_mvn()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
mu <- c(0, 0)
sigmacap <- matrix(
  data = c(
    1, 0.5, 0.5, 1
  ),
  nrow = 2
)

rmvn_chol(
  n = 5,
  mu = mu,
  sigmacap = sigmacap
)

jeksterslab/gammaMatrix documentation built on Dec. 20, 2021, 10:10 p.m.