fit.sscr: Fitting an SCR model with second-order spatial dependence

Description Usage Arguments

View source: R/fit-sscr.r

Description

Fits an SSCR model. Estimation is by maximum likelihood. The second-order spatial dependence is modelled via trap-level random effects for each detected individual. The likelihood function is calculated by integrating over these random effects using the Laplace approximation.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
fit.sscr(
  capt,
  traps,
  mask,
  resp = "binom",
  resp.pars = NULL,
  detfn = "hhn",
  cov.structure = "none",
  re.multiplier = "er",
  start = NULL,
  fix = NULL,
  toa = NULL,
  trace = FALSE,
  test = FALSE,
  test.conditional.n = TRUE,
  hess = FALSE,
  exact.gr = TRUE,
  optim.fun = "nlminb"
)

Arguments

capt

A capture history object. It should be a matrix, where the jth element of the ith row should provide a detection record of the ith individual at the jth detector.

traps

A matrix with two columns, providing the Cartesian coordinates of the detector locations.

mask

A mask object for integration over the survey area.

resp

Response distribution for capture history elements. Either "binom" for a binomial distribution, "pois" for a Poisson distribution, "nb" for a negative binomial distribution, "nba" for a negative binomial–alpha distribution, or "cmp" for a Conway-Maxwell-Poisson distribution.

resp.pars

A named vector of additional parameters for the response distribution. If resp is "binom", then this should have a single element named giving the fixed number of trials. If resp is "cmp", then this should have a single element for the start value of the estimated parameter nu (see rcmp). If resp is "nb", then this should have a single element for the start value of the estimated parameter size (see rnbinom).

detfn

Detection function, given by a character string. Use "hn", for halfnormal, "hhn" for hazard halfnormal, and "hr" for hazard rate.

cov.structure

Covariance structure of the random effects. The current options are (1) "none" for no random effects (regular SCR), (2) "independent", for independent random effects (equivalent to counts of detections being overdispersed), (3) "exponential", for random effects with an exponential covariance structure, (4) "sq_exponential" for random effects with a squared exponential covariance structure, (5) "matern", for random effects with a Matern covariance structure, (5) "individual", for random effects that are restricted to being the same at all traps (equivalent to having an independent random effect on lambda0 for each individual), or (6) "lc_exponential" for a linear combination of exponential covariance functions.

re.multiplier

A character string specifying how the expected encounter rate is calculated from the random effect. This is either (1) "er" for multiplication by the baseline encounter rate, or (2) "prob" for multiplication by the baseline encounter probability.

start

A named vector of parameter start values.

fix

A named vector of parameter values that are fixed in the model. Supercedes values provided in start.

toa

A matrix with the same dimensions as capt that provides time-of-arrival information for acoustic detections.

trace

Logical. If TRUE, parameter values for each step of the optimisation algorithm are printed.

test

Logical. If TRUE, the negative log-likelihood is calculated at parameter start values. If FALSE, a model is fitted. Alternatively, a character string. If "nll", then the negative log-likelihood is calculated. If "gr", then the partial derivatives of the negative log-likelihood function with respect to the parameters is also calculated. If "hess" then the Hessian if also calculated.

test.conditional.n

Logical. If TRUE, tests are carried out conditioning in the number of detections.

hess

Logical. If TRUE, a Hessian is computed and a variance-covariance matrix is returned.

exact.gr

Logical. If TRUE, partial derivatives of the likelihood with respect to parameters are calculated analytically via automatic differentiation. If FALSE they are approximated numerically.

optim.fun

A character string representing the R function to maximise the likelihood. This can be "bobyqa" (from package minqa), "nlminb", or "nlm".


b-steve/sscr documentation built on May 30, 2021, 1:23 a.m.