Naive Gibbs Sampling with Metropolis Steps
Longhai Li, Department of Mathematics and Statistics, University of Saskatchewan
Description
This package provides two generic functions for performing Markov chain sampling in a naive way for a user-defined target distribution, which involves only continuous variables. The function "gibbs_met" performs Gibbs sampling with each 1-dimensional distribution sampled with Metropolis update using Gaussian proposal distribution centered at the previous state. The function "met_gaussian" updates the whole state with Metropolis method using independent Gaussian proposal distribution centered at the previous state. The sampling is carried out without considering any special tricks for improving efficiency. This package is aimed at only routine applications of MCMC in moderate-dimensional problems.
Copyright
Permission is granted for anyone to copy, use, modify, or distribute these programs and accompanying documents for any purpose, provided this copyright notice is retained and prominently displayed, and note is made of any changes made to these programs. These programs and documents are distributed without any warranty, express or implied. As the programs were written for research purposes only, they have not been tested to the degree that would be advisable in any important application. All use of these programs is entirely at the user's own risk.
If you found that this software is useful in your work, please do not hesitate to cite the software.
Documentations and Source Packages
- gibbs.met_1.1-3, released 02/04/2008, Documentation: gibbs.met_1.1-3.pdf, source package: gibbs.met_1.1-3.tar.gz
- gibbs.met_1.1-2, released 26/03/2008, Documentation: gibbs.met_1.1-2.pdf, source package: gibbs.met_1.1-2.tar.gz
References
The methods can be found from any standard textbook introducing Markov chain Monte Carlo.
Instruction of Installing an R package
This is an R add-on package. R is a free software environment for statistical computing and graphics, available from http://www.r-project.org/. You need to install R and add this package.
Install
Method 1: Install from source
R instruction for installing from source package can be found by typing ?INSTALL in R console. Simply, you need to do the following:
Download the add-on R package, say mypkg, and type the following command in Unix console to install it to /my/own/R-packages/:
$ R CMD INSTALL mypkg -l /my/own/R-packages/
Method 2: Install from CRAN directly
Type the following command in R console to install it to /my/own/R-packages/ directly from CRAN:
> install.packages("mypkg", lib="/my/own/R-packages/")
Load the library
Type the following command in R console to load the package
> library("mypkg", lib.loc="/my/own/R-packages/")
Instruction of using R
- Official R manuals
- A short R tutorial with examples (PDF, 19 pages) by myself
Back to Longhai Li's software packages