F.nLL: F.nLL - Return the negative log likelihood for a set of distance
values.
Description
Return value of the negative log likelihood for a set of observed
off-transect distances given a specified likelihood,
number of expansion terms, and estimated parameters.
A vector of parameter values to use to compute the liklihood. Length of this vector
must be expansions + 1 + 1*(like %in% c("hazrate", "uniform")).
dist
A vector of observed off-transect distances. Must be between w.lo and
w.hi (see below).
like
String specifying the form of the likelihood. Valid values at present are "uniform",
"halfnorm", "hazrate", "negexp", and "Gamma".
w.lo
Lower or left-truncation limit of the distances. This is the minimum
possible off-transect distance. Default is 0.
w.hi
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.
series
String specifying the type of expansion to use series if expansions > 0.
Valid values at present are 'simple', 'hermite', and 'cosine'.
expansions
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.
Value
A scalar, the negative of the log likelihood given the parameters in a, likelihood, and
expansion terms.