Learn R Programming

DPpackage (version 1.1-7.4)

DPelicit: Performs a prior elicitation for the precision parameter of a DP prior

Description

This function performs a prior elicitation for the precision parameter of a DP prior. The function calculates:

1) the expected value and the standard deviation of the number of clusters, given the values of the parameters of the gamma prior for the precision parameter, a0 and b0, or

2) the value of the parameters a0 and b0 of the gamma prior distribution for the precision parameter, alpha, given the prior expected number and the standard deviation of the number of clusters.

Usage

DPelicit(n,method='JGL',a0=NULL,b0=NULL,mean=NULL,std=NULL)

Arguments

n

number of observations which distribution follows a DP prior.

method

the method to be used. See details.

a0

hyperparameter for the Gamma prior distribution of the precision parameter of the Dirichlet process prior, alpha ~ Gamma(a0,b0).

b0

hyperparameter for the Gamma prior distribution of the precision parameter of the Dirichlet process prior, \(alpha ~ Gamma(a0,b0)\).

mean

prior expected number of clusters when \(alpha ~ Gamma(a0,b0)\).

std

prior standard deviation for the number of clusters when \(alpha ~ Gamma(a0,b0)\).

Details

The methods supported by these functions are based on the fact that a priori E(alpha) = a0/b0 and Var(alpha) = a0/b0^2, and an additional approximation based on Taylor series expansion.

The default method, "JGL", is based on the exact value of the mean and the variance of the number of clusters given the precision parameter alpha (see, Jara, Garcia-Zatera and Lesaffre, 2007).

The Method "KMQ" is base on the Liu (1996) approximation to the expected value and the variance of the number of clusters given the precision parameter alpha (see, Kottas, Muller and Quintana, 2005).

Given the prior judgement for the mean and variance of the number of clusters, the equations are numerically solve for a0 and b0. With this objective, the Newton-Raphson algorithm and the forward-difference approximation to Jacobian are used.

References

Jara, A., Garcia-Zattera, M.J., Lesaffre, E. (2007) A Dirichlet Process mixture model for the analysis of correlated binary responses. Computational Statistics and Data Analysis 51: 5402-5415.

Kottas, A., Muller, P., Quintana, F. (2005) Nonparametric Bayesian modeling for multivariate ordinal data, Journal of Computational and Graphical Statistics 14: 610-625.

Liu, J.S. (1996) Nonparametric Hierarchical Bayes via Sequential Imputations, The Annals of Statistics, 24: 911-930.

Examples

Run this code
# NOT RUN {
    # Calculate the expected value and the standard deviation
    # for the number of cluster given alpha ~ Gamma(a0,b0).

      DPelicit(200,a0=2.01,b0=2.01,method="JGL")
      DPelicit(200,a0=2.01,b0=2.01,method="KMQ")

    # Calculate the values of a0 and b0, given the expected value 
    # and the standard deviation of the number of clusters

      DPelicit(200,mean=3.1,std=2.7,method="JGL")
      DPelicit(200,mean=3.1,std=2.7,method="KMQ")
# }

Run the code above in your browser using DataLab