fit.hmltm: Fit detection hazard with a Markov or hidden Markov...

View source: R/fitting.R

fit.hmltmR Documentation

Fit detection hazard with a Markov or hidden Markov availability model.

Description

fit.hmltm Estimates detection probability from (1) line transect data that includes forward detection distances and (2) estimated Markov model or hidden Markov model availability prameters.

Usage

fit.hmltm(
  xy,
  pars,
  FUN,
  models = list(y = NULL, x = NULL),
  survey.pars,
  hmm.pars,
  control.fit,
  control.optim,
  groupfromy = NULL
)

Arguments

xy

data frame with one line per detection containing perpendicular distance ($x) and forward distance ($y) and any covariates in the model.

pars

starting parameter values.

FUN

detection hazard functional form name (character)

models

list of characters with elements $y and $x specifying y- and x-covariate models. Either NULL or regression model format (without response on left).

survey.pars

list.

hmm.pars

HMM parameters of animals' availability data.

control.fit

list with elements: $hessian (logical) - if TRUE Hessian is estimated and returned, else not; $nx (scalar) - determines the number of intervals to use with Simpson's rule integration over y. nx=64 seems safe; smaller number makes computing faster.

control.optim

as required by optim.

groupfromy

a forward distance (y) below which all y's are grouped into a single interval in the likelihood function (i.e. exact y,s < groupfromy are combined into an interval rather than passed as exact distances).

Value

A list comprising:

  • xy dat used in fitting (input reflection).

  • phats estimated detection probabilities of all detections.

  • phat 1/mean(1/phats).

  • pzero estimated detection probabilities at perpendicular distance zero for detected population.

  • h.fun =FUN (input reflection).

  • models =models (input reflection).

  • fit output from fit.xy.

  • Loglik log-likelihood function at MLE.

  • AIC AIC.

  • x vector of x-values for plotting perpendicular distance fit.

  • p vector of detection function values for plotting perpendicular distance fit.

  • fitpars a list containing all the given parameters controlling the fit (survey.pars,hmm.pars, control.fit,control.optim).

References

Borchers, D.L., Zucchini, W., Heide-Jorgenssen, M.P., Canadas, A. and Langrock, R. 2013. Using hidden Markov models to deal with availability bias on line transect surveys. Biometrics.


david-borchers/hmltm documentation built on Oct. 29, 2023, 9:07 p.m.