Fast ways to draw multivariate normals with linear constrains when the variance or precision matrix is sparse.
rmvnorm.const(n, mu = rep(0, nrow(Sigma)), Sigma, Rstruct = NULL,
A = array(1, c(1,nrow(Sigma))), a=0, U=NULL, ...)
rmvnorm.prec.const(n, mu = rep(0, nrow(Q)), Q, Rstruct = NULL,
A = array(1, c(1,nrow(Q))), a=0, U=NULL, ...)
rmvnorm.canonical.const(n, b, Q, Rstruct = NULL,
A = array(1, c(1,nrow(Q))), 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
.
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
.