Description Usage Details Value Author(s) References See Also Examples
Runs the MCMC burn-in, sampling and produces diagnostic plots of convergence and autocorrelation.
1 | RunMCMC()
|
This function is the workhorse of the package Rgeoprofile. It takes the model parameters set by ModelParameters
and the prior surface set by CreateMaps
and uses them to run the DPM mixture model. The workflow of this function is as follows:
1) Integration over prior on concentration parameter alpha
2) Run the MCMC burn-in for the specified length of time. The comvergence of chains is shown at this point using the Gelman-Rubin diagnostic statistic, evaluated on the log-likelihood of the model. Once convergence falls under 1.1 and the minimum number of interations has been reached then the burn-in will terminate.
3) Take MCMC samples as defined by Samples
set in ModelParamters
the plots will show the group assignment of the data points every hundred iterations.
4) Combine information across all integrated surfaces and produce diagnostic plots. The four plots produced should be: The sigma trace, the posterior distribution of sigma, the auto correlation of the MCMC and the realsied number of sources created by the model.
Sigma |
The posterior draws from sigma |
Group |
The posterior group allocations of the points |
Frequencies |
The posterior group asigment organised by frequency of points to each source |
Sumdatax |
The sum of all x values for points assigned to each source, required for evaluation of posterior surface |
Sumdatay |
The sum of all y values for points assigned to each source, required for evaluation of posterior surface |
MD, Stevenson & R, Verity
The key description of this method can be found in:
Stevenson. M.D., and Verity, R. et al. (2013) Spatial targeting of infectious disease control:identifying multiple, unknown sources. MEE [In REVIEW]
For an introduction to Markov Chain Monte Carlo sampling see:
Gelman, A., Carlin, J. B., Stern, H. S., & Rubin, D. B. (2003). Bayesian data analysis. CRC press.
This function makes use of objects created by the functions: ModelParameters
, LoadData
and CreateMaps
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Not run:
### Load in data
### Assign a matrix of lon lat values to mydata
LoadData(Data=mydata)
### Load the model and graphic parameters (using defaults here)
ModelParameters()
GraphicParameters()
### Create the prior and maps
CreateMaps(PlotPrior = T)
### Run the MCMC
RunMCMC()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.