Usage
maxBFGS(fn, grad=NULL, hess=NULL, start, fixed=NULL,
control=NULL,
constraints=NULL,
finalHessian=TRUE,
parscale=rep(1, length=length(start)),
... )maxCG(fn, grad=NULL, hess=NULL, start, fixed=NULL,
control=NULL,
constraints=NULL,
finalHessian=TRUE,
parscale=rep(1, length=length(start)), ...)
maxSANN(fn, grad=NULL, hess=NULL, start, fixed=NULL,
control=NULL,
constraints=NULL,
finalHessian=TRUE,
parscale=rep(1, length=length(start)),
... )
maxNM(fn, grad=NULL, hess=NULL, start, fixed=NULL,
control=NULL,
constraints=NULL,
finalHessian=TRUE,
parscale=rep(1, length=length(start)),
...)
Arguments
fn
function to be maximised. Must have the parameter vector as
the first argument. In order to use numeric gradient
and BHHH method, fn must return a vector of
observation-specific likelihood values. Those are summed internally wh
grad
gradient of fn. Must have the parameter vector as
the first argument. If NULL, numeric
gradient is used (maxNM and maxSANN do not use
gradient).
Gradient may return
a matrix, wher
hess
Hessian of fn. Not used by any of these methods, included for
compatibility with maxNR. start
initial values for the parameters. If start values
are named, those names are also carried over to the results.
fixed
parameters to be treated as constants at their
start values. If present, it is treated as an index vector of
start parameters.
control
list of control parameters or a MaxControl
object. If it is a list, the default values are used for the
parameters that are left unspecified by the user.
These functions accept the following parameters:
[object Object],[o
constraints
either NULL for unconstrained optimization
or a list with two components. The components may be either
eqA and eqB for equality-constrained optimization
$A \theta + B = 0$; or ineqA and
finalHessian
how (and if) to calculate the final Hessian. Either
FALSE (not calculate), TRUE (use analytic/numeric
Hessian) or "bhhh"/"BHHH" for information equality
approach. The latter approach is only suit
parscale
A vector of scaling values for the parameters.
Optimization is performed on 'par/parscale' and these should
be comparable in the sense that a unit change in any element
produces about a unit change in the scaled value. (see
...
further arguments for fn and grad.