View source: R/integrateHazrateLines.R
| integrateHazrateLines | R Documentation |
Compute integral of the hazard-rate distance function for line-transect surveys.
integrateHazrateLines(
object,
newdata = NULL,
w.lo = NULL,
w.hi = NULL,
Units = NULL
)
object |
Either an Rdistance fitted distance function
(an object that inherits from class "dfunc"; usually produced
by a call to |
newdata |
A data frame containing new values for
the distance function covariates. If NULL and
|
w.lo |
Minimum sighting distance or left-truncation value
if |
w.hi |
Maximum sighting distance or right-truncation value
if |
Units |
Physical units of sighting distances if
|
Returned integrals are
\int_0^{w} (1 - e^{-(x/\sigma_i)^{-k}}) dx = w - \frac{\sigma_i}{k} \Gamma(-\frac{1}{k}, {\frac{\sigma_i}{w}}^{k}),
where w = w.hi - w.lo, \sigma_i and k are estimated
hazard-rate distance
function parameters for the
i-th observed distance, and \Gamma() is the incomplete gamma
function.
Rdistance uses the
incomplete gamma function implemented in
gammainc, which for
all intents and purposes is exact.
A vector of areas under the distance functions represented in
object.
If object is a distance function and
newdata is specified, the returned vector's length is
nrow(newdata). If object is a distance function and
newdata is NULL,
returned vector's length is length(distances(object)). If
object is a matrix, return's length is
nrow(object).
Users will not normally call this function. It is called
internally by nLL and effectiveDistance.
integrateNumeric; integrateNegexpLines;
integrateOneStepLines
# A pre-estimated hazard rate distance function: sparrowDfuncObserver
fit <- sparrowDfuncObserver
table(ESW(fit))
table(integrateHazrateLines(fit))
# Check: Integral of 1 - exp(-(x/s)^(-k)) from 0 to w.hi-w.lo
w <- dropUnits(fit$w.hi - fit$w.lo)
params <- predict(fit)
sigma <- params[,1]
minusk <- -params[,2]
outArea <- w + sigma *
expint::gammainc(1/minusk, (w/sigma)^(minusk)) / minusk
table(outArea)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.