IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4177


Ignore:
Timestamp:
Jun 8, 2005, 7:16:23 PM (21 years ago)
Author:
eugene
Message:

added improved minimization discussion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/pslib/psLibADD.tex

    r4095 r4177  
    1 %%% $Id: psLibADD.tex,v 1.74 2005-06-03 02:34:13 price Exp $
     1%%% $Id: psLibADD.tex,v 1.75 2005-06-09 05:16:23 eugene Exp $
    22\documentclass[panstarrs]{panstarrs}
    33
     
    433433\subsection{Non-linear Minimization}
    434434
     435Non-linear minimization techniques use an iterative approach to find a
     436minimization since an analytical inversion is impractical or not
     437possible.  These techniques use a starting guess for the parameters of
     438interest, and make a sequence of new guess parameters based on the
     439properties of the function at the previous position.  If the new
     440parameters yield a reduced function value, the new position is used as
     441the starting position for the next iteration.  Otherwise, the guess
     442must be modified and another attempt is made.  Convergence may be
     443determined based on the absolute amount of change in the function
     444value, or by comparison with the expectation for a linear system.
     445
     446The two common techniques used to construct a guess parameter set are
     447the 'steepest descent method' and the 'gauss newton method'.  In the
     448first case, the guess is selected some distance along the local
     449gradient.  In the second case, a local Taylor expansion of the
     450function is used to construct a linear model for the function, and the
     451new guess is chosen to minimize that model.  The methods discussed
     452below make use of combinations of these two methods.  Aside from the
     453differences in their guess steps, the two methods differ in using
     454first derivatives of the function supplied by the user, or by locally
     455calculating the first derivatives. 
     456
     457Mathematically, we would like to choose the parameter set $a_m$ to
     458minimize a function of those parameters $F(a_m)$.  We iterate by
     459choosing a new parameter set $a^\prime_m = a_m + \delta_m$ based on
     460the behavior of the function at $a_m$. 
     461
     462The steepest descent method chooses a step direction of $\bar{\delta}
     463= -\nabla F$, or defining $g_m$ as a component of the gradient,
     464$\delta_m = -g_m$.  The Gauss-Newton method uses a Taylor expansion of
     465the function to solve for the step: $(\nabla^2 F) \bar{\delta} =
     466-\nabla F$.  Defining $H_{m,n}$ as a component of the second
     467derivatives, we can write the Gauss-Newton step as $\delta_m = -
     468H_{m,n}^{-1} g_n$.
     469
    435470\subsubsection{Levenberg-Marquardt Method}
    436471
    437 In the Levenberg-Marquardt Method (LMM; see NR \S 15.5), we make a
    438 guess at the input parameters, evaluate the function of interest, vary
    439 the parameters by a particular choice based on the gradient, evaluate
    440 the function again, and adjust the parameters and the parameter
    441 varient based on the results.
    442 
    443 The LMM only works if the second derivative of the function can be
    444 considered negligible, as in the case of minimizing $\chi^2$.
    445 
    446 Given some ordinates, $x_i$, we would like to find the parameters,
    447 $a_k$, of the function $f(x_i; a_k)$ which minimize $\chi^2$ for some
    448 measurements, $y_i$ and associated errors, $\sigma_i$.  We start with
    449 a set of parameter guesses, $a_k$.  We calculate the gradient
    450 $\beta_k$ and the Hessian matrix $\alpha_{j,k}$ at this parameter
    451 selection as follows:
    452 \begin{eqnarray}
    453 \beta_k & = & \frac{\partial \chi^2}{\partial a_k} \\
    454 \alpha_{j,k} & = & \sum_i \frac{1}{\sigma_i^2} \frac{\partial f(c_i)}{\partial a_k} \frac{\partial f(c_i)}{\partial a_j}
    455 \end{eqnarray}
    456 
    457 We now define the new parameter guess for $a_k$ based on the gradient
    458 and Hessian by defining $A_{j,k}$ as a variant on $\alpha_{j,k}$ as
    459 follows:
    460 
    461 \begin{eqnarray}
    462 A_{j,k} & = & \alpha_{j,k} ~ (j \ne k) \\
    463 A_{j,k} & = & (1 + \lambda) \alpha_{j,k} ~ (j = k)
     472In the Levenberg-Marquardt Method (LMM; see NR \S 15.5, Madsen et al),
     473we make a guess at the input parameters, evaluate the function of
     474interest, vary the parameters by a particular choice based on the
     475gradient, evaluate the function again, and adjust the parameters and
     476the parameter varient based on the results.  The LMM only works if the
     477second derivative of the function can be considered negligible, as in
     478the case of minimizing $\chi^2$.
     479
     480Consider the chi-square function, given some ordinates, $x_i$, we
     481would like to find the parameters, $a_m$, of the function which
     482minimize $\chi^2$ for some measurements, $y_i$ and associated errors,
     483$\sigma_i$:
     484\begin{eqnarray}
     485\chi^2 (\bar{a})  & = & \sum_i \frac{1}{\sigma_i^2} \left( y_i - p(x_i;a_m) \right)^2  \\
     486\end{eqnarray}
     487
     488We simplify this as:
     489\begin{eqnarray}
     490p_i (a_m)         & = & p(x_i;a_m) \\
     491f_i (a_m)         & = & \frac{1}{\sigma_i} (y_i - p_i) \\
     492\chi^2 (\bar{a})  & = & \sum_i f_i^2 \\
     493\end{eqnarray}
     494
     495We write the minimization function $F(a_m) = \frac{1}{2} \chi^2$ to
     496avoid various extra factors of 2.  We can now write out the needed
     497derivatives in terms of $f_i$:
     498\begin{eqnarray}
     499F(a_m) = \frac{1}{2} \sum_i f_i^2 \\
     500\nabla F(a_m) = \sum_i f_i \frac{\partial f_i}{\partial a_m} \\
     501\nabla^2 F(a_m) = \sum_i \frac{\partial f_i}{\partial a_m} \frac{\partial f_i}{\partial a_n} \\
     502\end{eqnarray}
     503
     504where we have dropped the second-derivatives of the function in the
     505representation of $\nabla^2 F(a_m)$.  Since $\frac{\partial
     506f_i}{\partial a_m} = -\frac{1}{\sigma_i}\frac{\partial p_i}{\partial
     507a_m}$, we can write these in terms of the derivatives of $p_i$ only:
     508\begin{eqnarray}
     509\nabla F(a_m)   = -\sum_i \frac{f_i}{\sigma_i} \frac{\partial p_i}{\partial a_m} \\
     510\nabla^2 F(a_m) = \sum_i \frac{1}{\sigma_i^2} \frac{\partial p_i}{\partial a_m} \frac{\partial p_i}{\partial a_n} \\
     511\end{eqnarray}
     512
     513Writing these in matrix representation, and replacing $f_i$, we have:
     514\begin{eqnarray}
     515-g_m    = \sum_i \frac{(y_i - p_i)}{\sigma_i^2} \frac{\partial p_i}{\partial a_m} \\
     516H_{m,n} = \sum_i \frac{1}{\sigma_i^2} \frac{\partial p_i}{\partial a_m} \frac{\partial p_i}{\partial a_n} \\
     517\end{eqnarray}
     518
     519In the Levenberg-Marquart Method, we define a new guess using a
     520combination of the Steepest Descent and Gauss-Newton methods discussed
     521above.  We replace the Hessian matrix above with $A_{m,n}$ as a
     522variant on $H_{m,n}$ as follows:
     523
     524\begin{eqnarray}
     525A_{m,n} & = & H_{m,n} if (j \ne k) \\
     526A_{m,n} & = & H_{m,n}(1 + \lambda) if (j = k)
    464527\end{eqnarray}
    465528%
    466529and solve the system of equations represented by:
    467530\begin{equation}
    468 A_{j,k} a^\prime_k = \beta_j
     531A_{m,n} \delta_n = -g_m
    469532\end{equation}
    470533%
    471 where $a^\prime_k$ represents our new attempt at a parameter guess. We
    472 use this parameter set to evaluate the function.  If the new value of
    473 the function is lower than the previous guess, we accept this new set
    474 of parameters and decrease $\lambda$ by a factor of 10, otherwise we
    475 keep the old set, and increase the value of $\lambda$ by a factor of
    476 10.  We repeat this process until the value of the function changes by
    477 much less than the tolerance.  The resulting values of $a_k$ are the
    478 best-fit parameters for the system.
     534where $alpha^\prime_n = \alpha_n + \delta_n$ represents our new
     535attempt at a parameter guess. We use this parameter set to evaluate
     536the function. 
     537
     538To evaluate the new parameter set, we compare the change in $\chi^2$
     539with the change expected from the linear model (the Taylor expansion).
     540If the linear model were correct, we would have expected a change (a
     541reduction) in $\chi^2$ of $\Delta = \frac{\lambda}{2}\sum\delta_m^2 +
     542\frac{1}{2}\sum\delta_m g_m$.  We use the 'gain ratio' $\rho =
     543\frac{\chi^2_{\rm old} - \chi^2_{\rm new}}{\Delta}$ to judge the new
     544step. If $\rho > 0$, we accept this new set of parameters and decrease
     545$\lambda$ by a factor of 10, otherwise we keep the old set, and
     546increase the value of $\lambda$ by a factor of 10.  We repeat this
     547process until the value of the function changes by much less than the
     548tolerance.  The resulting values of $a_m$ are the best-fit parameters
     549for the system.
    479550
    480551The covariance matrix, $C_{i,j}$, which is the inverse of the matrix
    481 $\alpha_{j,k}$ allows simple calculation of the confidence limits of
    482 the parameters.
    483 
     552$H_{m,n}$ allows simple calculation of the confidence limits of the
     553parameters.
    484554
    485555%If the errors are normally distributed, the formal errors on the
     
    510580%\end{tabular}
    511581%\end{center}
    512 
    513582
    514583\subsubsection{Powell's method}
Note: See TracChangeset for help on using the changeset viewer.