h$)'#       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Copyright (c) 2010,2017, Alexey Khudyakov BSD3,Alexey Khudyakov  experimentalNone356789<>monoid-statistics>Strict pair. It allows to calculate two statistics in parallelmonoid-statistics:Exception which is thrown when we can't compute some valuemonoid-statisticsEmptySample function: We're trying to compute quantity that is undefined for empty sample.monoid-statistics!InvalidSample function descripton quantity in question could not be computed for some other reasonmonoid-statisticsIdentity monad which is used to encode partial functions for  based error handling. Its  MonadThrow* instance just throws normal exception. monoid-statisticsSame as  but never failsmonoid-statisticsValues from which we can efficiently compute estimate of sample variance or distribution variance. It has two methods: one which applies bias correction to estimate and another that returns maximul likelyhood estimate. For distribution they should return same value.monoid-statistics Assumed O(1)) Calculate unbiased estimate of variance:7 \sigma^2 = \frac{1}{N-1}\sum_{i=1}^N(x_i - \bar{x})^2 monoid-statistics Assumed O(1)3 Calculate maximum likelihood estimate of variance:5 \sigma^2 = \frac{1}{N}\sum_{i=1}^N(x_i - \bar{x})^2 monoid-statisticsCalculate sample standard deviation from unbiased estimation of variance.monoid-statisticsCalculate sample standard deviation from maximum likelihood estimation of variance.monoid-statisticsSame as  but should never failmonoid-statisticsValue from which we can efficiently calculate mean of sample or distribution.monoid-statistics Assumed O(1) Returns Nothing if there isn't enough data to make estimate or distribution doesn't have defined mean.( \bar{x} = \frac{1}{N}\sum_{i=1}^N{x_i} monoid-statisticsValue from which we can efficiently extract number of elements in sample it represents.monoid-statistics Assumed O(1). Number of elements in sample.monoid-statisticsThis type class is used to express parallelizable constant space algorithms for calculation of statistics.  Statistic is function of type [a]Cb which does not depend on order of elements. (for example: mean, sum, number of elements, variance, etc).For many statistics it's possible to possible to construct constant space algorithm which is expressed as fold. Additionally it's usually possible to write function which combine state of fold accumulator to get statistic for union of two samples.Thus for such algorithm we have value which corresponds to empty sample, function which which corresponds to merging of two samples, and single step of fold. Last one allows to evaluate statistic given data sample and first two form a monoid and allow parallelization: split data into parts, build estimate for each by folding and then merge them using mappend.Instance must satisfy following laws. If floating point arithmetics is used then equality should be understood as approximate. 1. addValue (addValue y mempty) x == addValue mempty x <> addValue mempty y 2. x <> y == y <> xmonoid-statistics9Add one element to monoid accumulator. It's step of fold.monoid-statistics7State of accumulator corresponding to 1-element sample.monoid-statisticsCalculate statistic over . It's implemented in terms of foldl'. Note that in cases when accumulator is immediately consumed by polymorphic function such as callMeam its type becomes ambiguous. TypeApplication' then could be used to disambiguate.reduceSample @Mean [1,2,3,4]MeanKBN 4 (KBNSum 10.0 0.0)7calcMean $ reduceSample @Mean [1,2,3,4] :: Maybe DoubleJust 2.5monoid-statistics7Calculate statistic over vector. Works in same was as  but works for vectors.monoid-statisticsConvert error to IO exception. This way one could for example convert case when some statistics is not defined to an exception: calcMean $ reduceSample @Mean []*** Exception: EmptySample "Data.Monoid.Statistics.Numeric.MeanKBN: calcMean"  None38>?&Emonoid-statisticsIncremental calculation of mean. Note that this algorithm doesn't offer better numeric precision than plain summation. Its only advantage is protection against double overflow:calcMean $ reduceSample @MeanKBN (replicate 100 1e308) :: Maybe DoubleJust NaNcalcMean $ reduceSample @WelfordMean (replicate 100 1e308) :: Maybe Double Just 1.0e308Unless this feature is needed = should be used. Algorithm is due to Welford [Welford1962]) s_n = s_{n-1} + \frac{x_n - s_{n-1}}{n} Gmonoid-statisticsIncremental calculation of mean. Sum of elements is calculated using compensated Kahan summation. It's provided only for sake of completeness.  should be used instead.Imonoid-statisticsIncremental calculation of mean which uses second-order compensated Kahan-Babuka summation. In most cases $ should provide enough precision.Mmonoid-statisticsType restricted  EFGHIJKLM EFMGHLIJKNone&35678>?!lmonoid-statisticsValue a weighted by weight wnmonoid-statistics Accumulator for binomial trials.rmonoid-statisticsCalculate maximum of sample. For empty sample returns NaN. Any NaN encountered will be ignored.umonoid-statisticsCalculate minimum of sample of Doubles. For empty sample returns NaN. Any NaN encountered will be ignored.xmonoid-statisticsCalculate maximum of sample{monoid-statisticsCalculate minimum of sample~monoid-statisticsIncremental algorithms for calculation the standard deviation [Chan1979].monoid-statisticsIncremental calculation of weighed mean. Sum of both weights and elements is calculated using Kahan-Babuka-Neumaier summation.monoid-statistics(Incremental calculation of weighed mean.monoid-statisticsIncremental calculation of mean. It tracks separately number of elements and running sum. It uses algorithm for compensated summation which works with mantissa of double size at cost of doing more operations. This means that it's usually possible to compute sum (and therefore mean) within 1 ulp.monoid-statisticsIncremental calculation of mean. It tracks separately number of elements and running sum. Note that summation of floating point numbers loses precision and genrally use  is recommended.monoid-statisticsType alias for currently recommended algorithms for calculation of weighted mean. It should be default choicemonoid-statisticsType alias for currently recommended algorithms for calculation of mean. It should be default choicemonoid-statistics+Calculate number of elements in the sample.monoid-statisticsType restricted monoid-statisticsType restricted 'id 'monoid-statisticsType restricted +lmnopqrstuvwxyz{|}~+~xyz{|}rstuvwnopqlmCopyright (c) 2010, Alexey Khudyakov BSD3,Alexey Khudyakov  experimentalNone" lmnopqrstuvwxyz{|}~        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHHIIJJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijkllmmnoppqrrsttuvvwxxyyzz{{||}~.monoid-statistics-1.1.2-1Pyy53mqVGcBuwCRPlEFIlData.Monoid.Statistics.ClassData.Monoid.Statistics.ExtraData.Monoid.Statistics.NumericKBNSumData.Monoid.StatisticsPair SampleError EmptySample InvalidSamplePartial CalcViaHas HasVariance getVariance getVarianceML getStddev getStddevML CalcVariance calcVariancecalcVarianceML calcStddev calcStddevMLHasMeangetMeanCalcMeancalcMean CalcCount calcCount StatMonoidaddValuesingletonMonoid reduceSamplereduceSampleVecpartial$fStatMonoidKB2Suma$fStatMonoidKBNSuma$fStatMonoidKahanSuma$fStatMonoidProducta'$fStatMonoidSuma'$fStatMonoid(,,,)a$fStatMonoid(,,)a$fStatMonoid(,)a$fCalcVarianceCalcViaHas$fCalcMeanCalcViaHas$fMonadThrowPartial$fMonadPartial$fApplicativePartial$fFunctorPartial$fExceptionSampleError$fStatMonoidPairx $fMonoidPair$fSemigroupPair$fStatMonoidPPair(,) $fMonoidPPair$fSemigroupPPair $fShowPair$fEqPair $fOrdPair $fDataPair $fGenericPair$fShowSampleError $fShowPartial $fReadPartial $fEqPartial $fOrdPartial $fDataPartial$fGenericPartial$fHasMeanCalcViaHas$fHasVarianceCalcViaHas$fVectorVectorPair$fMVectorMVectorPair $fUnboxPair WelfordMean MeanKahanMeanKB2 asMeanKB2 asMeanKahan asWelfordMean$fCalcMeanMeanKB2$fStatMonoidMeanKB2a$fMonoidMeanKB2$fSemigroupMeanKB2$fCalcMeanMeanKahan$fCalcCountMeanKahan$fStatMonoidMeanKahana$fMonoidMeanKahan$fSemigroupMeanKahan$fCalcMeanWelfordMean$fCalcCountWelfordMean$fStatMonoidWelfordMeana$fMonoidWelfordMean$fSemigroupWelfordMean$fShowWelfordMean$fEqWelfordMean$fDataWelfordMean$fGenericWelfordMean$fShowMeanKahan $fEqMeanKahan$fDataMeanKahan$fGenericMeanKahan $fShowMeanKB2 $fEqMeanKB2$fVectorVectorMeanKahan$fMVectorMVectorMeanKahan$fUnboxMeanKahan$fVectorVectorWelfordMean$fMVectorMVectorWelfordMean$fUnboxWelfordMeanWeightedBinomAccbinomAccSuccess binomAccTotalMaxDcalcMaxDMinDcalcMinDMaxcalcMaxMincalcMinVarianceWMeanKBN WMeanNaiveMeanKBN MeanNaiveWMeanMeanCountCountG calcCountNasCountasMeanasWMean asMeanNaive asMeanKBN asWMeanNaive asWMeanKBN asVariance asBinomAcc$fCalcCountCountG$fStatMonoidCountGb$fMonoidCountG$fSemigroupCountG$fCalcMeanMeanNaive$fCalcCountMeanNaive$fStatMonoidMeanNaivea$fMonoidMeanNaive$fSemigroupMeanNaive$fCalcMeanMeanKBN$fCalcCountMeanKBN$fStatMonoidMeanKBNa$fMonoidMeanKBN$fSemigroupMeanKBN$fCalcMeanWMeanNaive$fMonoidWMeanNaive$fSemigroupWMeanNaive$fCalcMeanWMeanKBN$fMonoidWMeanKBN$fSemigroupWMeanKBN$fCalcVarianceVariance$fCalcMeanVariance$fCalcCountVariance$fStatMonoidVariancea$fMonoidVariance$fSemigroupVariance$fStatMonoidMina' $fMonoidMin$fSemigroupMin$fStatMonoidMaxa' $fMonoidMax$fSemigroupMax$fStatMonoidMinDa $fMonoidMinD$fSemigroupMinD$fEqMinD$fStatMonoidMaxDa $fMonoidMaxD$fSemigroupMaxD$fEqMaxD$fStatMonoidBinomAccBool$fMonoidBinomAcc$fSemigroupBinomAcc$fStatMonoidWMeanKBNWeighted$fStatMonoidWMeanNaiveWeighted$fShowWeighted $fEqWeighted $fOrdWeighted$fDataWeighted$fGenericWeighted$fFunctorWeighted$fFoldableWeighted$fTraversableWeighted$fShowBinomAcc $fEqBinomAcc $fOrdBinomAcc$fDataBinomAcc$fGenericBinomAcc $fShowMaxD $fDataMaxD $fGenericMaxD $fShowMinD $fDataMinD $fGenericMinD $fShowMax$fEqMax$fOrdMax $fDataMax $fGenericMax $fShowMin$fEqMin$fOrdMin $fDataMin $fGenericMin$fShowVariance $fEqVariance$fShowWMeanKBN $fEqWMeanKBN$fDataWMeanKBN$fGenericWMeanKBN$fShowWMeanNaive$fEqWMeanNaive$fDataWMeanNaive$fGenericWMeanNaive $fShowMeanKBN $fEqMeanKBN $fDataMeanKBN$fGenericMeanKBN$fShowMeanNaive $fEqMeanNaive$fDataMeanNaive$fGenericMeanNaive $fShowCountG $fEqCountG $fOrdCountG$fVectorVectorCountG$fMVectorMVectorCountG $fUnboxCountG$fVectorVectorMeanNaive$fMVectorMVectorMeanNaive$fUnboxMeanNaive$fVectorVectorMeanKBN$fMVectorMVectorMeanKBN$fUnboxMeanKBN$fVectorVectorWMeanNaive$fMVectorMVectorWMeanNaive$fUnboxWMeanNaive$fVectorVectorWMeanKBN$fMVectorMVectorWMeanKBN$fUnboxWMeanKBN$fVectorVectorVariance$fMVectorMVectorVariance$fUnboxVariance$fVectorVectorMinD$fMVectorMVectorMinD $fUnboxMinD$fVectorVectorMaxD$fMVectorMVectorMaxD $fUnboxMaxD$fVectorVectorWeighted$fMVectorMVectorWeighted$fUnboxWeighted$fVectorVectorBinomAcc$fMVectorMVectorBinomAcc$fUnboxBinomAccexceptions-0.10.4Control.Monad.Catch MonadThrowbase Data.FoldableFoldableGHC.Baseid