TMB Documentation
v1.9.11

Gaussian Markov Random Field. More...
#include <density.hpp>
Gaussian Markov Random Field.
Class to evaluate the negative log density of a mean zero multivariate normal distribution with a sparse precision matrix. Let Q denote the precision matrix. Then the density is proportional to Q^.5*exp(.5*x'*Q*x) Three constructors are available: 1. General case =============== The user supplies the precision matrix Q of class Eigen::SparseMatrix<Type> 2. Special case: GMRF on ddimensional lattice. =============================================== The user supplies a ddim lattice for which Q is automatically constructed like this: First order Gaussian Markov Random Field on (subset of) ddim grid. Grid is specified through the first array argument to constructor, with individual nodes determined by the outdermost dimension e.g. x= 1 1 2 2 1 2 1 2 corresponding to a 2x2 lattice with 4 nodes and d=2. Example of precision in 2D: 1 1 4+c 1 1 The precision Q is convolved with it self "order" times. This way more smoothness can be obtained. The quadratic form contribution is .5*x'*Q^order*x 3. Vector of deltas =================== The parameter "delta" describes the (inverse) correlation. It is allowed to specify a vector of deltas so that different spatial regions can have different spatial correlation. NOTE: The variance in the model depends on delta. In other words: The model may be thought of as an arbitrary scaled correlation model and is thus not really meaningful without an additional scale parameter (see SCALE_t and VECSCALE_t classes).
Definition at line 828 of file density.hpp.