getDIC: Compute the DIC given the output from 'lmeNBBayes'.

Description Usage Arguments Details Author(s) References See Also Examples

View source: R/nbinDPmix_C.R

Description

If partially marginalized posterior distribution (i.e. Reduce=1 in the computation of lmeNBBayes) is a target distribution, the DIC is computed using the focused likelihood

Pr(Y[i]=y[i]| { a[G[h]] }[h=1]^{M}, { r[G_h] }[h=1]^{M}, { H[h] }[h=1]^{M}, beta) .

If not, then the DIC is computed using the focused likelihood Pr(Y[i] |a[G[h[i]]],r[G[h[i]]], ,beta) .

Usage

1
2
3
4
getDIC(olmeNBB, data,
       ID, useSample=NULL,focus = c("FG","G","aGh.rGh","para"), 
       lower.alpha=0.0001,upper.alpha=0.99999,inc.alpha=0.0005)
llk.FG_i(ys,rs,aGs,bGs,ps)

Arguments

olmeNBB

The output of lmeNBBayes.

data

See lmeNBBayes.

ID

See the description in lmeNBBayes.

useSample

A vector of length the total number of repeated measures (i.e. the same as the length of Y), containing TRUE or FALSE, indicating which samples to be kept or discarded.

focus

Focused likelihood

lower.alpha

Used only when focus is FG. See details.

upper.alpha

Used only when focus is FG. See details.

inc.alpha

Used only when focus is FG. See details.

ys

A vector containing the response values

rs

A vector containing the size parameters of negative binomial. The length of rs must be the same as the length of ys.

aGs

A vector containing the shape1 parameters of the approximated infinite mixture of betas.

bGs

A vector containing the shape2 parameters of the approximated infinite mixture of betas. The length must be the same as the length of bGs.

ps

A vector containing the probability parameters of the approximated infinite mixture of betas. The length must be the same as the length of aGs.

Details

Denote P be a vector of "focused" parameters.

Using Spiegelhalter et. al.(2002)'s notation, the effective number of parmeters can be computed as:

p[D]=D.bar - D( P.bar)

where D is the deviance and the P.bar is the expectation of P.

When focus = FG then the focused parameters, denoted as P, are the random effect distribution (i.e.,infinite mixture of beta distribution) and the regression coefficients. In the computation, the expected regression coefficients are obtained by simply computing the mean of the posterior samples of coefficients. The expected infinite mixture of beta distribution is obtained in the following steps:

STEP 1: Provide a fine grids of points between [0,1]. We chose the grid of points to be

alphas <- seq(lower.alpha,upper.alpha,inc.alpha).

STEP 2: For each sampled infinite mixture of betas, Evaluate its value at every grid provided from STEP 1 for each sample. Obtain B by length(alphas) matrix.

STEP 3: Given the matrix from STEP2, at each grid of points, we compute the average value of density. Obtain a vector of length length(alpha), that contains the estimated expected random effect density at fine grid of points.

STEP 4: Given the estimated expected coefficients and the estimated expected random effect density, evaluate D(P.bar) by integrating the conditional likelihood given random effects with respect to the estimated expected random effect density from STEP 3.

Author(s)

Kondo, Y.

References

Kondo, Y., Zhao, Y. and Petkau, A.J., "A flexible mixed effect negative binomial regression model for detecting unusual increases in MRI lesion counts in individual multiple sclerosis patients".

Spiegelhalter, D.J.; Best, N. G.; Carlin, B.P., van der Linde, A. (2002). "Bayesian measures of model complexity and fit (with discussion)". Journal of the Royal Statistical Society, Series B 64 (4): 583-639.

See Also

lmeNBBayes dqmix index.batch.Bayes

Examples

1
## See the examples of function lmeNBBayes

lmeNBBayes documentation built on May 1, 2019, 7:58 p.m.