Changeset 4177 for trunk/doc/pslib/psLibADD.tex
- Timestamp:
- Jun 8, 2005, 7:16:23 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibADD.tex (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibADD.tex
r4095 r4177 1 %%% $Id: psLibADD.tex,v 1.7 4 2005-06-03 02:34:13 price Exp $1 %%% $Id: psLibADD.tex,v 1.75 2005-06-09 05:16:23 eugene Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 3 … … 433 433 \subsection{Non-linear Minimization} 434 434 435 Non-linear minimization techniques use an iterative approach to find a 436 minimization since an analytical inversion is impractical or not 437 possible. These techniques use a starting guess for the parameters of 438 interest, and make a sequence of new guess parameters based on the 439 properties of the function at the previous position. If the new 440 parameters yield a reduced function value, the new position is used as 441 the starting position for the next iteration. Otherwise, the guess 442 must be modified and another attempt is made. Convergence may be 443 determined based on the absolute amount of change in the function 444 value, or by comparison with the expectation for a linear system. 445 446 The two common techniques used to construct a guess parameter set are 447 the 'steepest descent method' and the 'gauss newton method'. In the 448 first case, the guess is selected some distance along the local 449 gradient. In the second case, a local Taylor expansion of the 450 function is used to construct a linear model for the function, and the 451 new guess is chosen to minimize that model. The methods discussed 452 below make use of combinations of these two methods. Aside from the 453 differences in their guess steps, the two methods differ in using 454 first derivatives of the function supplied by the user, or by locally 455 calculating the first derivatives. 456 457 Mathematically, we would like to choose the parameter set $a_m$ to 458 minimize a function of those parameters $F(a_m)$. We iterate by 459 choosing a new parameter set $a^\prime_m = a_m + \delta_m$ based on 460 the behavior of the function at $a_m$. 461 462 The 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 465 the function to solve for the step: $(\nabla^2 F) \bar{\delta} = 466 -\nabla F$. Defining $H_{m,n}$ as a component of the second 467 derivatives, we can write the Gauss-Newton step as $\delta_m = - 468 H_{m,n}^{-1} g_n$. 469 435 470 \subsubsection{Levenberg-Marquardt Method} 436 471 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) 472 In the Levenberg-Marquardt Method (LMM; see NR \S 15.5, Madsen et al), 473 we make a guess at the input parameters, evaluate the function of 474 interest, vary the parameters by a particular choice based on the 475 gradient, evaluate the function again, and adjust the parameters and 476 the parameter varient based on the results. The LMM only works if the 477 second derivative of the function can be considered negligible, as in 478 the case of minimizing $\chi^2$. 479 480 Consider the chi-square function, given some ordinates, $x_i$, we 481 would like to find the parameters, $a_m$, of the function which 482 minimize $\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 488 We simplify this as: 489 \begin{eqnarray} 490 p_i (a_m) & = & p(x_i;a_m) \\ 491 f_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 495 We write the minimization function $F(a_m) = \frac{1}{2} \chi^2$ to 496 avoid various extra factors of 2. We can now write out the needed 497 derivatives in terms of $f_i$: 498 \begin{eqnarray} 499 F(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 504 where we have dropped the second-derivatives of the function in the 505 representation of $\nabla^2 F(a_m)$. Since $\frac{\partial 506 f_i}{\partial a_m} = -\frac{1}{\sigma_i}\frac{\partial p_i}{\partial 507 a_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 513 Writing 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} \\ 516 H_{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 519 In the Levenberg-Marquart Method, we define a new guess using a 520 combination of the Steepest Descent and Gauss-Newton methods discussed 521 above. We replace the Hessian matrix above with $A_{m,n}$ as a 522 variant on $H_{m,n}$ as follows: 523 524 \begin{eqnarray} 525 A_{m,n} & = & H_{m,n} if (j \ne k) \\ 526 A_{m,n} & = & H_{m,n}(1 + \lambda) if (j = k) 464 527 \end{eqnarray} 465 528 % 466 529 and solve the system of equations represented by: 467 530 \begin{equation} 468 A_{ j,k} a^\prime_k = \beta_j531 A_{m,n} \delta_n = -g_m 469 532 \end{equation} 470 533 % 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. 534 where $alpha^\prime_n = \alpha_n + \delta_n$ represents our new 535 attempt at a parameter guess. We use this parameter set to evaluate 536 the function. 537 538 To evaluate the new parameter set, we compare the change in $\chi^2$ 539 with the change expected from the linear model (the Taylor expansion). 540 If the linear model were correct, we would have expected a change (a 541 reduction) 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 544 step. 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 546 increase the value of $\lambda$ by a factor of 10. We repeat this 547 process until the value of the function changes by much less than the 548 tolerance. The resulting values of $a_m$ are the best-fit parameters 549 for the system. 479 550 480 551 The 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 553 parameters. 484 554 485 555 %If the errors are normally distributed, the formal errors on the … … 510 580 %\end{tabular} 511 581 %\end{center} 512 513 582 514 583 \subsubsection{Powell's method}
Note:
See TracChangeset
for help on using the changeset viewer.
