Fit detection function to observed distances using the key-adjustment
function approach. If adjustment functions are included it will alternate
between fitting parameters of key and adjustment functions and then all
parameters much like the approach in the CDS and MCDS Distance FORTRAN code.
This function is called by the driver function detfct.fit
, it then
calls the relevant optimisation routine, slsqp
,
solnp
or optimx
.
Value
fitted detection function model object with the following list structure
- par
final parameter vector
- value
final negative log likelihood value
- counts
number of function evaluations
- convergence
see codes in optim
- message
string about convergence
- hessian
hessian evaluated at final parameter values
- aux
a list with 20 elements
maxit: maximum number of iterations allowed for optimization
lower: lower bound values for parameters
upper: upper bound values for parameters
setlower: TRUE if they are user set bounds
setupper: TRUE if they are user set bounds
point: TRUE if point counts and FALSE if line transect
int.range: integration range values
showit: integer value that determines information printed during iteration
integral.numeric if TRUE compute logistic integrals numerically
breaks: breaks in distance for defined fixed bins for analysis
maxiter: maximum iterations used
refit: if TRUE, detection function will be fitted more than once if parameters are at a boundary or when convergence is not achieved
nrefits: number of refittings
mono: if TRUE, monotonicity will be enforced
mono.strict: if TRUE, then strict monotonicity is enforced; otherwise weak
width: radius of point count or half-width of strip
standardize: if TRUE, detection function is scaled so g(0)=1
ddfobj: distance detection function object; see
create.ddfobj
bounded: TRUE if estimated parameters are at the bounds
model: list of formulas for detection function model (probably can remove this)