Fast ways to draw multivariate normals with linear constrains when the variance or precision matrix is sparse.
rmvnorm.const(n, mu = rep.int(0, dim(Sigma)[1]), Sigma, Rstruct = NULL,
A = array(1, c(1,dim(Sigma)[1])), a=0, U=NULL, ...)
rmvnorm.prec.const(n, mu = rep.int(0, dim(Q)[1]), Q, Rstruct = NULL,
A = array(1, c(1,dim(Q)[1])), a=0, U=NULL, ...)
rmvnorm.canonical.const(n, b, Q, Rstruct = NULL,
A = array(1, c(1,dim(Q)[1])), a=0, U=NULL, ...)
number of observations.
mean vector.
covariance matrix of class spam
.
precision matrix.
vector determining the mean.
the Cholesky structure of Sigma
or Q
.
Constrain matrix.
Constrain vector.
see below.
arguments passed to chol
.
Reinhard Furrer
The functions rmvnorm.prec
and rmvnorm.canonical
do not requrie sparse precision matrices.
For rmvnorm.spam
, the differences between regular and sparse
covariance matrices are too significant to be implemented here.
Often (e.g., in a Gibbs sampler setting), the sparsity structure of
the covariance/precision does not change. In such setting, the
Cholesky factor can be passed via Rstruct
in which only updates
are performed (i.e., update.spam.chol.NgPeyton
instead of a
full chol
).
See references in chol
.
rmvnorm.spam
.