Learn R Programming

NPP (version 0.6.0)

BerMNPP_MCMC1: MCMC Sampling for Bernoulli Population with Multiple Historical Data using Normalized Power Prior

Description

Incorporate multiple historical data sets for posterior sampling of a Bernoulli population using the normalized power prior. The Metropolis-Hastings algorithm, with either an independence proposal or a random walk proposal on the logit scale, is applied for the power parameter \(\delta\). Gibbs sampling is utilized for the model parameter \(p\).

Usage

BerMNPP_MCMC1(n0, y0, n, y, prior_p, prior_delta_alpha,
                prior_delta_beta, prop_delta_alpha, prop_delta_beta,
                delta_ini, prop_delta, rw_delta, nsample, burnin, thin)

Value

A list of class "NPP" comprising:

acceptrate

Acceptance rate in MCMC sampling for \(\delta\) via the Metropolis-Hastings algorithm.

p

Posterior distribution of the model parameter \(p\).

delta

Posterior distribution of the power parameter \(\delta\).

Arguments

n0

A non-negative integer vector representing the number of trials in historical data.

y0

A non-negative integer vector denoting the number of successes in historical data.

n

A non-negative integer indicating the number of trials in the current data.

y

A non-negative integer for the number of successes in the current data.

prior_p

a vector of the hyperparameters in the prior distribution \(Beta(\alpha, \beta)\) for \(p\).

prior_delta_alpha

a vector of the hyperparameter \(\alpha\) in the prior distribution \(Beta(\alpha, \beta)\) for each \(\delta\).

prior_delta_beta

a vector of the hyperparameter \(\beta\) in the prior distribution \(Beta(\alpha, \beta)\) for each \(\delta\).

prop_delta_alpha

a vector of the hyperparameter \(\alpha\) in the proposal distribution \(Beta(\alpha, \beta)\) for each \(\delta\).

prop_delta_beta

a vector of the hyperparameter \(\beta\) in the proposal distribution \(Beta(\alpha, \beta)\) for each \(\delta\).

delta_ini

the initial value of \(\delta\) in MCMC sampling.

prop_delta

the class of proposal distribution for \(\delta\).

rw_delta

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

nsample

specifies the number of posterior samples in the output.

burnin

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

thin

the thinning parameter in MCMC sampling.

Author

Qiang Zhang zqzjf0408@163.com

Details

The outputs include posteriors of the model parameter(s) and power parameter, acceptance rate in sampling \(\delta\). The normalized power prior distribution is $$\frac{\pi_0(\delta)\pi_0(\theta)\prod_{k=1}^{K}L(\theta|D_{0k})^{\delta_{k}}}{\int \pi_0(\theta)\prod_{k=1}^{K}L(\theta|D_{0k})^{\delta_{k}} d\theta}.$$

Here \(\pi_0(\delta)\) and \(\pi_0(\theta)\) are the initial prior distributions of \(\delta\) and \(\theta\), respectively. \(L(\theta|D_{0k})\) is the likelihood function of historical data \(D_{0k}\), and \(\delta_k\) is the corresponding power parameter.

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

BerMNPP_MCMC2; BerOMNPP_MCMC1; BerOMNPP_MCMC2

Examples

Run this code
BerMNPP_MCMC1(n0 = c(275, 287), y0 = c(92, 125), n = 39, y = 17,
              prior_p = c(1/2,1/2), prior_delta_alpha = c(1/2,1/2),
              prior_delta_beta = c(1/2,1/2),
              prop_delta_alpha = c(1,1)/2, prop_delta_beta = c(1,1)/2,
              delta_ini = NULL, prop_delta = "IND",
              nsample = 2000, burnin = 500, thin = 2)

Run the code above in your browser using DataLab