dp.post.est {rmp}R Documentation

Posterior probability mass function estimation with DP prior

Description

Performs Bayesian probability mass function estimation under DP prior with Poisson base measure.

Usage

dp.post.est(x, y, alpha, lambda)

Arguments

x

Values on which to compute the pmf.

y

Vector of observed data.

alpha

DP precision parameter

lambda

Mean parameter for the Poisson base measure.

Details

Performs probability mass function estimation under th following model

y_i \mid P \sim P, i=1, \dots, n

P \sim DP(\alpha, P_0),

where P_0 is Poisson with mean lambda.

Value

A vector of size length(x) containing the probability masses

Author(s)

Antonio Canale

References

Carota, C., and Parmigiani, G. (2002), “Semiparametric Regression for Count Data,” Biometrika, 89, 265–281.

Examples

data(ethylene)
y <- tapply(ethylene$impl,FUN=mean,INDEX=ethylene$id)
z <- tapply(ethylene$dose,FUN=mean,INDEX=ethylene$id)

# Estimate the pmf of the number of implants in the control group
y0  <- y[z==0]
pmf.control = dp.post.est(0:30, y0, alpha = 1)

[Package rmp version 2.2 Index]