IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 22, 2006, 12:46:12 PM (20 years ago)
Author:
Paul Price
Message:

Calculate clippedNvalues.

File:
1 edited

Legend:

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

    r7139 r7164  
    1616 * use ->min and ->max (PS_STAT_USE_RANGE)
    1717 *
    18  *  @version $Revision: 1.173 $ $Name: not supported by cvs2svn $
    19  *  @date $Date: 2006-05-18 03:10:06 $
     18 *  @version $Revision: 1.174 $ $Name: not supported by cvs2svn $
     19 *  @date $Date: 2006-05-22 22:46:12 $
    2020 *
    2121 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    832832
    833833    // 5. Repeat N (stats->clipIter) times:
    834     long numClipped = LONG_MAX;         // Number of values clipped in this iteration
    835     for (int iter = 0; iter < stats->clipIter && numClipped > 0; iter++) {
    836         numClipped = 0;
     834    long numClipped = 0;                // Number of values clipped
     835    bool clipped = true;                // Have we clipped anything in this iteration
     836    for (int iter = 0; iter < stats->clipIter && clipped; iter++) {
     837        clipped = false;
    837838        psTrace(__func__, 6, "------------ Iteration %d ------------\n", iter);
    838839        // a) Exclude all values x_i for which |x_i - x| > K * stdev
     
    844845                            myVector->data.F32[j], errors->data.F32[j]);
    845846                    numClipped++;
     847                    clipped = true;
    846848                }
    847849            }
     
    852854                    psTrace(__func__, 10, "Clipped %d: %f\n", j, myVector->data.F32[j]);
    853855                    numClipped++;
     856                    clipped = true;
    854857                }
    855858            }
     
    875878        }
    876879    }
     880
     881    // Number of values used in calculation is the total number of data values, minus those we clipped
     882    stats->clippedNvalues = myVector->n - numClipped;
    877883
    878884    // 7. The last calcuated value of x is the clipped mean.
Note: See TracChangeset for help on using the changeset viewer.