fit_models: Fits a sequence of heterogeneity HugFullHet models

Description Usage Arguments Details Value Author(s)

View source: R/fit_models.r

Description

Fits a sequence of residual heterogeneity models for each formula specified. The models in order are the following: 1) ~-1+loc+c:het:rear - tag loss model, 2) ~loc+type - original hybrid observer model, 3) ~loc+type+c:het:rear - combined tagloss-hybrid approach, 4) ~loc - no residual heterogeneity (fitIndep==TRUE), 5) ~loc+type+c:het:rear - tag loss with estimated pi - proportion with p=0, and 6) ~loc independence except with estimated pi - proportion with p=0 Each model is fitted via HugFullHet but if pi=0 this becomes the Huggins model. Only models 5 and 6 have an estimated pi in which p=0 and for 1-pi mixture the p's are estimated. You can specify which of these 6 models are used with the logical argument "which".

Usage

1
2
3
4
5
6
fit_models(
  data,
  formulas = "",
  which = c(TRUE, TRUE, rep(FALSE, 4)),
  sim = FALSE
)

Arguments

data

dataframe containing double observer data with field ch (capture history), freq (optional), type ="u" (marked) or "c" (unmarked), count if more than one animal in each sighting.

formulas

character vector of formulas other than residual heterogeneity portion of the formula

which

logical vector indicating which of the 6 models are fitted to the data

sim

if TRUE, deletes output files

Details

If you were to use formulas=c("","lngs") the function will fit 2*sum(which) models.

Some of the heterogeneity models use the variable het in the data. If it is not in the data, it is created from ch.

Value

list containing: 1) marklist of fitted models, 2) Nhat_group, group abundance for each model, 3) Nhat, animal abundance if data$count exists.

Author(s)

Jeff Laake


jlaake/DoubleObs documentation built on Dec. 21, 2021, 12:12 a.m.