hazrate.like | R Documentation |
Computes the hazard rate likelihood of off-transect distances, given parameters. Primarily used as a minimization objective during distance function estimation.
hazrate.like(
a,
dist,
covars = NULL,
w.lo = units::set_units(0, "m"),
w.hi = max(dist),
series = "cosine",
expansions = 0,
scale = TRUE,
pointSurvey = FALSE
)
a |
A vector of likelihood parameter values. Length and meaning
depend on |
dist |
A numeric vector containing the observed distances. |
covars |
Data frame containing values of covariates at
each observation in |
w.lo |
Scalar value of the lowest observable distance.
This is the left truncation of sighting distances in
|
w.hi |
Scalar value of the largest observable distance.
This is the right truncation of sighting distances in
|
series |
A string specifying the type of expansion to use.
Currently, valid values are 'simple', 'hermite', and 'cosine'; but, see
|
expansions |
A scalar specifying the number of terms in
|
scale |
Logical scalar indicating whether or not to scale
the likelihood so it integrates to 1. This parameter is used to
stop recursion in other functions.
If |
pointSurvey |
Boolean. TRUE if |
The hazard rate likelihood is
f(x|\sigma,k) = 1 - \exp(-(x/\sigma)^{-k})
where \sigma
determines location
(i.e., distance at which the function equals 1 - exp(-1) = 0.632),
and k
determines slope of the function
at \sigma
(i.e., larger k equals steeper
slope at \sigma
). For distance analysis,
the valid range for both \sigma
and k is
\geq 0
.
Expansion Terms: If expansions
= e
(e > 0), the expansion function specified by
series
is called (see for example
cosine.expansion
). Assuming
h_{ij}(x)
is the j^{th}
expansion term for the i^{th}
distance and that
c_1, c_2, \dots, c_k
are
(estimated) coefficients for the expansion terms, the
likelihood contribution for the i^{th}
distance is,
f(x|a,b,c_1,c_2,\dots,c_e) = f(x|a,b)(1 +
\sum_{j=1}^{e} c_j h_{ij}(x)).
A numeric vector the same length and order as
dist
containing the likelihood contribution for
corresponding distances in dist
.
Assuming L
is the returned vector from one of these
functions, the full log likelihood of all the data is
-sum(log(L), na.rm=T)
. Note that the
returned likelihood value for distances less than
w.lo
or greater than w.hi
is NA
,
and thus it is prudent to use na.rm=TRUE
in the
sum. If scale
= TRUE, the integral of the likelihood
from w.lo
to w.hi
is 1.0. If scale
=
FALSE, the integral of the likelihood is
arbitrary.
dfuncEstim
,
halfnorm.like
,
uniform.like
,
negexp.like
,
Gamma.like
## Not run:
x <- seq(0, 100, length=100)
# Plots showing effects of changes in sigma
plot(x, hazrate.like(c(20, 5), x), type="l", col="red")
plot(x, hazrate.like(c(40, 5), x), type="l", col="blue")
# Plots showing effects of changes in beta
plot(x, hazrate.like(c(50, 20), x), type="l", col="red")
plot(x, hazrate.like(c(50, 2), x), type="l", col="blue")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.