View source: R/integrateHuberLines.R
| integrateHuberLines | R Documentation |
Compute exact integral of the 'huber' distance function for line transects.
integrateHuberLines(
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
|
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;
integrateHalfnormLines
w <- 250
T1 <- 160
T2 <- 20
p <- 0.03
obj <- matrix(c(T1,T2,p), 1, 3)
integrateHuberLines(obj
, w.lo = units::set_units(0,"m")
, w.hi = units::set_units(w,"m")
, Units = "m")
# same
huber.cumFunc(w,T1,T2,p,w)
# check by numeric integration
hubLike <- function(d, T1, T2, p, wl, wh) {
y <- huber.like(a = c(log(T1), T2, p)
, dist = d - wl
, covars = matrix(1, length(d))
, w.hi = wh - wl)$L.unscaled
y
}
integrate(hubLike, lower = 0, upper = w, T1 = T1
, T2 = T2, p = p, wl = 0, wh = w)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.