casacore
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator > Class Template Reference

The biweight algorithm is a robust iterative algorithm that computes two quantities called the "location" and the "scale", which are analogous to the mean and the standard deviation. More...

#include <BiweightStatistics.h>

Public Member Functions

 BiweightStatistics (Int maxNiter=3, Double c=6.0)
 
 BiweightStatistics (const BiweightStatistics< CASA_STATP > &other)
 copy semantics More...
 
virtual ~BiweightStatistics ()
 
BiweightStatistics< CASA_STATP > & operator= (const BiweightStatistics< CASA_STATP > &other)
 copy semantics More...
 
virtual StatisticsData::ALGORITHM algorithm () const
 get the algorithm that this object uses for computing stats More...
 
virtual StatisticsAlgorithm< CASA_STATP > * clone () const
 Clone this instance. More...
 
virtual AccumType getMedian (CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< AccumType > knownMin=nullptr, CountedPtr< AccumType > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
 these statistics are not supported. More...
 
virtual AccumType getMedianAndQuantiles (std::map< Double, AccumType > &quantileToValue, const std::set< Double > &quantiles, CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< AccumType > knownMin=nullptr, CountedPtr< AccumType > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
 
virtual AccumType getMedianAbsDevMed (CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< AccumType > knownMin=nullptr, CountedPtr< AccumType > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
 
virtual std::map< Double, AccumType > getQuantiles (const std::set< Double > &quantiles, CountedPtr< uInt64 > npts=nullptr, CountedPtr< AccumType > min=nullptr, CountedPtr< AccumType > max=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
 
virtual std::pair< Int64, Int64getStatisticIndex (StatisticsData::STATS stat)
 see base class description More...
 
Int getNiter () const
 returns the number of iterations performed to compute the current location and scale values More...
 
virtual void reset ()
 reset object to initial state. More...
 
virtual void setCalculateAsAdded (Bool c)
 If c is True, an exception is thrown; this algorithm does not support computing stats as data are added. More...
 
virtual void setStatsToCalculate (std::set< StatisticsData::STATS > &stats)
 Provide guidance to algorithms by specifying a priori which statistics the caller would like calculated. More...
 
- Public Member Functions inherited from casacore::ClassicalStatistics< CASA_STATP >
 ClassicalStatistics ()
 
 ClassicalStatistics (const ClassicalStatistics &cs)
 copy semantics More...
 
virtual ~ClassicalStatistics ()
 
ClassicalStatisticsoperator= (const ClassicalStatistics &other)
 copy semantics More...
 
virtual CASA_STATP getMedian (CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< CASA_STATP > knownMin=nullptr, CountedPtr< CASA_STATP > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
 In the following group of methods, if the size of the composite dataset is smaller than binningThreshholdSizeBytes, the composite dataset will be (perhaps partially) sorted and persisted in memory during the call. More...
 
virtual CASA_STATP getMedianAndQuantiles (std::map< Double, CASA_STATP > &quantiles, const std::set< Double > &fractions, CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< CASA_STATP > knownMin=nullptr, CountedPtr< CASA_STATP > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
 If one needs to compute both the median and quantile values, it is better to call getMedianAndQuantiles() rather than getMedian() and getQuantiles() separately, as the first will scan large data sets fewer times than calling the separate methods. More...
 
virtual CASA_STATP getMedianAbsDevMed (CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< CASA_STATP > knownMin=nullptr, CountedPtr< CASA_STATP > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
 get the median of the absolute deviation about the median of the data. More...
 
virtual std::map< Double, CASA_STATPgetQuantiles (const std::set< Double > &fractions, CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< CASA_STATP > knownMin=nullptr, CountedPtr< CASA_STATP > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
 Get the specified quantiles. More...
 
virtual void getMinMax (CASA_STATP &mymin, CASA_STATP &mymax)
 scan the dataset(s) that have been added, and find the min and max. More...
 
virtual void getMinMaxNpts (uInt64 &npts, CASA_STATP &mymin, CASA_STATP &mymax)
 
virtual uInt64 getNPts ()
 scan the dataset(s) that have been added, and find the number of good points. More...
 
virtual void setDataProvider (StatsDataProvider< CASA_STATP > *dataProvider)
 An exception will be thrown if setCalculateAsAdded(True) has been called. More...
 
void setQuantileComputer (CountedPtr< ClassicalQuantileComputer< CASA_STATP >> qc)
 Allow derived objects to set the quantile computer object. More...
 
- Public Member Functions inherited from casacore::StatisticsAlgorithm< CASA_STATP >
virtual ~StatisticsAlgorithm ()
 
void addData (const DataIterator &first, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False)
 Add a dataset to an existing set of datasets on which statistics are to be calculated. More...
 
void addData (const DataIterator &first, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False)
 
void addData (const DataIterator &first, const const Bool * &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
void addData (const DataIterator &first, const const Bool * &maskFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
void addData (const DataIterator &first, const DataIterator &weightFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False)
 
void addData (const DataIterator &first, const DataIterator &weightFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False)
 
void addData (const DataIterator &first, const DataIterator &weightFirst, const const Bool * &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
void addData (const DataIterator &first, const DataIterator &weightFirst, const const Bool * &maskFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
CASA_STATP getQuantile (Double quantile, CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< CASA_STATP > knownMin=nullptr, CountedPtr< CASA_STATP > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
 Purposefully not virtual. More...
 
CASA_STATP getStatistic (StatisticsData::STATS stat)
 get the value of the specified statistic. More...
 
StatsData< CASA_STATPgetStatistics ()
 Return statistics. More...
 
void setData (const DataIterator &first, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False)
 setdata() clears any current datasets or data provider and then adds the specified data set as the first dataset in the (possibly new) set of data sets for which statistics are to be calculated. More...
 
void setData (const DataIterator &first, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False)
 
void setData (const DataIterator &first, const const Bool * &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
void setData (const DataIterator &first, const const Bool * &maskFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
void setData (const DataIterator &first, const DataIterator &weightFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False)
 
void setData (const DataIterator &first, const DataIterator &weightFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False)
 
void setData (const DataIterator &first, const DataIterator &weightFirst, const const Bool * &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
void setData (const DataIterator &first, const DataIterator &weightFirst, const const Bool * &maskFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 

Protected Member Functions

void _computeStats ()
 
virtual StatsData< AccumType > _getStatistics ()
 
- Protected Member Functions inherited from casacore::ClassicalStatistics< CASA_STATP >
 ClassicalStatistics (CountedPtr< ClassicalQuantileComputer< CASA_STATP > > qc)
 This constructor should be used by derived objects in order to set the proper quantile computer object. More...
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, uInt64 nr, uInt dataStride) const
 scan through the data set to determine the number of good (unmasked, weight > 0, within range) points. More...
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride) const
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride) const
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, const DataIterator &weightBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride) const
 
void _accumulate (StatsData< CASA_STATP > &stats, const CASA_STATP &datum, const LocationType &location)
 
void _accumulate (StatsData< CASA_STATP > &stats, const CASA_STATP &datum, const CASA_STATP &weight, const LocationType &location)
 
void _addData ()
 Allows derived classes to do things after data is set or added. More...
 
void _clearStats ()
 
Bool _getDoMaxMin () const
 
virtual StatsData< CASA_STATP_getInitialStats () const
 
virtual CASA_STATP _getStatistic (StatisticsData::STATS stat)
 
virtual StatsData< CASA_STATP > & _getStatsData ()
 Retrieve stats structure. More...
 
virtual const StatsData< CASA_STATP > & _getStatsData () const
 
virtual void _minMax (CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride) const
 
virtual void _minMax (CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMax (CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride) const
 
virtual void _minMax (CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMax (CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride) const
 
virtual void _minMax (CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMax (CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMax (CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, const DataIterator &weightBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride) const
 Sometimes we want the min, max, and npts all in one scan. More...
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, const DataIterator &weightBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride) const
 
CountedPtr< StatisticsAlgorithmQuantileComputer< CASA_STATP > > _getQuantileComputer ()
 
virtual void _unweightedStats (StatsData< CASA_STATP > &stats, uInt64 &ngood, LocationType &location, const DataIterator &dataBegin, uInt64 nr, uInt dataStride)
 no weights, no mask, no ranges More...
 
virtual void _unweightedStats (StatsData< CASA_STATP > &stats, uInt64 &ngood, LocationType &location, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude)
 no weights, no mask More...
 
virtual void _unweightedStats (StatsData< CASA_STATP > &stats, uInt64 &ngood, LocationType &location, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride)
 
virtual void _unweightedStats (StatsData< CASA_STATP > &stats, uInt64 &ngood, LocationType &location, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude)
 
virtual void _updateDataProviderMaxMin (const StatsData< CASA_STATP > &threadStats)
 
virtual void _weightedStats (StatsData< CASA_STATP > &stats, LocationType &location, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride)
 has weights, but no mask, no ranges More...
 
virtual void _weightedStats (StatsData< CASA_STATP > &stats, LocationType &location, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude)
 
virtual void _weightedStats (StatsData< CASA_STATP > &stats, LocationType &location, const DataIterator &dataBegin, const DataIterator &weightBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride)
 
virtual void _weightedStats (StatsData< CASA_STATP > &stats, LocationType &location, const DataIterator &dataBegin, const DataIterator &weightBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude)
 
- Protected Member Functions inherited from casacore::StatisticsAlgorithm< CASA_STATP >
 StatisticsAlgorithm ()
 
 StatisticsAlgorithm (const StatisticsAlgorithm &other)
 use copy semantics, except for the data provider which uses reference semantics More...
 
StatisticsAlgorithmoperator= (const StatisticsAlgorithm &other)
 use copy semantics, except for the data provider which uses reference semantics More...
 
const StatisticsDataset< CASA_STATP > & _getDataset () const
 These methods are purposefully not virtual. More...
 
StatisticsDataset< CASA_STATP > & _getDataset ()
 
const std::set< StatisticsData::STATS_getStatsToCalculate () const
 
virtual const std::set< StatisticsData::STATS > & _getUnsupportedStatistics () const
 
void _setUnsupportedStatistics (const std::set< StatisticsData::STATS > &stats)
 Derived classes should normally call this in their constructors, if applicable. More...
 

Private Member Functions

void _computeLocationAndScaleSums (AccumType &sxw2, AccumType &sw2, AccumType &sx_M2w4, AccumType &ww_4u2, DataIterator dataIter, MaskIterator maskIter, WeightsIterator weightsIter, uInt64 dataCount, const typename StatisticsDataset< CASA_STATP >::ChunkData &chunk)
 
void _computeLocationSums (AccumType &sxw2, AccumType &sw2, DataIterator dataIter, MaskIterator maskIter, WeightsIterator weightsIter, uInt64 dataCount, const typename StatisticsDataset< CASA_STATP >::ChunkData &chunk)
 
void _computeScaleSums (AccumType &sx_M2w4, AccumType &ww_4u2, DataIterator dataIter, MaskIterator maskIter, WeightsIterator weightsIter, uInt64 dataCount, const typename StatisticsDataset< CASA_STATP >::ChunkData &chunk) const
 
void _doLocationAndScale ()
 
void _doLocation ()
 
void _doScale ()
 
void _locationAndScaleSums (AccumType &sxw2, AccumType &sw2, AccumType &sx_M2w4, AccumType &ww_4u2, const DataIterator &dataBegin, uInt64 nr, uInt dataStride) const
 sxw2 = sum(x_i*(1 - u_i^2)^2) sw2 = sum((1-u_i^2)^2) sx_M2w4 = sum((x_i - _location)^2 * (1 - u_i^2)^4) = sum((x_i - _location)^2 * w_i^4) ww_4u2 = sum((1 - u_i^2) * (1 - 5*u_i^2)) = sum(w_i * (w_i - 4*u_i^2)) More...
 
void _locationAndScaleSums (AccumType &sxw2, AccumType &sw2, AccumType &sx_M2w4, AccumType &ww_4u2, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
void _locationAndScaleSums (AccumType &sxw2, AccumType &sw2, AccumType &sx_M2w4, AccumType &ww_4u2, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride) const
 
void _locationAndScaleSums (AccumType &sxw2, AccumType &sw2, AccumType &sx_M2w4, AccumType &ww_4u2, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
void _locationAndScaleSums (AccumType &sxw2, AccumType &sw2, AccumType &sx_M2w4, AccumType &ww_4u2, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride) const
 
void _locationAndScaleSums (AccumType &sxw2, AccumType &sw2, AccumType &sx_M2w4, AccumType &ww_4u2, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
void _locationAndScaleSums (AccumType &sxw2, AccumType &sw2, AccumType &sx_M2w4, AccumType &ww_4u2, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
void _locationAndScaleSums (AccumType &sxw2, AccumType &sw2, AccumType &sx_M2w4, AccumType &ww_4u2, const DataIterator &dataBegin, const WeightsIterator &weightBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride) const
 
void _locationSums (AccumType &sxw2, AccumType &sw2, const DataIterator &dataBegin, uInt64 nr, uInt dataStride) const
 sxw2 = sum(x_i*(1 - u_i^2)^2) sw2 = sum((1-u_i^2)^2) More...
 
void _locationSums (AccumType &sxw2, AccumType &sw2, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
void _locationSums (AccumType &sxw2, AccumType &sw2, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride) const
 
void _locationSums (AccumType &sxw2, AccumType &sw2, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
void _locationSums (AccumType &sxw2, AccumType &sw2, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride) const
 
void _locationSums (AccumType &sxw2, AccumType &sw2, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
void _locationSums (AccumType &sxw2, AccumType &sw2, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
void _locationSums (AccumType &sxw2, AccumType &sw2, const DataIterator &dataBegin, const WeightsIterator &weightBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride) const
 
void _scaleSums (AccumType &sx_M2w4, AccumType &ww_4u2, const DataIterator &dataBegin, uInt64 nr, uInt dataStride) const
 sx_M2w4 = sum((x_i - _location)^2 * (1 - u_i^2)^4) = sum((x_i - _location)^2 * w_i^4) ww_4u2 = sum((1 - u_i^2) * (1 - 5*u_i^2)) = sum(w_i * (w_i - 4*u_i^2)) More...
 
void _scaleSums (AccumType &sx_M2w4, AccumType &ww_4u2, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
void _scaleSums (AccumType &sx_M2w4, AccumType &ww_4u2, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride) const
 
void _scaleSums (AccumType &sx_M2w4, AccumType &ww_4u2, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
void _scaleSums (AccumType &sx_M2w4, AccumType &ww_4u2, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride) const
 
void _scaleSums (AccumType &sx_M2w4, AccumType &ww_4u2, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
void _scaleSums (AccumType &sx_M2w4, AccumType &ww_4u2, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
void _scaleSums (AccumType &sx_M2w4, AccumType &ww_4u2, const DataIterator &dataBegin, const WeightsIterator &weightBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride) const
 

Private Attributes

Double _c
 
Int _niter
 
Int _maxNiter
 
AccumType _location
 
AccumType _scale
 
std::pair< AccumType, AccumType > _range
 
uInt64 _npts
 _npts is the number of points computed using ClassicalStatistics More...
 

Static Private Attributes

static const AccumType FOUR
 because the compiler gets confused if these aren't explicitly typed More...
 
static const AccumType FIVE
 

Detailed Description

template<class AccumType, class DataIterator, class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
class casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >

The biweight algorithm is a robust iterative algorithm that computes two quantities called the "location" and the "scale", which are analogous to the mean and the standard deviation.

Important equations are

A. How to compute u_i values, which are related to the weights, w_i = (1 - u_i*u_i) if abs(u_i) < 1, 0 otherwise, using the equation

u_i = (x_i - c_bi)/(c*s_bi) (1)

where x_i are the data values, c_bi is the biweight location, c is a configurable constant, and s_bi is the biweight scale. For the initial computation of the u_i values, c_bi is set equal to the median of the distribution and s_bi is set equal to the normalized median of the absolute deviation about the median (that is the median of the absolute deviation about the median multiplied by the value of the probit function at 0.75). B The location, c_bi, is computed from

c_bi = sum(x_i * w_i^2)/sum(w_i^2) (2)

where only values of u_i which satisfy abs(u_i) < 1 (w_i > 0) are used in the sums. C. The scale value is computed using

n * sum((x_i - c_bi)^2 * w_i^4) s_bi^2 = _______________________________ (3) p * max(1, p - 1)

where n is the number of points for the entire distribution (which includes all the data for which abs(u_i) >= 1) and p is given by

p = abs(sum((w_i) * (w_i - 4*u_i^2)))

Again, the sums include only data for which abs(u_i) < 1.

The algorithm proceeds as follows.

  1. Compute initial u_i values from equation (1), setting c_bi equal to the median of the distribution and s_bi equal to the normalized median of the absolute deviation about the median.
  2. Compute the initial value of the scale using the u_i values computed in step 1. using equation 3.
  3. Recompute u_i values using the most recent previous scale and location values.
  4. Compute the location using the u_i values from step 3 and equation (2).
  5. Recompute u_i values using the most recent previous scale and location values.
  6. Compute the new scale value using the the u_i values computed in step 5 and the value of the location computed in step 4.
  7. Steps 3. - 6. are repeated until convergence occurs or the maximum number of iterations (a configurable parameter) is reached. The convergence criterion is given by

abs(1 - s_bi/s_bi,prev) < 0.03 * sqrt(0.5/(n - 1))

where s_bi,prev is the value of the scale computed in the previous iteration.

SPECIAL CASE TO FACILITATE SPEED

In the special case where maxNiter is specified to be negative, the algorithm proceeds as follows

  1. Compute u_i values using the median for the location and the normalized median of the absolute deviation about the median as the scale
  2. Compute the location and scale (which can be carried out simultaneously) using the u_i values computed in step 1. The value of the location is just the median that is used in equation (3) to compute the scale

IMPORTANT NOTE REGARDING USER SPECIFIED WEIGHTS

Although user-specified weights can be supplied, they are effectively ignored by this algorithm, except for data which have weights of zero, which are ignored.

This is a derived class of ClassicalStatistics, rather than ConstrainedRangeStatistics, because if behaves differently from ConstrainedRangeStatistics and does not need to use any methods in that class, so making it a specialization of the higher level ClassicalStatistics seems the better choice.

Definition at line 121 of file BiweightStatistics.h.

Constructor & Destructor Documentation

◆ BiweightStatistics() [1/2]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::BiweightStatistics ( Int  maxNiter = 3,
Double  c = 6.0 
)

◆ BiweightStatistics() [2/2]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::BiweightStatistics ( const BiweightStatistics< CASA_STATP > &  other)

copy semantics

◆ ~BiweightStatistics()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::~BiweightStatistics ( )
virtual

Member Function Documentation

◆ _computeLocationAndScaleSums()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_computeLocationAndScaleSums ( AccumType &  sxw2,
AccumType &  sw2,
AccumType &  sx_M2w4,
AccumType &  ww_4u2,
DataIterator  dataIter,
MaskIterator  maskIter,
WeightsIterator  weightsIter,
uInt64  dataCount,
const typename StatisticsDataset< CASA_STATP >::ChunkData &  chunk 
)
private

◆ _computeLocationSums()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_computeLocationSums ( AccumType &  sxw2,
AccumType &  sw2,
DataIterator  dataIter,
MaskIterator  maskIter,
WeightsIterator  weightsIter,
uInt64  dataCount,
const typename StatisticsDataset< CASA_STATP >::ChunkData &  chunk 
)
private

◆ _computeScaleSums()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_computeScaleSums ( AccumType &  sx_M2w4,
AccumType &  ww_4u2,
DataIterator  dataIter,
MaskIterator  maskIter,
WeightsIterator  weightsIter,
uInt64  dataCount,
const typename StatisticsDataset< CASA_STATP >::ChunkData &  chunk 
) const
private

◆ _computeStats()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_computeStats ( )
protected

◆ _doLocation()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_doLocation ( )
private

◆ _doLocationAndScale()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_doLocationAndScale ( )
private

◆ _doScale()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_doScale ( )
private

◆ _getStatistics()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual StatsData<AccumType> casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_getStatistics ( )
protectedvirtual

◆ _locationAndScaleSums() [1/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_locationAndScaleSums ( AccumType &  sxw2,
AccumType &  sw2,
AccumType &  sx_M2w4,
AccumType &  ww_4u2,
const DataIterator &  dataBegin,
const WeightsIterator &  weightBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride 
) const
private

◆ _locationAndScaleSums() [2/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_locationAndScaleSums ( AccumType &  sxw2,
AccumType &  sw2,
AccumType &  sx_M2w4,
AccumType &  ww_4u2,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride 
) const
private

◆ _locationAndScaleSums() [3/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_locationAndScaleSums ( AccumType &  sxw2,
AccumType &  sw2,
AccumType &  sx_M2w4,
AccumType &  ww_4u2,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride,
const DataRanges ranges,
Bool  isInclude 
) const
private

◆ _locationAndScaleSums() [4/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_locationAndScaleSums ( AccumType &  sxw2,
AccumType &  sw2,
AccumType &  sx_M2w4,
AccumType &  ww_4u2,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride,
const DataRanges ranges,
Bool  isInclude 
) const
private

◆ _locationAndScaleSums() [5/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_locationAndScaleSums ( AccumType &  sxw2,
AccumType &  sw2,
AccumType &  sx_M2w4,
AccumType &  ww_4u2,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride 
) const
private

sxw2 = sum(x_i*(1 - u_i^2)^2) sw2 = sum((1-u_i^2)^2) sx_M2w4 = sum((x_i - _location)^2 * (1 - u_i^2)^4) = sum((x_i - _location)^2 * w_i^4) ww_4u2 = sum((1 - u_i^2) * (1 - 5*u_i^2)) = sum(w_i * (w_i - 4*u_i^2))

◆ _locationAndScaleSums() [6/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_locationAndScaleSums ( AccumType &  sxw2,
AccumType &  sw2,
AccumType &  sx_M2w4,
AccumType &  ww_4u2,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const DataRanges ranges,
Bool  isInclude 
) const
private

◆ _locationAndScaleSums() [7/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_locationAndScaleSums ( AccumType &  sxw2,
AccumType &  sw2,
AccumType &  sx_M2w4,
AccumType &  ww_4u2,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride 
) const
private

◆ _locationAndScaleSums() [8/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_locationAndScaleSums ( AccumType &  sxw2,
AccumType &  sw2,
AccumType &  sx_M2w4,
AccumType &  ww_4u2,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride,
const DataRanges ranges,
Bool  isInclude 
) const
private

◆ _locationSums() [1/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_locationSums ( AccumType &  sxw2,
AccumType &  sw2,
const DataIterator &  dataBegin,
const WeightsIterator &  weightBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride 
) const
private

◆ _locationSums() [2/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_locationSums ( AccumType &  sxw2,
AccumType &  sw2,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride 
) const
private

◆ _locationSums() [3/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_locationSums ( AccumType &  sxw2,
AccumType &  sw2,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride,
const DataRanges ranges,
Bool  isInclude 
) const
private

◆ _locationSums() [4/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_locationSums ( AccumType &  sxw2,
AccumType &  sw2,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride,
const DataRanges ranges,
Bool  isInclude 
) const
private

◆ _locationSums() [5/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_locationSums ( AccumType &  sxw2,
AccumType &  sw2,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride 
) const
private

sxw2 = sum(x_i*(1 - u_i^2)^2) sw2 = sum((1-u_i^2)^2)

◆ _locationSums() [6/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_locationSums ( AccumType &  sxw2,
AccumType &  sw2,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const DataRanges ranges,
Bool  isInclude 
) const
private

◆ _locationSums() [7/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_locationSums ( AccumType &  sxw2,
AccumType &  sw2,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride 
) const
private

◆ _locationSums() [8/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_locationSums ( AccumType &  sxw2,
AccumType &  sw2,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride,
const DataRanges ranges,
Bool  isInclude 
) const
private

◆ _scaleSums() [1/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_scaleSums ( AccumType &  sx_M2w4,
AccumType &  ww_4u2,
const DataIterator &  dataBegin,
const WeightsIterator &  weightBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride 
) const
private

◆ _scaleSums() [2/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_scaleSums ( AccumType &  sx_M2w4,
AccumType &  ww_4u2,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride 
) const
private

◆ _scaleSums() [3/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_scaleSums ( AccumType &  sx_M2w4,
AccumType &  ww_4u2,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride,
const DataRanges ranges,
Bool  isInclude 
) const
private

◆ _scaleSums() [4/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_scaleSums ( AccumType &  sx_M2w4,
AccumType &  ww_4u2,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride,
const DataRanges ranges,
Bool  isInclude 
) const
private

◆ _scaleSums() [5/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_scaleSums ( AccumType &  sx_M2w4,
AccumType &  ww_4u2,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride 
) const
private

sx_M2w4 = sum((x_i - _location)^2 * (1 - u_i^2)^4) = sum((x_i - _location)^2 * w_i^4) ww_4u2 = sum((1 - u_i^2) * (1 - 5*u_i^2)) = sum(w_i * (w_i - 4*u_i^2))

◆ _scaleSums() [6/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_scaleSums ( AccumType &  sx_M2w4,
AccumType &  ww_4u2,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const DataRanges ranges,
Bool  isInclude 
) const
private

◆ _scaleSums() [7/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_scaleSums ( AccumType &  sx_M2w4,
AccumType &  ww_4u2,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride 
) const
private

◆ _scaleSums() [8/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_scaleSums ( AccumType &  sx_M2w4,
AccumType &  ww_4u2,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride,
const DataRanges ranges,
Bool  isInclude 
) const
private

◆ algorithm()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual StatisticsData::ALGORITHM casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::algorithm ( ) const
virtual

get the algorithm that this object uses for computing stats

Reimplemented from casacore::ClassicalStatistics< CASA_STATP >.

◆ clone()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual StatisticsAlgorithm<CASA_STATP>* casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::clone ( ) const
virtual

Clone this instance.

Reimplemented from casacore::ClassicalStatistics< CASA_STATP >.

◆ getMedian()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual AccumType casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::getMedian ( CountedPtr< uInt64 knownNpts = nullptr,
CountedPtr< AccumType >  knownMin = nullptr,
CountedPtr< AccumType >  knownMax = nullptr,
uInt  binningThreshholdSizeBytes = 4096 *4096,
Bool  persistSortedArray = False,
uInt  nBins = 10000 
)
virtual

these statistics are not supported.

The methods, which override the virtual ancestor versions, throw exceptions.

◆ getMedianAbsDevMed()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual AccumType casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::getMedianAbsDevMed ( CountedPtr< uInt64 knownNpts = nullptr,
CountedPtr< AccumType >  knownMin = nullptr,
CountedPtr< AccumType >  knownMax = nullptr,
uInt  binningThreshholdSizeBytes = 4096 *4096,
Bool  persistSortedArray = False,
uInt  nBins = 10000 
)
virtual

◆ getMedianAndQuantiles()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual AccumType casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::getMedianAndQuantiles ( std::map< Double, AccumType > &  quantileToValue,
const std::set< Double > &  quantiles,
CountedPtr< uInt64 knownNpts = nullptr,
CountedPtr< AccumType >  knownMin = nullptr,
CountedPtr< AccumType >  knownMax = nullptr,
uInt  binningThreshholdSizeBytes = 4096 *4096,
Bool  persistSortedArray = False,
uInt  nBins = 10000 
)
virtual

◆ getNiter()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
Int casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::getNiter ( ) const

returns the number of iterations performed to compute the current location and scale values

◆ getQuantiles()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual std::map<Double, AccumType> casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::getQuantiles ( const std::set< Double > &  quantiles,
CountedPtr< uInt64 npts = nullptr,
CountedPtr< AccumType >  min = nullptr,
CountedPtr< AccumType >  max = nullptr,
uInt  binningThreshholdSizeBytes = 4096 *4096,
Bool  persistSortedArray = False,
uInt  nBins = 10000 
)
virtual

◆ getStatisticIndex()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual std::pair<Int64, Int64> casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::getStatisticIndex ( StatisticsData::STATS  stat)
virtual

see base class description

Reimplemented from casacore::ClassicalStatistics< CASA_STATP >.

◆ operator=()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
BiweightStatistics<CASA_STATP>& casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::operator= ( const BiweightStatistics< CASA_STATP > &  other)

copy semantics

◆ reset()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::reset ( )
virtual

reset object to initial state.

Clears all private fields including data, accumulators, etc.

Reimplemented from casacore::ClassicalStatistics< CASA_STATP >.

◆ setCalculateAsAdded()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::setCalculateAsAdded ( Bool  c)
virtual

If c is True, an exception is thrown; this algorithm does not support computing stats as data are added.

Reimplemented from casacore::ClassicalStatistics< CASA_STATP >.

◆ setStatsToCalculate()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::setStatsToCalculate ( std::set< StatisticsData::STATS > &  stats)
virtual

Provide guidance to algorithms by specifying a priori which statistics the caller would like calculated.

This algorithm always needs to compute the location (MEAN) and the scale (STDDEV) so these statistics are always added to the input set, which is why this method overrides the base class version.

Reimplemented from casacore::ClassicalStatistics< CASA_STATP >.

Member Data Documentation

◆ _c

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
Double casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_c
private

Definition at line 208 of file BiweightStatistics.h.

◆ _location

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
AccumType casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_location
private

Definition at line 210 of file BiweightStatistics.h.

◆ _maxNiter

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
Int casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_maxNiter
private

Definition at line 209 of file BiweightStatistics.h.

◆ _niter

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
Int casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_niter
private

Definition at line 209 of file BiweightStatistics.h.

◆ _npts

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
uInt64 casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_npts
private

_npts is the number of points computed using ClassicalStatistics

Definition at line 213 of file BiweightStatistics.h.

◆ _range

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
std::pair<AccumType, AccumType> casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_range
private

Definition at line 211 of file BiweightStatistics.h.

◆ _scale

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
AccumType casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_scale
private

Definition at line 210 of file BiweightStatistics.h.

◆ FIVE

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
const AccumType casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::FIVE
staticprivate

Definition at line 217 of file BiweightStatistics.h.

◆ FOUR

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
const AccumType casacore::BiweightStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::FOUR
staticprivate

because the compiler gets confused if these aren't explicitly typed

Definition at line 216 of file BiweightStatistics.h.


The documentation for this class was generated from the following file: