Metropolis within Gibbs algorithm for a gamma random sample

Share:

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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.