DIC: DIC CALCULATES INFORMATION CRITERION GIVEN THE MCMC CHAINS...

Description Usage Arguments Details Value Author(s) References Examples

Description

The DIC function calculates the Deviance Information Criterion given the MCMC chains from an estimateMRH routine, using the formula: DIC = .5*var(D)+mean(D), where D is the chain of -2*log(L), calculated at each retained iteration of the MCMC routine. It also provides the Aikaike Information Criterion (AIC) = 2*p + D and the Bayesian Information Criterion (BIC) = p*ln(n) + D, where ‘p’ is the number of parameters in the model. Both AIC and BIC report the maximum (i.e. "worst") values in the chain.

Usage

1
DIC(mrhobject, n)

Arguments

mrhobject

The chains found in the MCMCchains.txt file, created using the estimateMRH routine, or the MRH results object.

n

The sample size of the original dataset. If n is not entered, the BIC calculation will not be returned to the user.

Details

The number of parameters ‘p’ is calculated as 2^M (one for each split parameter Rmp, and one for the cumulative hazard at H), plus 2 for a and lambda (parameters in the Gamma prior for H), and one for each covariate included under the proportional hazards assumption. If k and/or gamma are sampled (parameters in the prior for Rmp), the number of estimated parameters is increased by 1 for k and 2^M-1 for gamma. If a covariate is included under the non-proportional hazards assumption, the number of estimated parameters (excluding any covariates included under the proportional hazards assumption) is multiplied by the number of strata in the non-proportional covariate.

Value

DIC returns the DIC, AIC, and BIC values, as well as a summary of D (-2*loglike).

loglik.summ

The summary of the chain of -2*loglike values.

ICtable

Table containing the DIC, AIC and BIC values.

Author(s)

Yolanda Hagar <yolanda.hagar@colorado.edu> and Vanja Dukic

References

Gelman, A., Carlin, J., Stern, H., Dunson, D., Vehtari, A., Rubin, D. (2004) Bayesian Data Analysis.

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, 583–639.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# These MRH fit portion of the examples 
# are from the estimateMRH() help page.  
# They do not need to be re-run if the 
# objects are already in the active workspace.
data(cancer)
cancer$censorvar = cancer$status - 1
## Not run: 
fit.lung = estimateMRH(formula = Surv(time, censorvar) ~ 
	age + as.factor(sex) + ph.karno, data = cancer,
	M = 3, maxStudyTime = 960, burnIn = 200, maxIter = 1000, 
	thin = 1, outfolder = 'MRH_lung')

fit.lung.prune = estimateMRH(formula = Surv(time, censorvar) ~ 
	age + as.factor(sex) + ph.karno, data = cancer,
	M = 3, maxStudyTime = 960, burnIn = 200, maxIter = 1000, 
	thin = 1, prune = TRUE, outfolder = 'MRH_lung_prune')
## End(Not run)
	
# Compare the DIC of the pruned and unpruned models.
# The sample size must be entered for calculation of BIC.
# This number can be found in the ``MCMCInfo.txt" file
# in the output folder.
## Not run: 
DIC(fit.lung, n = 227)
DIC(fit.lung.prune, n = 227)
## End(Not run)

Example output

Loading required package: survival
Loading required package: KMsurv

 MCMC routine running.  Calculating estimated runtime for 1000 iterations... 

Estimated total run time is 7 seconds 

To shorten the run time, re-run with fewer iterations or a smaller number of bins. 

[1] Estimation routine finished, preparing results....
Warning message:
In estimateMRH(formula = Surv(time, censorvar) ~ age + as.factor(sex) +  :
  Algorithm has not yet converged after  MCMC iterations. 
					  Parameter estimates may not be reliable. 

 MCMC routine running.  Calculating estimated runtime for 1000 iterations... 

Estimated total run time is 2 seconds 

To shorten the run time, re-run with fewer iterations or a smaller number of bins. 

[1] Estimation routine finished, preparing results....
$neg2loglik.summ
                    value
Min.    2274.881998951880
1st Qu. 2284.750003635520
Median  2295.648649076300
Mean    2310.638574601637
3rd Qu. 2321.570848911710
Max.    2640.755367471930

$ICtable
                value
DIC 3170.153801017520
AIC 2666.755367471930
BIC 2711.279717699188

$neg2loglik.summ
                    value
Min.    2284.204816137010
1st Qu. 2290.535004374530
Median  2299.062542291650
Mean    2311.585102371399
3rd Qu. 2318.981177234930
Max.    2551.447364974180

$ICtable
                value
DIC 2929.133607790591
AIC 2565.447364974180
BIC 2589.422015096550

MRH documentation built on May 2, 2019, 11:10 a.m.