57 template <
typename RealT =
double>
92 template <
typename ProbabilityIterator,
typename CoordinateIterator>
93 void update(ProbabilityIterator
const probability_begin,
94 ProbabilityIterator
const probability_end,
95 CoordinateIterator
const coordinate_begin)
98 Base::update(probability_begin, probability_end, coordinate_begin);
106 ProbabilityIterator prob_iter = probability_begin;
107 CoordinateIterator coord_iter = coordinate_begin;
108 for (; prob_iter != probability_end; ++prob_iter, ++coord_iter)
111 RealType diff_squared = diff * diff;
115 if (*coord_iter <
mean_)
128 RealType frac = (diff / stdev + 1.) / 2.;
129 RealType prob_frac = frac * *prob_iter;
132 prob_frac = *prob_iter * (1. - frac);
Internal class for asymmetric distributions.
Definition: AsymmetricStatistics.h:60
RealType variance1_
Definition: AsymmetricStatistics.h:144
RealType variance2_
Definition: AsymmetricStatistics.h:144
RealType variance1() const
"variance to the left hand side"
Definition: AsymmetricStatistics.h:80
RealType variance2() const
"variance to the right hand side"
Definition: AsymmetricStatistics.h:86
AsymmetricStatistics()
Default constructor.
Definition: AsymmetricStatistics.h:73
void update(ProbabilityIterator const probability_begin, ProbabilityIterator const probability_end, CoordinateIterator const coordinate_begin)
You can call this as often as you like, using different input vectors.
Definition: AsymmetricStatistics.h:93
RealType variance_
Definition: BasicStatistics.h:263
Base::RealType RealType
Definition: AsymmetricStatistics.h:63
BasicStatistics< RealT > Base
The real type and basic statistics specified as template argument.
Definition: AsymmetricStatistics.h:62
RealType mean_
Definition: BasicStatistics.h:262
Calculates some basic statistical parameters of a distribution: sum, mean, variance,...
Definition: BasicStatistics.h:69
RealT RealType
The real type specified as template argument.
Definition: BasicStatistics.h:74
void update(ProbabilityIterator probability_begin, ProbabilityIterator const probability_end)
This does the actual calculation.
Definition: BasicStatistics.h:113
RealType sum_
Definition: BasicStatistics.h:264
void clear()
Set sum, mean, and variance to zero.
Definition: BasicStatistics.h:103
RealType variance_
Definition: BasicStatistics.h:263
RealType mean_
Definition: BasicStatistics.h:262
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48