Description Usage Arguments Details Value Author(s) References Examples
General function to make use of sparse matrix methods to efficiently simulate random multivariate normal random variables with sparse precision matrices.
1 2 3 |
Q |
Precision matrix, defined as a sparse Matrix object. |
mu |
Mean vector of dimension equal to the dimension of Q. |
X |
Matrix of vectors which should be orthogonal to the simulated random variable. |
zero.constraint |
If TRUE, then the simulated random variable is orthogonal to the columns of X. |
canon |
If TRUE, then draw from the 'canonical form'. |
diag.adjust |
Numeric value to be added to the diagonal of Q to make it positive definite. |
In the 'canonical form', the variable is drawn from:
v~N(Q^-1 mu, Q^-1)
In the non-canonical form, the variable is drawn from
v~N( mu, Q^-1)
A vector of the resulting random variable.
Ephraim M. Hanks
Rue and Held 2005. Gaussian Markov Random Fields: theory and applications. Chapman and Hall.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Loading required package: raster
Loading required package: sp
Loading required package: Matrix
Loading required package: mvtnorm
Loading required package: MASS
Attaching package: 'MASS'
The following objects are masked from 'package:raster':
area, select
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.