hbfm.DIC: Calculate DIC of hbfm

Description Usage Arguments Details Value References Examples

View source: R/hbfm_functions.R

Description

Function to calculate the Deviance Information Criterion (DIC) from hbfm.fit output.

Usage

1
hbfm.DIC(hbfm.list)

Arguments

hbfm.list

list where each element contains an hbfm.fit-class object; each element of the list contains an object from a different MCMC chain

Details

For each of the final M.save iterations of the MCMC, hbfm.fit calculates the log marginal likelihood, log(ML).

The DIC is calculated with the formula: DIC = mean(D) + pD; where D = -2*log(ML) and pD = var(D)/2.

Value

DIC of hbfm with Fac number of factors

References

Gelman, A., Carlin, J. B., Stern, H. S., & Rubin, D. B. (2004). Bayesian Data Analysis: 2nd Edition. Chapman and Hall/CRC.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
## Load dataset
data(gene.mat)

## Run stochastic EM first
## Consider F=5 factors
fit1 <- stoc.em(Y=gene.mat, Fac = 5)

## Run MCMC sampler with initial parameter values from stoc.em
fit.res1 <- hbfm.fit(fit1)

## Obtain estimated gene-gene correlations from MCMC samples
hbfm.DIC(list(fit.res1))


## End(Not run)

mnsekula/hbfm documentation built on June 29, 2020, 5:12 a.m.