Skip to contents

Mirrors the C# MultivariateNormal class of the Numerics library.

Usage

mvdist_normal(
  mean,
  covariance,
  seed = NULL,
  max_evaluations = NULL,
  abs_error = NULL,
  rel_error = NULL
)

Arguments

mean

numeric vector of means, length d.

covariance

a d x d symmetric positive-definite covariance matrix.

seed

optional integer seed for the Genz quasi-Monte-Carlo integrator behind mvdist_cdf() at dimension three and above; NULL (the default) leaves it clock-seeded. Without a seed, mvdist_cdf() at dimension >= 3 is not reproducible run to run (it draws from a per-instance Mersenne Twister), so R and Python cannot agree on a value unless seed is set explicitly.

max_evaluations, abs_error, rel_error

optional integrator tuning; NULL (the default) for each leaves the ported upstream default untouched.

Value

a corehydro_mvdist of family "MultivariateNormal".

Examples

mv <- mvdist_normal(c(0, 0), diag(2))
mvdist_pdf(mv, c(0, 0))
#> [1] 0.1591549