Scythe-1.0.3
template<class RNGTYPE >
template<matrix_order PO1, matrix_style PS1, matrix_order PO2, matrix_style PS2, matrix_order PO3, matrix_style PS3, matrix_order PO4, matrix_style PS5, matrix_order PO5, matrix_style PS4>
scythe::rtmvnorm< RNGTYPE >::rtmvnorm ( const Matrix< double, PO1, PS1 > &  mu,
const Matrix< double, PO2, PS2 > &  sigma,
const Matrix< double, PO3, PS3 > &  D,
const Matrix< double, PO4, PS4 > &  a,
const Matrix< double, PO5, PS5 > &  b,
rng< RNGTYPE > &  generator,
unsigned int  burnin = 0,
unsigned int  thin = 1,
bool  preinvertedD = false 
) [inline]

Standard constructor.

This method constructs a functor capable of generating linearly constrained variates of the form: $x \sim N_n(\mu, \Sigma), a \le Dx \le b$. That is, it generates an object capable of simulating random variables from an n-variate normal distribution defined by mu ( $\mu$) and sigma ( $\Sigma$) subject to fewer than $n$ linear constraints, defined by the Matrix D and the bounds vectors a and b.

The user may pass optional burn in and thinning parameters to the constructor. The burnin parameter indicates the number of draws that the sampler should initially make and throw out on construction. The thin parameter controls the behavior of the functor's () operator. A thinning parameter of 1 indicates that each call to operator()() should return the random variate generated by one iteration of the Gibbs sampler, while a value of 2 indicates that the sampler should throw every other variate out, a value of 3 causes operator()() to iterate the sampler three times before returning, and so on.

Finally, this constructor inverts D before proceeding. If you have pre-inverted D, you can set the preinvertedD flag to true and the functor will not redo the operation. This helps optimize common cases; for example, when D is simply the identity matrix (and thus equal to its own inverse), there is no need to compute the inverse.

Parameters:
muAn n x 1 vector of means.
sigmaAn n x n variance-covariance matrix.
DAn n x n linear constraint definition matrix; should be of rank n.
aAn n x 1 lower bound vector (may contain infinity or negative infinity).
bAn n x 1 upper bound vector (may contain infinity or negative infinity).
generatorReference to an rng object
burninOptional burnin parameter; default value is 0.
thinOptional thinning parameter; default value is 1.
preinvertedDOptional flag with default value of false; if set to true, functor will not invert D.
Exceptions:
scythe_dimension_error(Level 1)
scythe_conformation_error(Level 1)
scythe_invalid_arg(Level 1)
See also:
operator()()
rng

References scythe::inv(), scythe::Matrix_base< ORDER, STYLE >::isColVector(), scythe::Matrix_base< ORDER, STYLE >::isSquare(), scythe::Matrix_base< ORDER, STYLE >::rows(), SCYTHE_CHECK_10, scythe::sqrt(), and scythe::t().