|
|
|
|
|
immoptibox |
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4.3. Test Problems
This section contains a generator uctpget with the choice between 22 small and medium sized unconstrained optimization problems. With some of them it is possible to vary the size of the problem. The function uctpval is constructed so that it can be used as FUN in the functions of sections Unconstrained optimization and Least squares problems.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|
||||
| ||||||
| Input parameters | ||||||
| p | Problem number. Integer in the range [1,22]. | |||||
| m,n | Number of components in the vectors
f(x) (when pno <= 21) and
x , respectively. Not variable in all problems.
|
|||||
| Output parameters | ||||||
| par | Struct defining the problem. | |||||
| par.p | : Problem number. | |||||
| par.pt | = 0 signifies a least squares problem, otherwise a general problem. |
|||||
| par.xm | : Solution. (NaNs if m or n is free) | |||||
| For some problems par has more fields. | ||||||
| x0 | Standard starting point. | |||||
| tau0 | Standard value for the parameter opts(1) in the Marquardt-type functions of the toolbox. | |||||
| delta0 | Standard value for the
parameter opts(1) in the DogLeg-type function of the toolbox.
|
|||||
| ||||||
|
|
|
|
||||
| ||||||
| Input parameters | ||||||
| x | Argument. | |||||
| par | Struct defining the problem, cf
uctpget.
|
|||||
| Output parameters | ||||||
| F | If par.p <= 21
and par.pt = 0,
then F is the vector , otherwise
F is the scalar F(x).
| |||||
| dF | If par.p <= 21 and par.pt = 0 , then dF is the Jacobian J(x), otherwise dF is the gradient F'(x). | |||||
| d2F | Presumes
par.pt ~= 0. Hessian
F''(x).
|
|||||
| ||||||
|
|
|
|
|
4.3.3. Example Suppose that we want to compare marquardt and ucminf applied to Rosenbrock's problem with the starting point x0 = (-1.2, 1) and demand that the gradient be smaller than 10-8. This can be done as follows. |
| |
|
[par x0 tau] = uctpget(4,2,2); [xm infom] = marquardt(@uctpval, x0, [tau 1e-6 1e-12 100], par); par.pt = 1; [xu infou] = ucminf(@uctpval,x0,[1 1e-6 1e-12 100],[],par); |
||
| Both xm and xu
are close to the solution x* = (1, 1), and |
||
|
infom = 4.91e-16 1.43e-08 9.47e-06 1.23e-06 23 1 infou = 1.45e-17 6.38e-08 6.99e-07 35 39 1
|
||
| show that in both cases
the desired accuracy was obtained after respectively 24 evaluations of
f and J and 39 evaluations of
F and F'.
|
||
| ||