Calculate Posterior Mode of the Power Parameter in Normalized Power Prior with Grid Search, Bernoulli Population
Calculate Posterior Mode of the Power Parameter in Normalized Power Prior with Grid Search, Bernoulli Population
The function returns the posterior mode of the power parameter δ in Bernoulli population. It calculates the log of the posterior density (up to a normalizing constant), and conduct a grid search to find the approximate mode.
Data.Cur: a non-negative integer vector of two elements: c(number of success, number of failure) in the current data.
Data.Hist: a non-negative integer vector of two elements: c(number of success, number of failure) in the historical data.
CompStat: a list of four elements that represents the "compatibility(sufficient) statistics" for p. 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. Note: in Bernoulli population providing CompStat is equivalent to provide the data summary as in Data.Cur and Data.Cur.
n0 is the number of trials in the historical data.
y0 is the number of successes in the historical data.
n1 is the number of trials in the current data.
y1 is the number of successes in the current data.
npoints: is a non-negative integer scalar indicating number of points on a regular spaced grid between [0, 1], where we calculate the log of the posterior and search for the mode.
prior: a list of the hyperparameters in the prior for both p and δ.
p.alpha is the hyperparameter α in the prior distribution Beta(α,β) for p.
p.beta is the hyperparameter β in the prior distribution Beta(α,β) for p.
delta.alpha is the hyperparameter α in the prior distribution Beta(α,β) for δ.
delta.beta is the hyperparameter β in the prior distribution Beta(α,β) for δ.