Learn R Programming

mra (version 2.16.4)

F.sat.lik: F.sat.lik

Description

Calculate the log likelihood of a fully saturated time varying CJS model. Use to convert the relative deviance output by F.cjs.estim to actual deviance.

Usage

F.sat.lik(ch)

Arguments

ch
A capture history matrix consisting of 0's, 1's, and 2's.

Value

A scalar equal to the value of the saturated CJS log-likelihood. The saturated log-likelihood is the theoretical best predictive model possible, and actual deviance is calculated relative to this. See Examples.

Details

The number reported as deviance by F.cjs.estim is relative deviance, calculated as -2*log(likelihood). IF THERE ARE NO INDIVIDUAL-VARYING COVARIATES in the model, it is possible to compute the theoretical log-likelihood for a set of data assuming perfect prediction. This is the saturated log-likelihood. The actual deviance of a model is the deviance of the model relative to this theoretical maximum, computed as -2*((saturated log-likelihood) - 2*(model log-likelihood)).

In the parameterization of F.cjs.estim, all covariates are potentially individual and time varying, and in this case the saturated log-likelihood is unknown. Consequently, the saturated likelihood is not often needed in MRA. This routine was included as a utility function because the saturated likelihood is handy in some cases, including parametric bootstrapping to estimate C-hat.

Assuming cjs.fit is an estimated CJS model with time varying covariates only fit to histories in cjs.hists, compute deviance as

-F.sat.lik(cjs.hists) - 2*cjs.fit\$loglik = cjs.fit\$deviance - F.sat.lik(cjs.hists)

References

Look up "saturated model" in the program MARK help file for the equations implemented by this function.

See Also

F.cjs.estim

Examples

Run this code
data(dipper.histories)
xy <- F.cjs.covars( nrow(dipper.histories), ncol(dipper.histories) )
for(j in 1:ncol(dipper.histories)){ assign(paste("x",j,sep=""), xy$x[,,j]) } 
dipper.cjs <- F.cjs.estim( ~x2+x3+x4+x5+x6, ~x1+x2+x3+x4+x5, dipper.histories )
deviance <- -F.sat.lik( dipper.histories ) - 2*dipper.cjs$loglik
 

Run the code above in your browser using DataLab