Changeset 42719 for branches/2dbias/psLib/src/math/psStats.h
- Timestamp:
- Sep 13, 2024, 10:19:51 PM (22 months ago)
- File:
-
- 1 edited
-
branches/2dbias/psLib/src/math/psStats.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/2dbias/psLib/src/math/psStats.h
r31152 r42719 27 27 * @see psStats, psVectorStats, psImageStats 28 28 */ 29 typedef enum { 30 PS_STAT_NONE = 0x000000, ///< Empty set 31 PS_STAT_MIN = 0x000001, ///< Maximum 32 PS_STAT_MAX = 0x000002, ///< Minumum 33 PS_STAT_SAMPLE_MEAN = 0x000004, ///< Sample Mean 34 PS_STAT_SAMPLE_MEDIAN = 0x000008, ///< Sample Median 35 PS_STAT_SAMPLE_STDEV = 0x000010, ///< Sample Standard Deviation 36 PS_STAT_SAMPLE_QUARTILE = 0x000020, ///< Sample Quartile 37 PS_STAT_SAMPLE_SKEWNESS = 0x000040, ///< Sample Skewness (third moment) 38 PS_STAT_SAMPLE_KURTOSIS = 0x000080, ///< Sample Kurtosis (fourth moment) 39 PS_STAT_ROBUST_MEDIAN = 0x000100, ///< Robust Median 40 PS_STAT_ROBUST_STDEV = 0x000200, ///< Robust Standarad Deviation 41 PS_STAT_ROBUST_QUARTILE = 0x000400, ///< Robust Quartile 42 PS_STAT_ROBUST_SPARE1 = 0x000800, ///< Spare 1 43 PS_STAT_FITTED_MEAN = 0x001000, ///< Fitted Mean 44 PS_STAT_FITTED_STDEV = 0x002000, ///< Fitted Standard Deviation 45 PS_STAT_CLIPPED_MEAN = 0x040000, ///< Clipped Mean 46 PS_STAT_CLIPPED_STDEV = 0x080000, ///< Clipped Standard Deviation 47 PS_STAT_USE_RANGE = 0x100000, ///< Range 48 PS_STAT_USE_BINSIZE = 0x200000, ///< Binsize 29 typedef enum 30 { 31 PS_STAT_NONE = 0x000000, ///< Empty set 32 PS_STAT_MIN = 0x000001, ///< Maximum 33 PS_STAT_MAX = 0x000002, ///< Minumum 34 PS_STAT_SAMPLE_MEAN = 0x000004, ///< Sample Mean 35 PS_STAT_SAMPLE_MEDIAN = 0x000008, ///< Sample Median 36 PS_STAT_SAMPLE_STDEV = 0x000010, ///< Sample Standard Deviation 37 PS_STAT_SAMPLE_QUARTILE = 0x000020, ///< Sample Quartile 38 PS_STAT_SAMPLE_SKEWNESS = 0x000040, ///< Sample Skewness (third moment) 39 PS_STAT_SAMPLE_KURTOSIS = 0x000080, ///< Sample Kurtosis (fourth moment) 40 PS_STAT_ROBUST_MEDIAN = 0x000100, ///< Robust Median 41 PS_STAT_ROBUST_STDEV = 0x000200, ///< Robust Standarad Deviation 42 PS_STAT_ROBUST_QUARTILE = 0x000400, ///< Robust Quartile 43 PS_STAT_ROBUST_SPARE1 = 0x000800, ///< Spare 1 44 PS_STAT_FITTED_MEAN = 0x001000, ///< Fitted Mean 45 PS_STAT_FITTED_STDEV = 0x002000, ///< Fitted Standard Deviation 46 PS_STAT_CLIPPED_MEDIAN = 0x020000, ///< Clipped Median 47 PS_STAT_CLIPPED_MEAN = 0x040000, ///< Clipped Mean 48 PS_STAT_CLIPPED_STDEV = 0x080000, ///< Clipped Standard Deviation 49 PS_STAT_USE_RANGE = 0x100000, ///< Range 50 PS_STAT_USE_BINSIZE = 0x200000, ///< Binsize 49 51 } psStatsOptions; 50 52 … … 54 56 typedef struct 55 57 { 56 double sampleMean;///< formal mean of sample57 double sampleMedian;///< formal median of sample58 double sampleStdev;///< standard deviation of sample59 double sampleUQ;///< upper quartile of sample60 double sampleLQ;///< lower quartile of sample61 double sampleSkewness;///< skewness (third moment) of sample62 double sampleKurtosis;///< kurtosis (fourth moment) of sample63 double robustMedian;///< robust median of array64 double robustStdev;///< robust standard deviation of array65 double robustUQ;///< robust upper quartile66 double robustLQ;///< robust lower quartile67 long robustN50;///< Number of points in Gaussian fit; XXX: This is currently unused.68 double fittedMean;///< robust mean of data69 double fittedStdev;///< robust standard deviation of data70 long fittedNfit;///< Number of points in Gaussian fit; XXX: This is currently unused71 double clippedMean;///< Nsigma clipped mean72 double clippedStdev; ///< standard deviation after clipping73 long clippedNvalues; ///< Number of data points used for clipped mean.74 double clipSigma; ///< Nsigma used for clipping; user input75 int clipIter; ///< Number of clipping iterations; user input76 double min; ///< minimum data value in array77 double max; ///< maximum data value in array78 double binsize; ///< binsize for robust fit (input/ouput)79 long nSubsample; ///< maxinum number of measurements (input)80 psStatsOptions options; ///< bitmask of values requested81 psStatsOptions results; ///< bitmask of values calculated82 psVector *tmpData; ///< temporary vector so repeated calls do not have to realloc83 psVector *tmpMask;///< temporary vector so repeated calls do not have to realloc84 } 85 psStats;58 double sampleMean; ///< formal mean of sample 59 double sampleMedian; ///< formal median of sample 60 double sampleStdev; ///< standard deviation of sample 61 double sampleUQ; ///< upper quartile of sample 62 double sampleLQ; ///< lower quartile of sample 63 double sampleSkewness; ///< skewness (third moment) of sample 64 double sampleKurtosis; ///< kurtosis (fourth moment) of sample 65 double robustMedian; ///< robust median of array 66 double robustStdev; ///< robust standard deviation of array 67 double robustUQ; ///< robust upper quartile 68 double robustLQ; ///< robust lower quartile 69 long robustN50; ///< Number of points in Gaussian fit; XXX: This is currently unused. 70 double fittedMean; ///< robust mean of data 71 double fittedStdev; ///< robust standard deviation of data 72 long fittedNfit; ///< Number of points in Gaussian fit; XXX: This is currently unused 73 double clippedMean; ///< Nsigma clipped mean 74 double clippedMedian; ///< Nsigma clipped median 75 double clippedStdev; ///< standard deviation after clipping 76 long clippedNvalues; ///< Number of data points used for clipped mean. 77 double clipSigma; ///< Nsigma used for clipping; user input 78 int clipIter; ///< Number of clipping iterations; user input 79 double min; ///< minimum data value in array 80 double max; ///< maximum data value in array 81 double binsize; ///< binsize for robust fit (input/ouput) 82 long nSubsample; ///< maxinum number of measurements (input) 83 psStatsOptions options; ///< bitmask of values requested 84 psStatsOptions results; ///< bitmask of values calculated 85 psVector *tmpData; ///< temporary vector so repeated calls do not have to realloc 86 psVector *tmpMask; ///< temporary vector so repeated calls do not have to realloc 87 } psStats; 86 88 87 89 /** Performs statistical calculations on a vector. … … 90 92 */ 91 93 bool psVectorStats( 92 psStats * stats,///< stats structure defines stats to be calculated and how93 const psVector * in,///< Vector to be analysed.94 const psVector * errors,///< Errors.95 const psVector * mask,///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL94 psStats *stats, ///< stats structure defines stats to be calculated and how 95 const psVector *in, ///< Vector to be analysed. 96 const psVector *errors, ///< Errors. 97 const psVector *mask, ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL 96 98 psVectorMaskType maskVal ///< Only mask elements with one of these bits set in maskVector 97 99 ); … … 103 105 */ 104 106 #ifdef DOXYGEN 105 psStats *psStatsAlloc(106 psStatsOptions options ///< Statistics to calculate107 psStats *psStatsAlloc( 108 psStatsOptions options ///< Statistics to calculate 107 109 ); 108 110 #else // ifdef DOXYGEN 109 psStats *p_psStatsAlloc(110 const char *file, ///< File of caller111 unsigned int lineno, ///< Line number of caller112 const char *func, ///< Function name of caller113 psStatsOptions options ///< Statistics to calculate114 ) PS_ATTR_MALLOC;111 psStats *p_psStatsAlloc( 112 const char *file, ///< File of caller 113 unsigned int lineno, ///< Line number of caller 114 const char *func, ///< Function name of caller 115 psStatsOptions options ///< Statistics to calculate 116 ) PS_ATTR_MALLOC; 115 117 #define psStatsAlloc(options) \ 116 p_psStatsAlloc(__FILE__, __LINE__, __func__, options)118 p_psStatsAlloc(__FILE__, __LINE__, __func__, options) 117 119 #endif // ifdef DOXYGEN 118 120 … … 124 126 */ 125 127 bool psMemCheckStats( 126 psPtr ptr ///< the pointer whose type to check128 psPtr ptr ///< the pointer whose type to check 127 129 ); 128 130
Note:
See TracChangeset
for help on using the changeset viewer.
