autoDistSamp: Automated classical distance analysis

autoDistSampR Documentation

Automated classical distance analysis

Description

Perform automated classical detection function selection and estimation of abundance.

Usage

autoDistSamp(
  formula,
  detectionData,
  siteData,
  w.lo = 0,
  w.hi = NULL,
  likelihoods = c("halfnorm", "hazrate", "uniform", "negexp", "Gamma"),
  series = c("cosine", "hermite", "simple"),
  expansions = 0:3,
  pointSurvey = FALSE,
  warn = TRUE,
  area = NULL,
  ci = 0.95,
  R = 500,
  plot.bs = FALSE,
  showProgress = TRUE,
  plot = TRUE,
  criterion = "AICc",
  ...
)

Arguments

formula

This parameter is passed to dfuncEstim. See dfuncEstim documentation for definition.

detectionData

This parameter is passed to dfuncEstim and abundEstim. See abundEstim documentation for definition.

siteData

This parameter is passed to abundEstim. See abundEstim documentation for definition.

w.lo

This parameter is passed to dfuncEstim. See dfuncEstim documentation for definition.

w.hi

This parameter is passed to dfuncEstim. See dfuncEstim documentation for definition.

likelihoods

Vector of strings specifying the likelihoods to consider during model selection. Valid values at present are "uniform", "halfnorm", "hazrate", "negexp", and "Gamma". See Details for the models this routine considers.

series

Vector of series types to consider during model selection. Valid values are 'simple', 'hermite', and 'cosine'. See Details for the models this routine considers.

expansions

Vector of the number of expansion terms to consider during model selection. Valid values are 0 through 3. See Details for the models this routine considers. Note, expansion terms are not currently allowed in models with covariates.

pointSurvey

This parameter is passed to dfuncEstim. See dfuncEstim documentation for definition.

warn

This parameter is passed to dfuncEstim. dfuncEstim documentation for definition.

area

This parameter is passed to abundEstim. See abundEstim documentation for definition.

ci

This parameter is passed to abundEstim. See abundEstim documentation for definition.

R

This parameter is passed to abundEstim. See abundEstim documentation for definition.

plot.bs

Logical for whether to plot bootstrap iterations after the top model has been selected and during final estimation of confidence intervals. This parameter is passed unchanged to abundEstim. See abundEstim help for additional information.

showProgress

Logical for whether to suppress intermediate output. If showProgress=TRUE, a table of model fitting results appears in the console as they are estimated, and a progress bar shows progress through the bootstrap iterations at the end. If showProgress=FALSE, all intermediate output is suppressed which is handy for programming and simulations.

plot

Logical scalar specifying whether to plot models during model selection. If TRUE, a histogram with fitted distance function is plotted for every fitted model. The function pauses between each plot and prompts the user for whether they want to continue or not. For completely automated estimation, set plot = FALSE.

criterion

A string specifying the criterion to use when assessing model fit. The best fitting model from this routine is the one with lowest value of this fit criterion. This must be one of "AICc" (the default), "AIC", or "BIC". See AIC.dfunc for formulas.

...

Additional parameters passed to dfuncEstim, which in turn are passed to F.gx.estim. These include x.scl, g.x.scl, and observer for estimating double observer probabilities.

Details

During model selection, each series and number of expansions is crossed with each of the likelihoods. For example, if likelihoods has 3 elements, series has 2 elements, and expansions has 4 elements, the total number of models fitted is 3 (likelihoods) * 2 (series) * 4 (expansions) = 24 models. The default specification fits 41 detection functions from the "halfnorm", "hazrate", "uniform", "negexp", and "Gamma" likelihoods (note that Gamma does not currently implement expansions, see Gamma.like). Note, expansion terms are not currently allowed in models with covariates. The model with lowest AIC is selected as 'best', and estimation of abundance proceeds using that model.

Suppress all intermediate output using plot.bs=FALSE, showProgress=FALSE, and plot=FALSE.

Value

If bySite==FALSE, an 'abundance estimate' object is returned. See abundEstim and dfuncEstim for an explanation of components. Returned abundance estimates are based on the best fitting distance function among those fitted. A fit table, sorted by the criterion, is returned as component $fitTable. The fit table component contains columns like (likelihood), series, expansions, converge (0=converged,1=not), scale (1=passed scale check,0=did not pass), and aic (the criterion used).

If bySite==TRUE, a data frame containing site-level abundance based on the best-fitting detection function is returned. See abundEstim for description of columns in the data frame. The best-fitting likelihood form, series, and number of expansions are returned as attributes of the data frame (e.g., best-fitting likelihood is attr(out,"like.form")).

See Also

dfuncEstim, abundEstim.

Examples

# Load example sparrow data (line transect survey type)
data(sparrowDetectionData)
data(sparrowSiteData)

# Automate fitting multiple detection functions, and estimate abundance
# (density per ha in this case), given the 'best' detection function
autoDistSamp(formula = dist ~ groupsize(groupsize)
           , detectionData = sparrowDetectionData
           , siteData = sparrowSiteData
           , likelihood = c("halfnorm", "hazrate")
           , w.hi = units::set_units(100, "m")
           , expansions = 0
           , area = units::set_units( 4105, "km^2" )
           , ci = NULL
           , plot = FALSE
           )
           

Rdistance documentation built on July 9, 2023, 6:46 p.m.