mwgGamma: Metropolis within Gibbs algorithm for a gamma random sample

Description Usage Arguments Examples

Description

Simulates realisations from the posterior distribution for the index and shape parameters in a gamma distribution based on a random sample and independent gamma priors by using a Metropolis within Gibbs algorithm and a normal random walk proposal for the index parameter

Usage

1
2
  mwgGamma(N, initial, innov, priorparam, n, xbar, xgbar,
    show = TRUE)

Arguments

N

length of MCMC chain

initial

starting value for the algorithm

innov

standard deviation of normal random walk innovation for index parameter

priorparam

prior parameters a,b,c,d

n

size of random sample

xbar

(arithmetic) mean of random sample

xgbar

geometric mean of random sample

show

logical. If true then acceptance rate for the proposals will be given

Examples

1
mcmcAnalysis(mwgGamma(100,(0.62/0.4)^2,0.8,c(2,1,3,1),50,0.62,0.46),rows=2)


Search within the mas3321 package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.