PoissonNPP_MCMC {NPP}R Documentation

MCMC Sampling for Bernoulli Population using Normalized Power Prior

Description

Conduct posterior sampling for Poisson population with normalized power prior. For the power parameter \delta, a Metropolis-Hastings algorithm with either independence proposal, or a random walk proposal on its logit scale is used. For the model parameter \lambda, Gibbs sampling is used.

Usage

PoissonNPP_MCMC(Data.Cur, Data.Hist,
                CompStat = list(n0 = NULL, mean0 = NULL, n1 = NULL, mean1 = NULL),
                prior = list(lambda.shape = 1/2, lambda.scale = 100,
                             delta.alpha = 1, delta.beta = 1),
                MCMCmethod = 'IND', rw.logit.delta = 0.1,
                ind.delta.alpha= 1, ind.delta.beta= 1, nsample = 5000,
                control.mcmc = list(delta.ini = NULL, burnin = 0, thin = 1))

Arguments

Data.Cur

a non-negative integer vector of each observed current data.

Data.Hist

a non-negative integer vector of each observed historical data.

CompStat

a list of four elements that represents the "compatibility(sufficient) statistics" for \lambda. Default is NULL so the fitting will be based on the data. If the CompStat is provided then the inputs in Data.Cur and Data.Hist will be ignored.

n0 is the number of observations in the historical data.

mean0 is the sample mean of the historical data.

n1 is the number of observations in the current data.

mean1 is the sample mean of the current data.

prior

a list of the hyperparameters in the prior for both \lambda and \delta. A Gamma distribution is used as the prior of \lambda, and a Beta distribution is used as the prior of \delta.

lambda.shape is the shape (hyper)parameter in the prior distribution Gamma(shape, scale) for \lambda.

lambda.scale is the scale (hyper)parameter in the prior distribution Gamma(shape, scale) for \lambda.

delta.alpha is the hyperparameter \alpha in the prior distribution Beta(\alpha, \beta) for \delta.

delta.beta is the hyperparameter \beta in the prior distribution Beta(\alpha, \beta) for \delta.

MCMCmethod

sampling method for \delta in MCMC. It can be either 'IND' for independence proposal; or 'RW' for random walk proposal on logit scale.

rw.logit.delta

the stepsize(variance of the normal distribution) for the random walk proposal of logit \delta. Only applicable if MCMCmethod = 'RW'.

ind.delta.alpha

specifies the first parameter \alpha when independent proposal Beta(\alpha, \beta) for \delta is used. Only applicable if MCMCmethod = 'IND'

ind.delta.beta

specifies the first parameter \beta when independent proposal Beta(\alpha, \beta) for \delta is used. Only applicable if MCMCmethod = 'IND'

nsample

specifies the number of posterior samples in the output.

control.mcmc

a list of three elements used in posterior sampling.

delta.ini is the initial value of \delta in MCMC sampling.

burnin is the number of burn-ins. The output will only show MCMC samples after bunrin.

thin is the thinning parameter in MCMC sampling.

Details

The outputs include posteriors of the model parameter(s) and power parameter, acceptance rate in sampling \delta, and the deviance information criteria.

Value

A list of class "NPP" with four elements:

lambda

posterior of the model parameter \lambda.

delta

posterior of the power parameter \delta.

acceptance

the acceptance rate in MCMC sampling for \delta using Metropolis-Hastings algorithm.

DIC

the deviance information criteria for model diagnostics.

Author(s)

Zifei Han hanzifei1@gmail.com

References

Ibrahim, J.G., Chen, M.-H., Gwon, Y. and Chen, F. (2015). The Power Prior: Theory and Applications. Statistics in Medicine 34:3724-3749.

Duan, Y., Ye, K. and Smith, E.P. (2006). Evaluating Water Quality: Using Power Priors to Incorporate Historical Information. Environmetrics 17:95-106.

See Also

MultinomialNPP_MCMC; NormalNPP_MCMC; BerNPP_MCMC;

Examples

set.seed(1234)
DataHist <- rpois(n = 100, lambda = 49)
set.seed(12345)
DataCur <- rpois(n = 100, lambda = 49)

PoissonNPP_MCMC(Data.Cur = DataCur, Data.Hist = DataHist,
                CompStat = list(n0 = 20, mean0 = 10, n1 = 30, mean1 = 11),
                prior = list(lambda.shape = 1/2, lambda.scale = 100,
                             delta.alpha = 1, delta.beta = 1),
                MCMCmethod = 'RW', rw.logit.delta = 1,
                ind.delta.alpha= 1, ind.delta.beta= 1,nsample = 10000,
                control.mcmc = list(delta.ini = NULL, burnin = 2000, thin = 1))

[Package NPP version 0.6.0 Index]