est.hmltm: Line transect estimation with a hidden Markov availability...

View source: R/est.R

est.hmltmR Documentation

Line transect estimation with a hidden Markov availability model.

Description

est.hmltm estimates group and individual density and abundance, together with mean group size, by stratum, from (1) line transect data that includes forward detection distances and (2) estimated Markov model or hidden Markov model availability prameters.

Usage

est.hmltm(
  dat,
  pars,
  FUN,
  models = list(y = NULL, x = NULL),
  survey.pars,
  hmm.pars,
  control.fit,
  control.opt,
  twosit = FALSE,
  notrunc = FALSE,
  W.est = NULL,
  groupfromy = NULL,
  Dstrat = unique(dat$stratum)
)

Arguments

dat

data frame in distance-like format, but including forward distances of detections. The following are compulsory elements (field name in quotes, contents in brackets): "stratum" (survey stratum: must be numeric), "area" (stratum area), "transect" (transect number: must be numeric), "L" (transect length), "size" (group size), "object" (unique detection identifier: must be numeric), "x" (perpendicular distance), "y" (forward distance).

pars

starting parameter values.

FUN

detection hazard functional form name (character). Currently implemented forms are "h.IP.0", "h.EP1.0", "h.EP2.0", "h.EP1x.0", "h.EP2x.0". (See Vignette "Specifying models and parameter starting values" for details.)

models

list of characters with elements $y and $x specifying models for the y- and x-dimension detection hazard scale parameters. Must be either NULL or regression model format (without response on left, e.g. "~size").

survey.pars

a list containing the following elements (in any order):

  • $spd speed of observer,

  • $W perpendicular distance right-truncation point,

  • $Wl perpendicular distance left-truncation point,

  • $ymax forward distance by which detection probability is effectively zero,

  • $dT availability process (Markov chain) time step size.

hmm.pars

a list containing the parameters of animals' availability processs hidden Markov model (HMM), as follows (in any order):

  • $Pi a 2x2xm HMM transition probability matrix, where m is the number of availability HMMs being used to model animal availability. If m>1, each set of HMM parameters is treated as a random sample from the set of HMM parameters in the population.

  • $pm a2xm matrix of HMM state-dependent Bernoulli distribution parameters (the probabilities of being available, given the animal's "behavioural" state - i.e. the state of the hidden Markov chain)

  • $delta a 2xm matrix of stationary distribution of a Markov chain, the ith of which has transition probability matrix Pi[,,i].

And if the HMM was constructed from mean times animals are available and unavailable (by means of function make.hmm.pars.from.Et for example), then also

  • $Et a 2xm matrix in which the first element is the mean time animals are UNavailable in a single available-unavailable cycle, and the second element is the corresponding mean time that they are available,

  • Sigma.Et a 2x2xm matrix, in which Sigma.Et[,,i] is the variance-covariance matrix of Et[,i.] (i.e. the variance-covariance matrix of Et for the ith availability model).

control.fit

list with elements

  • $hessian logical) - if TRUE Hessian is estimated and returned, else not,

  • $nx (scalar) - the number of intervals to use with Simpson's rule integration over y. nx=64 seems safe; smaller number makes computing faster.

control.opt

as required by optim (and hence by fit.hmltm).

twosit

TRUE if dat is in mrds format (with two lines per detection), else assumes that dat is in cds format (with one line per detection).

notrunc

if TRUE, does not do any perp dist truncation, else uses survey.pars$W and $Wl to do perp dist truncation.

W.est

right truncation perpendicular distance for estimation. Can't be less than maximum perpendicular distance (x) in the line transect data frame dat, but can be less than the max perpendicular distance used for fitting (survey.pars$W).

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).

Dstrat

vector containing the numbers of strata in which density is to be estimated (must be a subset of unique(dat$stratum).)

Value

A list with four elements: hmltm.fit, point, dat, W.est. Their contents are as follows:

hmltm.fit is the output from fit.hmltm, i.e. a list containing the following elements:

  • xy dat used in fitting (input reflection).

  • phats estimated detection probabilities of all detections.

  • phat 1/mean(1/phat).

  • pzero estimated detection probabilities at perpendicular distance.

  • 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).

point is a list containing two elements:

  • invp is a data frame containing one row for every observation, with the first three columns giving the stratum, transect and object identifier for the observation, and the final column (invp) giving the estimate of the inverse of the probability of detection for the observation.

  • ests is a data frame with one row per stratum and a final row for all strata combined, and columns giving the number of detections in the stratum (n), the line lingth in the stratum (L), the covered area in the stratum (covered.area=2WL), the stratum area (stratum.Area), the estimated group density in the stratum (Dgroups), the estimated group abunance in the stratum (Ngroups), the estimated mean group size in the stratum (mean.size), the individual denstiy in the stratum (D), and the abundance in the stratum (N).

dat is the data frame passed to est.hmltm.

W.est is the right perpendicular distance used for estimation (and passed to est.hmltm.)

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.