CFEL - ASG Software Suite
2.5.0
CASS
|
statistics calculator for a cummulative statistic, removes outliers More...
#include <statistics_calculator.hpp>
Public Types | |
typedef Type | value_type |
define the value type More... | |
typedef CummulativeStatisticsCalculator< value_type > | statistics_t |
define the statistics More... | |
typedef std::vector< value_type > | container_type |
define the type of container used for the values More... | |
typedef container_type::iterator | iterator_t |
define a const iterator of the container More... | |
typedef std::iterator_traits< iterator_t >::difference_type | count_type |
define number of elements More... | |
Public Member Functions | |
CummulativeStatisticsNoOutlier (const value_type &snr) | |
constructor sets the signal to noise ratio More... | |
void | addDatum (const value_type &datum) |
add a datum to the container More... | |
template<class InputIterator > | |
void | addDistribution (InputIterator first, InputIterator last) |
add a number of dati to the distribution More... | |
void | setDistribution (const container_type &distribution) |
substitute the internal container with an outside one More... | |
value_type | mean () |
retrieve the mean of the distribution without outliers More... | |
value_type | stdv () |
retrieve the standart deviation of the distribution More... | |
count_type | nbrPointsUsed () |
retrieve the number of points used in the statistics More... | |
count_type | nbrUpperOutliers () |
retrieve the number of outliers higher than the distribution used More... | |
count_type | nbrLowerOutliers () |
retrieve the number of outliers lower than the distribution used More... | |
count_type | nbrOutliers () |
retrieve the total number of outliers More... | |
void | reset () |
reset the container More... | |
Private Member Functions | |
void | updateStat () |
update the statistic values More... | |
Private Attributes | |
statistics_t | _stat |
the statistics calculator More... | |
container_type | _container |
container to store the values in More... | |
Type | _mean |
the mean without outliers More... | |
Type | _stdv |
the stdv without outliers More... | |
count_type | _nPoints |
the number of points included in the statistics calculation More... | |
count_type | _nUpperOutliers |
the number of upper outliers More... | |
count_type | _nLowerOutliers |
the number of lower outliers More... | |
bool | _containerChanged |
flag to show whether the statistic values have to be updated More... | |
Type | _snr |
the signal to noise ratio that will detectect outliers More... | |
statistics calculator for a cummulative statistic, removes outliers
class uses the CummulativeStatisticsCalculator to calculate the mean and stdv, but removes the outliers from the statistics.
type | of the values for the average, defines the precision |
Definition at line 157 of file statistics_calculator.hpp.
typedef std::vector<value_type> cass::CummulativeStatisticsNoOutlier< Type >::container_type |
define the type of container used for the values
Definition at line 167 of file statistics_calculator.hpp.
typedef std::iterator_traits<iterator_t>::difference_type cass::CummulativeStatisticsNoOutlier< Type >::count_type |
define number of elements
Definition at line 173 of file statistics_calculator.hpp.
typedef container_type::iterator cass::CummulativeStatisticsNoOutlier< Type >::iterator_t |
define a const iterator of the container
Definition at line 170 of file statistics_calculator.hpp.
typedef CummulativeStatisticsCalculator<value_type> cass::CummulativeStatisticsNoOutlier< Type >::statistics_t |
define the statistics
Definition at line 164 of file statistics_calculator.hpp.
typedef Type cass::CummulativeStatisticsNoOutlier< Type >::value_type |
define the value type
Definition at line 161 of file statistics_calculator.hpp.
|
inline |
constructor sets the signal to noise ratio
snr | the signal to noise ratio to detect outliers |
Definition at line 179 of file statistics_calculator.hpp.
|
inline |
add a datum to the container
datum | The datum to be added |
Definition at line 187 of file statistics_calculator.hpp.
References cass::CummulativeStatisticsNoOutlier< Type >::_container, and cass::CummulativeStatisticsNoOutlier< Type >::_containerChanged.
Referenced by cass::CummulativeStatisticsNoOutlier< Type >::addDistribution(), cass::MedianCalculator< Type >::addDistribution(), cass::pp208::getBoxStatistics(), and cass::pp330::process().
|
inline |
add a number of dati to the distribution
Adds all elements between first and last to the distribution, but not the last
first | The first in the range to be added |
last | The element after last to be added |
Definition at line 202 of file statistics_calculator.hpp.
References cass::CummulativeStatisticsNoOutlier< Type >::addDatum().
Referenced by cass::pp333::meanCalc(), and cass::pp330::setBadPixMap().
|
inline |
retrieve the mean of the distribution without outliers
Definition at line 222 of file statistics_calculator.hpp.
References cass::CummulativeStatisticsNoOutlier< Type >::_mean, and cass::CummulativeStatisticsNoOutlier< Type >::updateStat().
Referenced by cass::MovingStatisticsCalculator< Type >::addDatum(), cass::pp333::meanCalc(), cass::pp330::process(), cass::pp208::process(), and cass::pp330::setBadPixMap().
|
inline |
retrieve the number of outliers lower than the distribution used
Definition at line 262 of file statistics_calculator.hpp.
References cass::CummulativeStatisticsNoOutlier< Type >::_nLowerOutliers, and cass::CummulativeStatisticsNoOutlier< Type >::updateStat().
Referenced by cass::CummulativeStatisticsNoOutlier< Type >::nbrOutliers().
|
inline |
retrieve the total number of outliers
Definition at line 272 of file statistics_calculator.hpp.
References cass::CummulativeStatisticsNoOutlier< Type >::nbrLowerOutliers(), and cass::CummulativeStatisticsNoOutlier< Type >::nbrUpperOutliers().
|
inline |
retrieve the number of points used in the statistics
Definition at line 242 of file statistics_calculator.hpp.
References cass::CummulativeStatisticsNoOutlier< Type >::_nPoints, and cass::CummulativeStatisticsNoOutlier< Type >::updateStat().
Referenced by cass::pp208::isNotHighest(), and cass::pp330::process().
|
inline |
retrieve the number of outliers higher than the distribution used
Definition at line 252 of file statistics_calculator.hpp.
References cass::CummulativeStatisticsNoOutlier< Type >::_nUpperOutliers, and cass::CummulativeStatisticsNoOutlier< Type >::updateStat().
Referenced by cass::pp208::isNotHighest(), cass::CummulativeStatisticsNoOutlier< Type >::nbrOutliers(), and cass::pp208::process().
|
inline |
reset the container
Definition at line 278 of file statistics_calculator.hpp.
References cass::CummulativeStatisticsNoOutlier< Type >::_container, and cass::CummulativeStatisticsNoOutlier< Type >::_containerChanged.
Referenced by cass::pp208::isNotHighest(), cass::MedianCalculator< Type >::MedianCalculator(), and cass::MovingStatisticsCalculator< Type >::MovingStatisticsCalculator().
|
inline |
substitute the internal container with an outside one
distribution | The external container |
Definition at line 212 of file statistics_calculator.hpp.
References cass::CummulativeStatisticsNoOutlier< Type >::_container, cass::CummulativeStatisticsNoOutlier< Type >::_containerChanged, and distribution.
|
inline |
retrieve the standart deviation of the distribution
Definition at line 232 of file statistics_calculator.hpp.
References cass::CummulativeStatisticsNoOutlier< Type >::_stdv, and cass::CummulativeStatisticsNoOutlier< Type >::updateStat().
Referenced by cass::pp330::process(), cass::pp208::process(), cass::pp330::setBadPixMap(), and cass::MovingStatisticsCalculator< Type >::stdv().
|
inlineprivate |
update the statistic values
first calculate the mean and stdv of the container. Then remove outliers and reacalculate the mean and stdv. Do this until no outliers are present in the remaining distribution.
outliers have been detected when the low and up iterators have changed
Definition at line 293 of file statistics_calculator.hpp.
References cass::CummulativeStatisticsNoOutlier< Type >::_container, cass::CummulativeStatisticsNoOutlier< Type >::_containerChanged, cass::CummulativeStatisticsNoOutlier< Type >::_mean, cass::CummulativeStatisticsNoOutlier< Type >::_nLowerOutliers, cass::CummulativeStatisticsNoOutlier< Type >::_nPoints, cass::CummulativeStatisticsNoOutlier< Type >::_nUpperOutliers, cass::CummulativeStatisticsNoOutlier< Type >::_snr, cass::CummulativeStatisticsNoOutlier< Type >::_stat, cass::CummulativeStatisticsNoOutlier< Type >::_stdv, cass::CummulativeStatisticsCalculator< Type >::addDistribution(), cass::CummulativeStatisticsCalculator< Type >::mean(), cass::CummulativeStatisticsCalculator< Type >::reset(), and cass::CummulativeStatisticsCalculator< Type >::stdv().
Referenced by cass::CummulativeStatisticsNoOutlier< Type >::mean(), cass::CummulativeStatisticsNoOutlier< Type >::nbrLowerOutliers(), cass::CummulativeStatisticsNoOutlier< Type >::nbrPointsUsed(), cass::CummulativeStatisticsNoOutlier< Type >::nbrUpperOutliers(), and cass::CummulativeStatisticsNoOutlier< Type >::stdv().
|
private |
container to store the values in
Definition at line 338 of file statistics_calculator.hpp.
Referenced by cass::CummulativeStatisticsNoOutlier< Type >::addDatum(), cass::MedianCalculator< Type >::addDatum(), cass::MedianCalculator< Type >::median(), cass::CummulativeStatisticsNoOutlier< Type >::reset(), cass::MedianCalculator< Type >::reset(), cass::CummulativeStatisticsNoOutlier< Type >::setDistribution(), and cass::CummulativeStatisticsNoOutlier< Type >::updateStat().
|
private |
flag to show whether the statistic values have to be updated
Definition at line 356 of file statistics_calculator.hpp.
Referenced by cass::CummulativeStatisticsNoOutlier< Type >::addDatum(), cass::CummulativeStatisticsNoOutlier< Type >::reset(), cass::CummulativeStatisticsNoOutlier< Type >::setDistribution(), and cass::CummulativeStatisticsNoOutlier< Type >::updateStat().
|
private |
the mean without outliers
Definition at line 341 of file statistics_calculator.hpp.
Referenced by cass::MovingStatisticsCalculator< Type >::addDatum(), cass::CummulativeStatisticsNoOutlier< Type >::mean(), cass::MovingStatisticsCalculator< Type >::mean(), cass::MovingStatisticsCalculator< Type >::reset(), and cass::CummulativeStatisticsNoOutlier< Type >::updateStat().
|
private |
the number of lower outliers
Definition at line 353 of file statistics_calculator.hpp.
Referenced by cass::CummulativeStatisticsNoOutlier< Type >::nbrLowerOutliers(), and cass::CummulativeStatisticsNoOutlier< Type >::updateStat().
|
private |
the number of points included in the statistics calculation
Definition at line 347 of file statistics_calculator.hpp.
Referenced by cass::CummulativeStatisticsNoOutlier< Type >::nbrPointsUsed(), and cass::CummulativeStatisticsNoOutlier< Type >::updateStat().
|
private |
the number of upper outliers
Definition at line 350 of file statistics_calculator.hpp.
Referenced by cass::CummulativeStatisticsNoOutlier< Type >::nbrUpperOutliers(), and cass::CummulativeStatisticsNoOutlier< Type >::updateStat().
|
private |
the signal to noise ratio that will detectect outliers
Definition at line 359 of file statistics_calculator.hpp.
Referenced by cass::CummulativeStatisticsNoOutlier< Type >::updateStat().
|
private |
the statistics calculator
Definition at line 335 of file statistics_calculator.hpp.
Referenced by cass::CummulativeStatisticsNoOutlier< Type >::updateStat().
|
private |
the stdv without outliers
Definition at line 344 of file statistics_calculator.hpp.
Referenced by cass::MovingStatisticsCalculator< Type >::addDatum(), cass::MovingStatisticsCalculator< Type >::reset(), cass::CummulativeStatisticsNoOutlier< Type >::stdv(), cass::CummulativeStatisticsNoOutlier< Type >::updateStat(), and cass::MovingStatisticsCalculator< Type >::variance().