Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

poisson.gamma.mix

Computes the posterior for Poisson sampling and a mixture of gammas prior


Description

Computes the parameters and mixing probabilities for a Poisson sampling problem where the prior is a discrete mixture of gamma densities.

Usage

poisson.gamma.mix(probs,gammapar,data)

Arguments

probs

vector of probabilities of the gamma components of the prior

gammapar

matrix where each row contains the shape and rate parameters for a gamma component of the prior

data

list with components y, vector of counts, and t, vector of time intervals

Value

probs

vector of probabilities of the gamma components of the posterior

gammapar

matrix where each row contains the shape and rate parameters for a gamma component of the posterior

Author(s)

Jim Albert

Examples

probs=c(.5, .5)
gamma.par1=c(1,1)
gamma.par2=c(10,2)
gammapar=rbind(gamma.par1,gamma.par2)
y=c(1,3,2,4,10); t=c(1,1,1,1,1)
data=list(y=y,t=t)
poisson.gamma.mix(probs,gammapar,data)

LearnBayes

Functions for Learning Bayesian Inference

v2.15.1
GPL (>= 2)
Authors
Jim Albert
Initial release
2018-03-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.