| dE.single | R Documentation |
Fits a detection function to off-transect distances collected by a single observer.
dE.single(
data,
formula,
likelihood = "halfnorm",
w.lo = setUnits(0, "m"),
w.hi = NULL,
expansions = 0,
series = "cosine",
x.scl = w.lo,
g.x.scl = 1,
warn = TRUE,
outputUnits = NULL,
asymptoticSE = TRUE
)
data |
An |
formula |
A standard formula object. For example, |
likelihood |
String specifying the likelihood to fit. Built-in likelihoods at present are "halfnorm", "hazrate", and "negexp". |
w.lo |
Lower or left-truncation limit of the distances in distance data.
This is the minimum possible off-transect distance. Default is 0. If
|
w.hi |
Upper or right-truncation limit of the distances
in |
expansions |
A scalar specifying the number of terms
in |
series |
If |
x.scl |
The x coordinate (a distance) at which the
detection function will be scaled. |
g.x.scl |
Height of the distance function at coordinate |
warn |
A logical scalar specifying whether to issue
an R warning if the estimation did not converge or if one
or more parameter estimates are at their boundaries.
For estimation, |
outputUnits |
A string specifying the symbolic measurement
units for results. Valid units are listed in |
asymptoticSE |
Logical variable for whether to calculate
asymptotic standard errors. The default (TRUE) estimates an
asymptotic variance-covariance matrix for parameters based on the
likelihood's Hessian (2nd derivative). If maximization
has been performed by Nlminb or HookesJeeves, the asymptotic
Hessian is estimated using numeric second deriviatives
of the likelihood at the maximum likelihood solution. If
maximization was performed by Optim, the last Hessian of
the maximization is returned
by Optim and used
(see |
Optimization and estimation controls can be modified using options().
See RdistanceControls.
An object of class 'dfunc' with the following components:
par |
The vector of estimated parameter values. Length of this vector is the sum of the following:
|
loglik |
The maximized value of the log likelihood. |
convergence |
The convergence code. This code
is returned by the optimizing routine (e.g., |
message |
If maximization did not converge ( |
varcovar |
The variance-covariance matrix for coefficients
of the distance function, either estimated by the inverse of
the fit's Hessian or by bootstrapping.
If the likelihood is smooth (i.e., those listed by
|
limits |
A list containing the lower and upper limits of parameters. |
evaluations |
The number of likelihood evaluations performed by the optimizer. |
mf |
An R 'model frame' containing the detections (within the strip
or circle) used in the fit, covariates specified in the formula,
and groupsizes. Column 'dist' contains the
observed distances. The intercept, if included in the model, is not
included as a column in this model frame. (Test whether an intercept
is included using |
data |
The original nested data frame subset to information required
to complete distance estimation. This data frame contains information
on replication (i.e., rows are sites and are re-sampled during bootstrapping),
missing distances, missing transect lengths, and distances outside the observation
strip from |
formula |
The distance function's formula. |
dataName |
Name of the original nested data frame. |
likelihood |
The name of the likelihood fitted to observation distances. |
w.lo |
Left-truncation value used during the fit. |
w.hi |
Right-truncation value used during the fit. |
expansions |
The number of expansion terms used during the fit. |
series |
The type of expansion used during estimation. This is
only relevant if |
x.scl |
The distance at which
the function has been scaled to some value.
This is the x at which the distance function
g(x) = |
g.x.scl |
The height of the distance function
at a distance of |
outputUnits |
A list of type 'symbolic_units' containing the physical measurement units used during estimation. |
asymptoticSE |
A logical scalar indication whether the
variance-covariance matrix in component |
optimizer |
The optimizing routine used. |
call |
The original function call. |
nCovars |
The number of exogenous covariates fitted in the distance function. Does not include the intercept. |
LhoodType |
The type of likelihood fitted. Currently, only 'parametric' types are fitted. |
To specify non-unity group sizes, use groupsize()
on the RHS of formula. When group sizes are not all 1, they must appear in a column
of the 'detections' list-column of data.
For example, d ~ habitat + groupsize(number) specifies
distances in column d, one covariate
named habitat, and that column number
contains the number of individuals
associated with each detection. If group sizes are not specified,
all group sizes are assumed to be 1.
Factor contrasts in Rdistance are specified
the same way as in lm or glm.
By default, Rdistance uses
contrasts in getOption("contrasts"). To change contrasts, use a statement
like options(contrasts = c(unordered = "contr.SAS",
ordered = "contr.poly")). Or, to set contrasts for a
specific factor in the input data frame, use
contrasts(df$A) <- "contr.sum" or similar.
See contrasts or the contrasts.arg
of model.matrix.
Rdistance accommodates two kinds of transects: continuous and point.
Detections can occur at any point on continuous transects.
Rdistance calls these 'line-transects' even though routes are not
necessarily a straight line.
On point transects, detections occur at a series of stops
(points). Rdisance calls these point-transects. Transects are the basic
sampling unit in both cases. Rdistance assumes each row of data
contains information from one transect. See RdistDf for
more details.
As of Rdistance version 3.0.0, measurement units are
require on all physical distances.
Requiring units ensures that internal calculations and results
(e.g., ESW and abundance) are correct
and that output units are clear.
Physical distances are required on
off-transect distances, radial distances, truncation distances
(w.lo, unless it is zero; and w.hi, unless it is NULL),
scale locations (x.scl, unless it is zero),
line-transect lengths, and study area size. All units are
1-dimensional except those on study area, which are 2-dimensional.
Physical measurement units can vary. For example,
off-transect distances can be meters ("m"), w.hi can be inches ("in"),
and w.lo can be kilometers ("km"). Internally, all distances are
converted to the units specified by outputUnits
(or the units of input distances if
outputUnits is NULL), and
all output is reported
in units of outputUnits. Valid conversions must exist between
units or an error is thrown. For example, meters cannot be converted
into hectares.
Measurement units can be assigned using one of Rdistance's
unit helper routines (see help(unitHelpers)), or from
routines in the units package (e.g.,
x <- units::set_units(x, "<units>")).
See units::valid_udunits
for a list of valid symbolic units.
If measurements are truly unit-less, or measurement units are unknown,
set options(Rdist_requireUnits = FALSE). This suppresses
all unit checks and conversions. Users are on their own
to make sure inputs are scaled correctly and that output units are known.
Buckland, S.T., D.R. Anderson, K.P. Burnham, J.L. Laake, D.L. Borchers, and L. Thomas. (2001) Introduction to distance sampling: estimating abundance of biological populations. Oxford University Press, Oxford, UK.
abundEstim, autoDistSamp.
Likelihood-specific help files (e.g., halfnorm.like).
# Load example sparrow data (line transect survey type)
data(sparrowDf)
dfunc <- dfuncEstim(data = sparrowDf
, formula = dist ~ 1)
dfunc
plot(dfunc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.