This function scales the precision matrix of a GMRF such that the geometric mean of the marginal variance is one.

scale_gmrf_precision(
  Q,
  A = matrix(1, ncol = ncol(Q)),
  eps = sqrt(.Machine$double.eps)
)

Arguments

Q

Precision matrix for a GMRF.

A

Linear constraint for Q.

eps

Value of the small constant added to the diagonal of Q for invertibility.

Details

This implements the same thing as INLA::inla.scale.model. The marginal variance of each connected component is one.