IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4304


Ignore:
Timestamp:
Jun 17, 2005, 12:19:33 PM (21 years ago)
Author:
eugene
Message:

changed convergence test to gain version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/lib.data/mrqmin.c

    r2843 r4304  
    5151  int j, k;
    5252  float chisq;
     53  float rho, dX, dL;
    5354
    5455  /* set up test matrixes for this run */
     
    6364  for (j = 0; j < Npar; j++) partry[j] = par[j] - tbeta[j][0];
    6465
     66  /* get linear model prediction */
     67  dL = 0;
     68  for (j = 0; j < Npar; j++) {
     69      dL += 0.5*lambda*SQ(tbeta[j][0]) + tbeta[j][0]*beta[j][0];
     70  }
     71
    6572  chisq = mrqcof (x, y, dy, Npts, partry, Npar, talpha, tbeta, funcs);
    6673  if (VERBOSE) {
     
    7380  }
    7481
     82  /* compare linear model with actual */
     83  dX = ochisq - chisq;
     84  rho = dX / dL;
     85
    7586  /* if good, save temp values */
    76   if (chisq < ochisq) {
     87  if (rho > 0) {
    7788    lambda *= 0.1;
    7889    ochisq = chisq;
Note: See TracChangeset for help on using the changeset viewer.