stan_distsamp {ubms}R Documentation

Fit the Royle et al. (2004) Distance Sampling Model

Description

This function fits the hierarchical distance sampling model of Royle et al. (2004) to line or point transect data recorded in discerete distance intervals.

Usage

stan_distsamp(
  formula,
  data,
  keyfun = c("halfnorm", "exp", "hazard"),
  output = c("density", "abund"),
  unitsOut = c("ha", "kmsq"),
  prior_intercept_state = normal(0, 5),
  prior_coef_state = normal(0, 2.5),
  prior_intercept_det = normal(0, 5),
  prior_coef_det = normal(0, 2.5),
  prior_intercept_scale = normal(0, 2.5),
  prior_sigma = gamma(1, 1),
  ...
)

Arguments

formula

Double right-hand side formula describing covariates of detection and occupancy in that order

data

A unmarkedFrameDS object

keyfun

One of the following detection functions: "halfnorm" for half-normal, "exp" for negative exponential, or "hazard" for hazard-rate (see warning below)

output

Model either density "density" or abundance "abund"

unitsOut

Units of density. Either "ha" or "kmsq" for hectares and square kilometers, respectively

prior_intercept_state

Prior distribution for the intercept of the state (abundance) model; see ?priors for options

prior_coef_state

Prior distribution for the regression coefficients of the state model

prior_intercept_det

Prior distribution for the intercept of the detection probability model

prior_coef_det

Prior distribution for the regression coefficients of the detection model

prior_intercept_scale

Prior distribution for the intercept of the scale parameter (i.e., log(scale)) for Hazard-rate models

prior_sigma

Prior distribution on random effect standard deviations

...

Arguments passed to the stan call, such as number of chains chains or iterations iter

Value

ubmsFitDistsamp object describing the model fit.

Warning

Use of the hazard-rate key function ("hazard") typically requires a large sample size in order to get good parameter estimates. If you have a relatively small number of points/transects (<100), you should be cautious with the resulting models. Check your results against estimates from unmarked, which doesn't require as much data to get good estimates of the hazard-rate shape and scale parameters.

Note

Values of 'dist.breaks' in the 'unmarkedFrameDS' should be as small as possible (<10) to facilitate convergence. Consider converting 'unitsIn' from meters to kilometers, for example. See example below.

References

Royle, J. A., Dawson, D. K., & Bates, S. (2004). Modeling abundance effects in distance sampling. Ecology 85: 1591-1597.

See Also

distsamp, unmarkedFrameDS

Examples


data(issj)
#Note use of km instead of m for distance breaks
jayUMF <- unmarkedFrameDS(y=as.matrix(issj[,1:3]),
                          siteCovs=issj[,c("elevation","forest")],
                          dist.breaks=c(0,0.1,0.2,0.3),
                          unitsIn="km", survey="point")

fm_jay <- stan_distsamp(~1~scale(elevation), jayUMF, chains=3, iter=300)



[Package ubms version 1.2.6 Index]