sampler: Function need to multivariate samples of a truncated...

Description Usage Arguments Value

Description

As rtmvnorm only allows one mean vector of one multivariate normal distribution, but we need different mean vectors for different multivariate normal distributions, we implement this function. This function in combination with apply, allows us to sample from a truncated multivariate normal distribution with different mean vectors.

Usage

1
sampler(elements, Sigma)

Arguments

elements

Originally a matrix, but when passed to samp, it is a vector. The first length_mean elements are the mean vector of g and y, the next two elements are the lower bounds for g and y, the last two elements are the upper bounds for g and y.

Sigma

The covariance matrix of the multivariate normal distribution to sample from.

Value

A length_mean x 1 matrix with the samples for g and y.


hmi documentation built on Oct. 23, 2020, 7:31 p.m.