Learn R Programming

Rdistance (version 1.3.2)

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.

Usage

F.nLL(a, dist, like, w.lo = 0, w.hi = max(dist), series, expansions = 0)

Arguments

a

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.

See Also

See uniform.like for definitions of all the likelihoods; F.dfunc.estim

Examples

Run this code
# NOT RUN {
set.seed(37372)
x <- rnorm(1000) * 100
x <- x[ 0 < x & x < 100 ]
F.nLL( c(50,20), x, "uniform", w.hi = 100)
F.nLL( c(50,20, .1), x, "uniform", expansions=1, w.hi = 100, series="cosine")

# }

Run the code above in your browser using DataLab