loglik.Mtb: Negative log-likelihood for models M0, Mt, Mb, Mtb

Description Usage Arguments Details Value

View source: R/crfunctions.R

Description

Calculates the negative log-likelihood for models M0, Mt, Mb, Mtb.

Usage

1
loglik.Mtb(pars, chmat, prevcap = NULL, timecov = NULL)

Arguments

pars

Parameter vector with the correct number of parameters in the correct order (see Details).

chmat

Binary capture history matrix, with one row per individual detected and one column per capture occasion.

prevcap

Binary matrix of same size as chmat, with 0 indicating that the individual has not been captured by that occasion, and 1 indicating that it has. Used by the function to decide what the model is, so if it is not null, the model is taken to be Mb (if timecov is NULL) or Mtb (if timecov is not NULL).

timecov

Matrix of same size as chmat indicating the time associated with the capture occasion. At present it is treated as a factor.

Details

The function decides which model to use on the basis of which of prevcap and timecov are null. It assumes that pars has the appropriate number of parameters for the model, and in the appropriate order, as follows:

Value

The negative log-likelihood for the appropriate model.


david-borchers/mt5751a documentation built on Feb. 22, 2021, 4:01 a.m.