mwgGamma: Metropolis within Gibbs algorithm for a gamma random sample

Description Usage Arguments Examples

View source: R/mh.R

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)

mas3321 documentation built on May 2, 2019, 4:42 p.m.

Related to mwgGamma in mas3321...