| rho_sampler {estimateW} | R Documentation | 
An R6 class for sampling the spatial autoregressive parameter \rho
Description
An R6 class for sampling the spatial autoregressive parameter \rho
An R6 class for sampling the spatial autoregressive parameter \rho
Format
An R6Class generator object
Details
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).
Public fields
- rho_prior
- The current - rho_priors
- curr_rho
- The current value of - \rho
- curr_W
- The current spatial weight matrix - W; an- nby- nmatrix.
- curr_A
- The current spatial filter matrix - I - \rho 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 - \rho. See the- rho_priorsfunction for settings of step site and other parameters of the grid.
Methods
Public methods
Method new()
Usage
rho_sampler$new(rho_prior, W = NULL)
Arguments
- rho_prior
- The list returned by - rho_priors
- W
- An optional starting value for the spatial weight matrix - W
Method 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.
Usage
rho_sampler$stopMHtune()
Method setW()
Usage
rho_sampler$setW(newW, newLogdet = NULL, newA = NULL, newAI = NULL)
Arguments
- newW
- The updated spatial weight matrix - W.
- newLogdet
- An optional value for the log determinant corresponding to - newWand- curr_rho.
- newA
- An optional value for the spatial projection matrix using - newWand- curr_rho.
- newAI
- An optional value for the matrix inverse of - newA.
Method sample()
Usage
rho_sampler$sample(Y, mu, sigma)
Arguments
- Y
- The - nby- Tmatrix of responses.
- mu
- The - nby- Tmatrix of means.
- sigma
- The variance parameter - \sigma^2.
Method sample_Griddy()
Usage
rho_sampler$sample_Griddy(Y, mu, sigma)
Arguments
- Y
- The - nby- Tmatrix of responses.
- mu
- The - nby- Tmatrix of means.
- sigma
- The variance parameter - \sigma^2.
Method sample_MH()
Usage
rho_sampler$sample_MH(Y, mu, sigma)
Arguments
- Y
- The - nby- Tmatrix of responses.
- mu
- The - nby- Tmatrix of means.
- sigma
- The variance parameter - \sigma^2.
References
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.