MCMC Sampling for Bernoulli Population of multiple ordered historical data using Normalized Power Prior
MCMC Sampling for Bernoulli Population of multiple ordered historical data using Normalized Power Prior
Multiple ordered historical data are incorporated together. Conduct posterior sampling for Bernoulli population with normalized power prior. For the power parameter γ, a Metropolis-Hastings algorithm with independence proposal is used. For the model parameter p, Gibbs sampling is used.
BerOMNPP_MCMC1(n0, y0, n, y, prior_gamma, prior_p, gamma_ind_prop, gamma_ini, nsample, burnin, thin, adjust =FALSE)
Arguments
n0: a non-negative integer vector: number of trials in historical data.
y0: a non-negative integer vector: number of successes in historical data.
n: a non-negative integer: number of trials in the current data.
y: a non-negative integer: number of successes in the current data.
prior_gamma: a vector of the hyperparameters in the prior distribution Dirichlet(α1,α2,...,αK) for γ.
prior_p: a vector of the hyperparameters in the prior distribution Beta(α,β) for p.
gamma_ind_prop: a vector of the hyperparameters in the proposal distribution Dirichlet(α1,α2,...,αK) for γ.
gamma_ini: the initial value of γ in MCMC sampling.
nsample: specifies the number of posterior samples in the output.
burnin: the number of burn-ins. The output will only show MCMC samples after burnin.
thin: the thinning parameter in MCMC sampling.
adjust: Logical, indicating whether or not to adjust the parameters of the proposal distribution.
Returns
A list of class "NPP" with three elements: - acceptrate: the acceptance rate in MCMC sampling for γ using Metropolis-Hastings algorithm.
p: posterior of the model parameter p.
delta: posterior of the power parameter δ. It is equal to the cumulative sum of γ.
Details
The outputs include posteriors of the model parameter(s) and power parameter, acceptance rate in sampling γ. The normalized power prior distribution is given by:
Here, π0(γ) and π0(θ) are the initial prior distributions of γ and θ, respectively. L(θ∣D0k) is the likelihood function of historical data D0k, and ∑i=1kγi is the corresponding power parameter.