Changeset 12608
- Timestamp:
- Mar 27, 2007, 2:49:13 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psStats.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psStats.c
r12495 r12608 13 13 * use ->min and ->max (PS_STAT_USE_RANGE) 14 14 * 15 * @version $Revision: 1.20 4$ $Name: not supported by cvs2svn $16 * @date $Date: 2007-03- 19 22:48:11$15 * @version $Revision: 1.205 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2007-03-28 00:49:13 $ 17 17 * 18 18 * Copyright 2006 IfA, University of Hawaii … … 746 746 // ADD step 4: Find the bins which contains the 15.8655% (-1 sigma) and 84.1345% (+1 sigma) data points 747 747 // also find the 30.8538% (-0.5 sigma) and 69.1462% (+0.5 sigma) points 748 PS_BIN_FOR_VALUE(binLo, cumulative->nums, totalDataPoints * 0.158655f, -1); 749 PS_BIN_FOR_VALUE(binHi, cumulative->nums, totalDataPoints * 0.841345f, +1); 750 751 PS_BIN_FOR_VALUE(binL2, cumulative->nums, totalDataPoints * 0.308538f, -1); 752 PS_BIN_FOR_VALUE(binH2, cumulative->nums, totalDataPoints * 0.691462f, +1); 748 PS_BIN_FOR_VALUE(binLo, cumulative->nums, totalDataPoints * 0.158655f, 0); 749 PS_BIN_FOR_VALUE(binHi, cumulative->nums, totalDataPoints * 0.841345f, 0); 750 PS_BIN_FOR_VALUE(binL2, cumulative->nums, totalDataPoints * 0.308538f, 0); 751 PS_BIN_FOR_VALUE(binH2, cumulative->nums, totalDataPoints * 0.691462f, 0); 753 752 754 753 psTrace("psLib.math", 6, "The 15.8655%% and 84.1345%% data point bins are (%ld, %ld).\n", … … 756 755 psTrace("psLib.math", 6, "binLo midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binLo)); 757 756 psTrace("psLib.math", 6, "binHi midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binHi)); 757 psTrace("psLib.math", 6, "binL2 midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binL2)); 758 psTrace("psLib.math", 6, "binH2 midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binH2)); 758 759 759 760 if ((binLo < 0) || (binHi < 0)) { … … 988 989 // select the min and max bins, saturating on the lower and upper end-points 989 990 long binMin, binMax; 990 PS_BIN_FOR_VALUE (binMin, histogram->bounds, guessMean - minFitSigma*guessStdev, -1);991 PS_BIN_FOR_VALUE (binMax, histogram->bounds, guessMean + maxFitSigma*guessStdev, +1);991 PS_BIN_FOR_VALUE (binMin, histogram->bounds, guessMean - minFitSigma*guessStdev, 0); 992 PS_BIN_FOR_VALUE (binMax, histogram->bounds, guessMean + maxFitSigma*guessStdev, 0); 992 993 993 994 // Generate the variables that will be used in the Gaussian fitting … … 1166 1167 // select the min and max bins, saturating on the lower and upper end-points 1167 1168 long binMin, binMax; 1168 PS_BIN_FOR_VALUE (binMin, histogram->bounds, guessMean - minFitSigma*guessStdev, -1);1169 PS_BIN_FOR_VALUE (binMax, histogram->bounds, guessMean + maxFitSigma*guessStdev, +1);1169 PS_BIN_FOR_VALUE (binMin, histogram->bounds, guessMean - minFitSigma*guessStdev, 0); 1170 PS_BIN_FOR_VALUE (binMax, histogram->bounds, guessMean + maxFitSigma*guessStdev, 0); 1170 1171 1171 1172 // Generate the variables that will be used in the Gaussian fitting … … 1359 1360 // select the min and max bins, saturating on the lower and upper end-points 1360 1361 long binMin, binMax; 1361 PS_BIN_FOR_VALUE (binMin, histogram->bounds, guessMean - minFitSigma*guessStdev, -1); 1362 PS_BIN_FOR_VALUE (binMax, histogram->bounds, guessMean + maxFitSigma*guessStdev, +1); 1362 PS_BIN_FOR_VALUE (binMin, histogram->bounds, guessMean - minFitSigma*guessStdev, 0); 1363 PS_BIN_FOR_VALUE (binMax, histogram->bounds, guessMean + maxFitSigma*guessStdev, 0); 1364 if (binMin == binMax) { 1365 psAbort ("invalid range for fitted mean"); 1366 } 1363 1367 1364 1368 // search for mode (peak of histogram within range mean-2sigma - mean+2sigma
Note:
See TracChangeset
for help on using the changeset viewer.
