NPP (version 0.1.0)

ModeDeltaMultinomialNPP: Calculate Posterior Mode of the Power Parameter in Normalized Power Prior with Grid Search, Multinomial Population

Description

The function returns the posterior mode of the power parameter \(\delta\) in multinomial population. It calculates the log of the posterior density (up to a normalizing constant), and conduct a grid search to find the approximate mode.

Usage

ModeDeltaMultinomialNPP(Data.Cur, Data.Hist, CompStat = list(n0 = NULL, n1 = NULL),
                        npoints = 1000, prior = list(theta.dir.alpha = c(0.5, 0.5, 0.5),
                        delta.alpha = 1, delta.beta = 1))

Arguments

Data.Cur

a non-negative integer vector of \(K\) elements: c(number of success in group 1, number of success in group 2, ..., number of success in group \(K\)) in the current data.

Data.Hist

a non-negative integer vector of \(K\) elements: c(number of success in group 1, number of success in group 2, ..., number of success in group \(K\)) in the historical data.

CompStat

a list of two elements that represents the "compatibility(sufficient) statistics" for \(\theta\). 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 multinomial case providing CompStat is equivalent to provide the data summary as in Data.Cur and Data.Cur.

n0 is a non-negative integer vector of \(K\) elements for compatible statistics in historical data: c(number of success in group 1, number of success in group 2, ..., number of success in group \(K\)).

n1 is a non-negative integer vector of \(K\) elements for compatible statistics in current data: c(number of success in group 1, number of success in group 2, ..., number of success in group \(K\)).

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 \(\delta\).

theta.dir is a vector of \(K\) elements of the hyperparameter \(\alpha\) in the prior distribution \(Dir(\alpha[1],\alpha[2],...,\alpha[K])\) for \(\theta\).

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

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

Value

A numeric value between 0 and 1.

Details

See example.

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

ModeDeltaBerNPP; ModeDeltaNormalNPP; ModeDeltaPoisNPP

Examples

Run this code
# NOT RUN {
ModeDeltaMultinomialNPP(CompStat = list(n0 = c(25,25,25,25), n1 = c(25,25,25,25)),
                        prior = list(theta.dir.alpha = c(0.5, 0.5, 0.5, 0.5),
                                     delta.alpha = 1, delta.beta = 1))

ModeDeltaMultinomialNPP(CompStat = list(n0 = c(22,25,28,25), n1 = c(25,22,25,28)),
                        prior = list(theta.dir.alpha = c(0.5, 0.5, 0.5, 0.5),
                                     delta.alpha = 1, delta.beta = 1))

ModeDeltaMultinomialNPP(CompStat = list(n0 = c(15,25,30,30), n1 = c(25,25,25,25)),
                        prior = list(theta.dir.alpha = c(0.5, 0.5, 0.5, 0.5),
                                     delta.alpha = 1, delta.beta = 1))
# }

Run the code above in your browser using DataCamp Workspace