rho_sampler | R Documentation |
An R6 class for sampling the spatial autoregressive parameter ρ
An R6 class for sampling the spatial autoregressive parameter ρ
An R6Class
generator object
This class samples the spatial autoregressive parameter using either a tuned random-walk
Metropolis-Hastings or a griddy Gibbs step. Use the rho_priors
class for setup.
For the Griddy-Gibbs algorithm see Ritter and Tanner (1992).
rho_prior
The current rho_priors
curr_rho
The current value of ρ
curr_W
The current spatial weight matrix W; an n by n matrix.
curr_A
The current spatial filter matrix I - ρ W.
curr_AI
The inverse of curr_A
curr_logdet
The current log-determinant of curr_A
curr_logdets
A set of log-determinants for various values of ρ. See the
rho_priors
function for settings of step site and other parameters of the grid.
new()
rho_sampler$new(rho_prior, W = NULL)
rho_prior
The list returned by rho_priors
W
An optional starting value for the spatial weight matrix W
stopMHtune()
Function to stop the tuning of the Metropolis-Hastings step. The tuning of the Metropolis-Hastings step is usually carried out until half of the burn-in phase. Call this function to turn it off.
rho_sampler$stopMHtune()
setW()
rho_sampler$setW(newW, newLogdet = NULL, newA = NULL, newAI = NULL)
newW
The updated spatial weight matrix W.
newLogdet
An optional value for the log determinant corresponding to newW
and curr_rho
.
newA
An optional value for the spatial projection matrix using newW
and curr_rho
.
newAI
An optional value for the matrix inverse of newA
.
sample()
rho_sampler$sample(Y, mu, sigma)
Y
The n by T matrix of responses.
mu
The n by T matrix of means.
sigma
The variance parameter σ^2.
sample_Griddy()
rho_sampler$sample_Griddy(Y, mu, sigma)
Y
The n by T matrix of responses.
mu
The n by T matrix of means.
sigma
The variance parameter σ^2.
sample_MH()
rho_sampler$sample_MH(Y, mu, sigma)
Y
The n by T matrix of responses.
mu
The n by T matrix of means.
sigma
The variance parameter σ^2.
Ritter, C., and Tanner, M. A. (1992). Facilitating the Gibbs sampler: The Gibbs stopper and the griddy-Gibbs sampler. Journal of the American Statistical Association, 87(419), 861-868.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.