Description Usage Arguments Details Value Author(s) References Examples
This algorithm provides a numerical solution to the problem of minimizing a function. This is more efficient than the Gauss-Newton-like algorithm when starting from points very far from the final minimum. A new convergence test is implemented (RDM) in addition to the usual stopping criterion: stopping rule is when the gradients are small enough in the parameters metric (GH-1G).
This algorithm provides a numerical solution to the problem of minimizing a function. This is more efficient than the Gauss-Newton-like algorithm when starting from points very far from the final minimum. A new convergence test is implemented (RDM) in addition to the usual stopping criterion: stopping rule is when the gradients are small enough in the parameters metric (GH-1G).
1 2 3 4 5 6 7 8 9 |
par |
A vector containing the initial values for the parameters. |
fn |
The function to be minimized (or maximized), with argument the vector of parameters over which minimization is to take place. It should return a scalar result. |
gr |
A function to return the gradient value for a specific point. If missing, finite-difference approximation will be used. |
... |
Further arguments to be passed to fn and gr. |
hessian |
A function to return the hessian matrix for a specific point. If missing, finite-difference approximation will be used. |
control |
A list of control parameters. See ‘Details’. |
verbose |
Equals to TRUE if report (parameters at iteration, function value, convergence criterion ...) at each iteration is requested. Default value is FALSE. |
Convergence criteria are very strict as they are based on derivatives of the log-likelihood in addition to the parameter and log-likelihood stability.
In some cases, the program may not converge and reach the maximum number of iterations fixed at 500.
In this case, the user should check that parameter estimates at the last iteration are not on the boundaries of the parameter space.
If the parameters are on the boundaries of the parameter space, the identifiability of the model should be assessed.
If not, the program should be run again with other initial values, with a higher maximum number of iterations or less strict convergence tolerances.
The control
argument is a list that can supply any of the following components:
maxiter
Optional maximum number of iterations for the iterative algorithm.
Default is 500.
eps
Not documented (yet). Default is 1e-6.
epsa
Optional threshold for the convergence criterion based on the parameter stability.
Default is 1e-6.
epsb
Optional threshold for the convergence criterion based on the log-likelihood stability.
Default is 1e-6.
epsd
Optional threshold for the relative distance to minimum.
This criterion has the nice interpretation of estimating the ratio of the approximation error over the statistical error, thus it can be used for stopping the iterative process whathever the problem.
Default is 1e-6.
digits
Number of digits to print in outputs.
Default value is 8.
blinding
Equals to TRUE if the algorithm is allowed to go on in case of an infinite or not definite value of function.
Default value is FALSE.
multipleTry
Integer, different from 1 if the algorithm is allowed to go for the first iteration in case of an infinite or not definite value of gradients or hessian.
This account for a starting point to far from the definition set.
As many tries as requested in multipleTry
will be done by changing the starting point of the algorithm.
Default value is 25.
A list with the following elements:
par
, stopping point value;
value
, function evaluation at the stopping point;
ni
, number of iterations before reaching stopping criterion;
convergence
, status of convergence: =1 if the convergence criteria were satisfied, =2 if the maximum number of iterations was reached, =4 if the algorithm encountered a problem in the function computation;
hessian
, a symmetric matrix giving an estimate of the Hessian at the solution found;
ca
, convergence criteria for parameters stabilisation;
cb
, convergence criteria for function stabilisation;
rdm
, convergence criteria on the relative distance to minimum.
Alessandro Gasparini (alessandro.gasparini@ki.se)
Daniel Commenges
Melanie Prague
Amadou Diakite
Alessandro Gasparini
Donald W. Marquardt (1963). An algorithm for least-squares estimation of nonlinear parameters. Journal of the Society for Industrial and Applied Mathematics, 11(2):431–441
Daniel Commenges, H Jacqmin-Gadda, C. Proust, J. Guedj (2006). A Newton-like algorithm for likelihood maximization the robust-variance scoring algorithm. arxiv:math/0610402v2
Donald W. Marquardt (1963). An algorithm for least-squares estimation of nonlinear parameters. Journal of the Society for Industrial and Applied Mathematics, 11(2):431–441
Daniel Commenges, H Jacqmin-Gadda, C. Proust, J. Guedj (2006). A Newton-like algorithm for likelihood maximization the robust-variance scoring algorithm. arxiv:math/0610402v2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ### 1
### initial values
par <- c(8, 9)
### your function
fn <- function(b) {
return(4 * (b[1] - 5)^2 + (b[2] - 6)^2)
}
## Call
test1 <- mla(par = par, fn = fn)
test1
### 2
### initial values
b <- c(3, -1, 0, 1)
### your function
f2 <- function(b) {
return((b[1] + 10 * b[2])^2 + 5 * (b[3] - b[4])^2 + (b[2] - 2 * b[3])^4 + 10 * (b[1] - b[4])^4)
}
## Call
test2 <- mla(par = b, fn = f2)
test2
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.