mvn (multivariate normal) object.R/mvn.R
sampler.mvn.RdFunction generator for sampling from a mvn (multivariate normal) object.
# S3 method for class 'mvn'
sampler(x, ...)A function that samples from the mvn distribution. It accepts as
input:
- n: number of samples to generate. Defaults to 1.
- mu: a vector denoting the population mean. Defaults to the mean
of x (an mvn object)
- sigma: a matrix denoting the covariance of observations.
Defaults to the variance-covariance of x.
- p: probability region to sample from. Defaults to 1, which
corresponds to the entire distribution.
sample_mvn_region method. It's used when p is less than 1.
- ...: any additional parameters to pass to rmvnorm or
sample_mvn_region which can be different during each call.