Learn R Programming

mcmcsae (version 0.7.8)

sim_marg_var: Compute a Monte Carlo estimate of the marginal variances of a (I)GMRF

Description

Estimate marginal variances of a (I)GMRF prior defined in terms of a sparse precision matrix and possibly a set of equality constraints. The marginal variances might be used to rescale the precision matrix such that a default prior for a corresponding variance component is more appropriate.

Usage

sim_marg_var(
  D,
  Q = NULL,
  R = NULL,
  r = NULL,
  eps1 = 1e-09,
  eps2 = 1e-09,
  nSim = 100L
)

Value

A vector of Monte Carlo estimates of the marginal variances.

Arguments

D

factor of precision matrix Q such that Q=D'D.

Q

precision matrix.

R

equality restriction matrix.

r

rhs vector for equality constraints \(R'x = r\), where \(R'\) denotes the transpose of R.

eps1

passed to create_cMVN_sampler.

eps2

passed to create_cMVN_sampler.

nSim

number of Monte Carlo samples used to estimate the marginal variances.

References

S.H. Sorbye and H. Rue (2014). Scaling intrinsic Gaussian Markov random field priors in spatial modelling. Spatial Statistics, 8, 39-51.