| sampler_RW_NN_GP | R Documentation |
A custom NIMBLE sampler for updating individual spatial random effects under a Nearest-Neighbor Gaussian Process (NNGP) approximation. This sampler uses a factorized likelihood approach to perform highly efficient local Metropolis-Hastings sampling with a normal proposal distribution (Metropolis, 1953), implementing the adaptation routine given in Shaby and Wells (2011).
sampler_RW_NN_GP(model, mvSaved, target, control)
model |
(uncompiled) model on which the MCMC is to be run |
mvSaved |
|
target |
The node to be sampled (a single spatial random effect scalar). |
control |
A list of control parameters:
|
Instead of calculating the full NNGP log-likelihood, which is O(M)
(where M is the total number of spatial locations), this sampler exploits
the Directed Acyclic Graph (DAG) structure of the NNGP to reduce the complexity
of a single-node update to O(k^2), where k is the number of neighbors.
During the MCMC configuration stage, the sampler automatically queries the local
graph architecture using get_single_reverse_neighbors and RWNNGP_setup
to resolve dependencies internally. When a single node w_i is updated,
only its own conditional density and the conditional densities of its "children"
(the reverse neighbors that depend on it) are affected.
The local log-Metropolis-Hastings ratio (\log MHR) is calculated as:
\log MHR = -\frac{(r_i^{*2} - r_i^2)}{2D_i} + \sum_{j \in \mathcal{R}(i)} -\frac{(r_j^{*2} - r_j^2)}{2D_j}
where:
r_i and r_i^* are the current and proposed conditional residuals for the target node.
\mathcal{R}(i) is the set of reverse neighbors (indices j such that i \in N(j)).
r_j and r_j^* are the current and proposed residuals for those reverse neighbors.
D represents the conditional variances.
The residuals are updated efficiently using the difference \delta = w_i^* - w_i,
such that r_j^* = r_j - A_{ji}\delta, where A_{ji} is the NNGP
regression coefficient.
Fabian Ketwaroo
Metropolis, N., Rosenbluth, A. W., Rosenbluth, M. N., Teller, A. H., and Teller, E. (1953). Equation of state calculations by fast computing machines. *The Journal of Chemical Physics*, 21(6), 1087-1092.
Shaby, B. A. and Wells, M. T. (2011). Exploring an adaptive Metropolis-Hastings algorithm. *Department of Statistical Science, Cornell University Tech Report*.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.