dfuncEstim | R Documentation |
Fits a detection function using maximum likelihood.
dfuncEstim(data, ...)
data |
An |
... |
Arguments passed on to
|
Optimization and estimation controls can be modified using options()
.
See RdistanceControls
.
An object of class 'dfunc'. Objects of class 'dfunc' are lists containing the following components:
par |
The vector of estimated parameter values. Length of this vector for built-in likelihoods is one (for the function's parameter) plus the number of expansion terms plus one if the likelihood is 'hazrate' (which has two parameters). |
varcovar |
The variance-covariance matrix for coefficients
of the distance function, estimated by the inverse of the fit's Hessian
evaluated at the estimates. Rdistance estimates the
Hessian as the second derivative of the log likelihood surface
at the final estimates, where second derivatives are estimated by
numeric differentiation (see |
loglik |
The maximized value of the log likelihood. |
convergence |
The convergence code. This code
is returned by |
likelihood |
The name of the likelihood. This is
the value of the argument |
w.lo |
Left-truncation value used during the fit. |
w.hi |
Right-truncation value used during the fit. |
mf |
A modelframe of detections within the strip
or circle used in the fit. Column 'dist' contains the
observed distances.
Column 'offset(...)' contains group sizes associated with
the values of 'dist'. Group
sizes are only used in |
model.frame |
A |
siteID.cols |
A vector containing the transect ID column names in |
expansions |
The number of expansion terms used during estimation. |
series |
The type of expansion used during estimation. |
call |
The original call of this function. |
call.x.scl |
The input or user requested distance at which the distance function is scaled. |
call.g.x.scl |
The |
call.observer |
The value of input parameter |
fit |
The fitted object returned by |
factor.names |
The names of any factors in |
pointSurvey |
The input value of |
formula |
The formula specified for the detection function. |
control |
A list containing values of the 'control' parameters
set by |
outputUnits |
The measurement units used for output. All distance measurements are converted to these units internally. |
x.scl |
The actual distance at which
the distance function is scaled to some value.
i.e., this is the actual x at
which g(x) = |
g.x.scl |
The actual height of the distance function
at a distance of |
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
.
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
units()<-
after attaching the units
package or with 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
).
# Sparrow line transect example
data(sparrowDetectionData)
data(sparrowSiteData)
sparrowDf <- RdistDf(sparrowSiteData, sparrowDetectionData)
dfunc <- dfuncEstim(sparrowDf,
formula = dist ~ 1
)
summary(dfunc)
data(sparrowDfuncObserver) # pre-estimated object
## Not run:
# Command to produce 'sparrowDfuncObserver'
sparrowDfuncObserver <- sparrowDf |>
dfuncEstim(
formula = dist ~ observer
)
## End(Not run)
sparrowDfuncObserver
summary(sparrowDfuncObserver)
plot(sparrowDfuncObserver)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.