IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19845


Ignore:
Timestamp:
Oct 2, 2008, 10:49:22 AM (18 years ago)
Author:
eugene
Message:

non-finite beta is info, not error; allow rho ~< 0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psMinimizeLMM.c

    r17355 r19845  
    1010 *  @author EAM, IfA
    1111 *
    12  *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2008-04-07 00:45:21 $
     12 *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2008-10-02 20:49:22 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9191        psTrace ("psLib.math", 4, "singular matrix in Guess ABP\n");
    9292        return(false);
     93    }
     94
     95    // check for non-finite entries in result
     96    for (int i = 0; i < Beta->n; i++) {
     97        if (!isfinite(Beta->data.F32[i])) {
     98            // psError(PS_ERR_BAD_PARAMETER_VALUE, 3, "Fit value diverges: vector[%d] is %.2f\n", i, Beta->data.F32[i]);
     99            return false;
     100        }
    93101    }
    94102
     
    453461                Chisq, min->lastDelta, dLinear, rho, lambda);
    454462
     463        psTrace("psLib.math.dLinear", 5, "last chisq: %f, new chisq %f, delta: %f, dLinear: %f, rho: %f, lambda: %f\n", min->value,
     464                Chisq, min->lastDelta, dLinear, rho, lambda);
     465
    455466        // dump some useful info if trace is defined
    456467        if (psTraceGetLevel("psLib.math") >= 6) {
     
    459470        }
    460471
    461         /* if (Chisq < min->value) { */
    462         if (rho > 0.0) {
     472        /* rho is positive if the new chisq is smaller; allow for some insignificant change (slight negative rho) */
     473        if (rho >= -1e-6) {
    463474            min->lastDelta = (min->value - Chisq) / (dy->n - params->n);
    464475            min->value = Chisq;
Note: See TracChangeset for help on using the changeset viewer.