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.
Arguments
- fpar
- parameter values for detection function at which negative log-likelihood should be evaluated 
- ddfobj
- distance sampling object 
- misc.options
- a - listwith the following elements:- widthtransect width;- int.rangethe integration range for observations;- showit0 to 3 controls level debug output;- integral.numericif- TRUEintegral is computed numerically rather than analytically;- pointis this a point transect?
- fitting
- character - "key"if only fitting key function parameters,- "adjust"if fitting adjustment parameters or- "all"to fit both
Details
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.
Note
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.