Topic: Growth
Topic Description:
Functions for analyzing tree growth, designed for the standard CTFS R Analytical Tables.
File: growth/growthfit.bin.r
| View File Source | Download File | No help file available |
Function: calculateBinModel.AIC
Function Description: calculateBinModel.AIC
Calculate AIC of the model, using various log(likelihood) estimators: with optim, the highest likelihood found by optim with mean, the mean llikelihood from the Gibbs sampler with gibbs, the maximum llikelihood from the Gibbs sampler with none, just return the mean Gibbs likelihoodFunction Arguments:
| Argument | Default Value |
|---|---|
| fit | |
| type | 'optim' |
Function Source:
calculateBinModel.AIC=function(fit,type='optim')
{
noparam=length(fit$best)+length(fit$bestSD)
if(type=='optim') return(fit$optimllike-2*noparam)
if(type=='mean') return(mean(fit$llike[fit$keep])-2*noparam)
if(type=='max') return(max(fit$llike[fit$keep])-2*noparam)
if(type=='none') return(max(fit$llike[fit$keep]))
return(NA)
}
{
noparam=length(fit$best)+length(fit$bestSD)
if(type=='optim') return(fit$optimllike-2*noparam)
if(type=='mean') return(mean(fit$llike[fit$keep])-2*noparam)
if(type=='max') return(max(fit$llike[fit$keep])-2*noparam)
if(type=='none') return(max(fit$llike[fit$keep]))
return(NA)
}