I know that, in order to use PrincipalAxis
, for example in FindMaximum
function:
FindMaximum[
f[x,y], {{x,x0,x1},{y,y0,y1}}, Method -> "PrincipalAxis"]
You have to provide two initial points, for each argument. However, PrincipalAxis
also seems to work when just one initial point is given. Do you know what actually Mathematica does in such a case?
Answer
The starting point is the Principal Axis Method tutorial:
For an $n$-variable problem, take a set of search directions $u_1,u_2,...,u_n$ and a point $x_0$. Take $x_i$ to be the point that minimizes $f$ along the direction $u_i$ from $x_{i-1}$ (i.e. do a line search from $x_{i-1}$), then replace $u_i$ with $u_{i+1}$.
Two distinct starting conditions in each variable are required for this method because these are used to define the magnitudes of the vectors $u_i$.
I think that the first parameter is the starting point, $x_0$, and, combined with the second parameter, both define the magnitude of the search direction.
One can start to delve into the behaviour using EvaluationMonitor
. First, using a single parameter of 0.5, the search is quite close to the initial starting point of 0.5.
FindMinimum[x^2, {{x, 0.5}}, Method -> "PrincipalAxis",
EvaluationMonitor :> Print["x = ", x]]
(* x = 0.5
x = 0.484
x = 0.474
x = 0.407
x = 5.8e-15
... *)
I think, for the case of the second parameter, not specifying it is the same as setting it to zero, since
FindMinimum[x^2, {{x, 0.5, 0}}, Method -> "PrincipalAxis",
EvaluationMonitor :> Print["x = ", x]]
gives the same behaviour as above.
Compare with specifying a huge second parameter, where the search initially jumps a long way from the starting point.
FindMinimum[x^2, {{x, 0.5, 10000}}, Method -> "PrincipalAxis",
EvaluationMonitor :> Print["x = ", x]]
(* x = 0.5
x = 312.984
x = -192.626
x = 119.858
x = -73.276
x = 3.2e-15
... *)
Comments
Post a Comment