Return value of the negative log likelihood for a vector of observed distances given a specified likelihood, number of expansion terms, and estimated parameters.
F.nLL(
a,
dist,
covars = NULL,
like,
w.lo = 0,
w.hi = max(dist),
series,
expansions = 0,
pointSurvey,
for.optim = F
)A scalar, the negative of the log likelihood evaluated at
parameters a, including expansion terms.
A vector of parameter values for
the likelihood. Length of this vector must be
expansions + 1 + 1*(like %in% c("hazrate", "uniform")).
A vector of observed distances. All values must be between
w.lo and w.hi (see below).
Data frame containing values of covariates
at each observation in dist.
String specifying the form of the likelihood.
Built-in distance functions at present are "uniform", "halfnorm",
"hazrate", "negexp", and "Gamma". To be valid, a function
named paste(like,".like") (e.g., "uniform.like") must exist
somewhere in this routine's scope. This routine finds the ".like"
function and calls it with the appropriate parameters.
A user-defined likelihood can be implemented by simply defining a
function with the ".like" extension and giving the root name here.
For example, define a function named "myLike.like" in the
.GlobalEnv and set like="myLike" here. See
the vignette on this topic.
Lower or left-truncation limit of the distances. This is the minimum possible off-transect distance. Default is 0.
Upper or right-truncation limit of the distances. This is the maximum off-transect distance that could be observed. Default is the maximum observed distance.
String specifying the type of expansion to
use series if expansions > 0. Valid values at present
are 'simple', 'hermite', and 'cosine'.
A scalar specifying the number of terms
in series to compute. Depending on the series, this
could be 0 through 5. The default of 0 equates to no
expansion terms of any type.
Boolean. TRUE if dist is point
transect data, FALSE if line transect data.
Boolean. If TRUE, values are multiplied
by 10^9 to help optim converge more consistently.
See uniform.like and links there;
dfuncEstim