sampler.mvn | R Documentation |
mvn
(multivariate normal) object.Function generator for sampling from a mvn
(multivariate normal) object.
## S3 method for class 'mvn'
sampler(x, ...)
x |
The |
... |
Additional arguments to pass to the generated function that will be fixed during all calls. |
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.