DTU 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.

 

p Name n m
1 Linear function. Full rank variable m >= n
2 Linear function. Rank 1 variable m >= n
3 Linear function. Rank 1.
Zero columns and rows
variable
n >= 3
m >= n
4 Rosenbrock 2 2
5 Helical Valley 3 3
6 Powell singular function 4 4
7 Freudenstein and Roth 2 2
8 Bard 3 15
9 Kowalik and Osborne 4 11
10 Meyer 3 16
11 Watson 2 <= n <= 31 31
12 Box 3-dimensional 3 m >= 3
13 Jennrich and Sampson 2 m >= 2
14 Brown and Dennis 4 m >= 4
15 Chebyquad variable m >= n
16 Brown almost linear variable m = n
17 Osborne 1 5 33
18 Exponential fit 4 45
19 Exponential fit; separated 2 45
20 Modified Meyer 3 16
21 Separated Meyer 2 16
22 Exp and squares variable 1

Go to the top Return to immoptibox main page

 

4.3.1. User's guide to   uctpget
This function can be used to define a test problem. There is a choice between 22 problems, as described in [10]. With some of the problems it is possible to vary the size of the problem.

The call is
    [par, x0, tau0, delta0] = uctpget(pno,m,n)

Problem no 10

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.
 
Go to the top Return to immoptibox main page

 

4.3.2. User's guide to   uctpval
This function can be used to evaluate a test problem, as defined by uctpget. If the problem is "born" as a least squares problem, and par.pt is changed to 1 before the call, then uctpval returns the function value  F(x)   and the gradient  F'(x)   as defined by

and  .

Typical calls are
    F = uctpval(x,par)
    [F, dF] = uctpval(x,par)
    [F, dF, d2F] = uctpval(x,par)

Performance of dogleg on problem 10

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).
 
Go to the top Return to immoptibox main page

 

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.
 
Logarithm of Rosenbrock's function
  [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'.
 
Go to the top Return to immoptibox main page

 

4.3.4. Data sets
The toolbox contains a number of data sets, which can be used to check a data fitting algorithm.
optic.dat
Optic fibre data
wild.dat
Data with 5 wild points
peaks.dat
Data with peaks
efit1.dat
Data for exponential fitting
efit2.dat
Exponential data with wild points

The command load optic.dat gives an m*2 array optic, in which the first column holds values of the independent variable, and the second column holds the corresponding values of the dependent variable. Similar for the other data sets.

Also see the standard MATLAB function titanium.
 

Go to the top Return to immoptibox main page