An R6 class for sampling the spatial autoregressive parameter \(\rho\)
An R6 class for sampling the spatial autoregressive parameter \(\rho\)
An R6Class generator object
rho_priorThe current rho_priors
curr_rhoThe current value of \(\rho\)
curr_WThe current spatial weight matrix \(W\); an \(n\) by \(n\) matrix.
curr_AThe current spatial filter matrix \(I - \rho W\).
curr_AIThe inverse of curr_A
curr_logdetThe current log-determinant of curr_A
curr_logdetsA set of log-determinants for various values of \(\rho\). 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_priorThe list returned by rho_priors
WAn 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)newWThe updated spatial weight matrix \(W\).
newLogdetAn optional value for the log determinant corresponding to newW and curr_rho.
newAAn optional value for the spatial projection matrix using newW and curr_rho.
newAIAn optional value for the matrix inverse of newA.
sample()rho_sampler$sample(Y, mu, sigma)YThe \(n\) by \(T\) matrix of responses.
muThe \(n\) by \(T\) matrix of means.
sigmaThe variance parameter \(\sigma^2\).
sample_Griddy()rho_sampler$sample_Griddy(Y, mu, sigma)YThe \(n\) by \(T\) matrix of responses.
muThe \(n\) by \(T\) matrix of means.
sigmaThe variance parameter \(\sigma^2\).
sample_MH()rho_sampler$sample_MH(Y, mu, sigma)YThe \(n\) by \(T\) matrix of responses.
muThe \(n\) by \(T\) matrix of means.
sigmaThe variance parameter \(\sigma^2\).
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).
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.