flnl: Log-likelihood computation for distance sampling data

View source: R/flnl.R

flnlR Documentation

Log-likelihood computation for distance sampling data


For a specific set of parameter values, it computes and returns the negative log-likelihood for the distance sampling likelihood for distances that are unbinned, binned and a mixture of both. The function flnl is the function minimized using optim from within ddf.ds.


flnl(fpar, ddfobj, misc.options, fitting = "all")



parameter values for detection function at which negative log-likelihood should be evaluated


distance sampling object


a list with the following elements: width transect width; int.range the integration range for observations; showit 0 to 3 controls level debug output; integral.numeric if TRUE integral is computed numerically rather than analytically; point is this a point transect?


character "key" if only fitting key function parameters, "adjust" if fitting adjustment parameters or "all" to fit both


Most of the computation is in flpt.lnl in which the negative log-likelihood is computed for each observation. flnl is a wrapper that optionally outputs intermediate results and sums the individual log-likelihood values.

flnl is the main routine that manipulates the parameters using getpar to handle fitting of key, adjustment or all of the parameters. It then calls flpt.lnl to do the actual computation of the likelihood. The probability density function for point counts is fr and for line transects is fx. fx=g(x)/mu (where g(x) is the detection function); whereas, f(r)=r*g(r)/mu where mu in both cases is the normalizing constant. Both functions are in source code file for link{detfct} and are called from distpdf and the integral calculations are made with integratepdf.


negative log-likelihood value at the parameter values specified in fpar


These are internal functions used by ddf.ds to fit distance sampling detection functions. It is not intended for the user to invoke these functions but they are documented here for completeness.


Jeff Laake, David L Miller

See Also

flt.var, detfct

mrds documentation built on July 9, 2023, 6:06 p.m.