statistics 0.16.0.2 → 0.16.1.0
raw patch · 8 files changed
+32/−39 lines, 8 filesdep +paralleldep −monad-par
Dependencies added: parallel
Dependencies removed: monad-par
Files
- Statistics/Distribution.hs +3/−3
- Statistics/Distribution/Poisson/Internal.hs +1/−1
- Statistics/Resampling/Bootstrap.hs +2/−13
- Statistics/Sample.hs +1/−1
- benchmark/bench.hs +1/−1
- changelog.md +15/−10
- statistics.cabal +3/−4
- tests/Tests/Distribution.hs +6/−6
Statistics/Distribution.hs view
@@ -47,7 +47,7 @@ class Distribution d where -- | Cumulative distribution function. The probability that a -- random variable /X/ is less or equal than /x/,- -- i.e. P(/X/≤/x/). Cumulative should be defined for+ -- i.e. P(/X/≤/x/). Cumulative should be defined for -- infinities as well: -- -- > cumulative d +∞ = 1@@ -84,14 +84,14 @@ class Distribution d => ContDistr d where -- | Probability density function. Probability that random -- variable /X/ lies in the infinitesimal interval- -- [/x/,/x+/δ/x/) equal to /density(x)/⋅δ/x/+ -- [/x/,/x+/δ/x/) equal to /density(x)/⋅δ/x/ density :: d -> Double -> Double density d = exp . logDensity d -- | Natural logarithm of density. logDensity :: d -> Double -> Double logDensity d = log . density d -- | Inverse of the cumulative distribution function. The value- -- /x/ for which P(/X/≤/x/) = /p/. If probability is outside+ -- /x/ for which P(/X/≤/x/) = /p/. If probability is outside -- of [0,1] range function should call 'error' quantile :: d -> Double -> Double quantile d x = complQuantile d (1 - x)
Statistics/Distribution/Poisson/Internal.hs view
@@ -61,7 +61,7 @@ 1.4189385332046727 + 0.5 * log lambda + zipCoefficients lambda coefficients --- | Returns the average of the upper and lower bounds accounding to+-- | Returns the average of the upper and lower bounds according to -- theorem 2. alyThm2 :: Double -> [Double] -> [Double] -> Double alyThm2 lambda upper lower =
Statistics/Resampling/Bootstrap.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} -- | -- Module : Statistics.Resampling.Bootstrap -- Copyright : (c) 2009, 2011 Bryan O'Sullivan@@ -31,9 +30,7 @@ import qualified Statistics.Resampling as R -#if !defined(__GHCJS__)-import Control.Monad.Par (parMap, runPar)-#endif+import Control.Parallel.Strategies (parMap, rdeepseq) data T = {-# UNPACK #-} !Double :< {-# UNPACK #-} !Double infixl 2 :<@@ -51,15 +48,7 @@ -- this. -> [Estimate ConfInt Double] bootstrapBCA confidenceLevel sample resampledData-#if defined(__GHCJS__)- -- monad-par causes seems to cause "thread blocked indefinitely on MVar"- -- on GHCJS still- --- -- I (phadej) would change the interface to return IO, and use mapConcurrently from async- = map e resampledData-#else- = runPar $ parMap e resampledData-#endif+ = parMap rdeepseq e resampledData where e (est, Bootstrap pt resample) | U.length sample == 1 || isInfinite bias =
Statistics/Sample.hs view
@@ -51,7 +51,7 @@ , fastVarianceUnbiased , fastStdDev - -- * Joint distirbutions+ -- * Joint distributions , covariance , correlation , pair
benchmark/bench.hs view
@@ -16,7 +16,7 @@ sampleW :: U.Vector (Double,Double) sampleW = U.zip sample (U.reverse sample) --- Comlex vector for FFT tests+-- Complex vector for FFT tests sampleC :: U.Vector (Complex Double) sampleC = U.zipWith (:+) sample (U.reverse sample)
changelog.md view
@@ -1,3 +1,8 @@+## Changes in 0.16.1.0++ * Dependency on monad-par is dropped. `parMap` from `parallel` is used instead.++ ## Changes in 0.16.0.2 * Bug in constructor of binomial distribution is fixed (#181). It accepted@@ -27,9 +32,9 @@ * Test suite is finally fixed (#42, #123). It took very-very-very long time but finally happened. - * Avoid loss of precision when computing CDF for exponential districution.+ * Avoid loss of precision when computing CDF for exponential distribution. - * Avoid loss of precision when computing CDF for geometric districution. Add+ * Avoid loss of precision when computing CDF for geometric distribution. Add complement of CDF. * Correctly handle case of n=0 in poissonCI@@ -257,17 +262,17 @@ * Accesors for uniform distribution are added. - * ContGen instances for all continuous distribtuions are added.+ * ContGen instances for all continuous distributions are added. * Beta distribution is added. - * Constructor for improper gamma distribtuion is added.+ * Constructor for improper gamma distribution is added. * Binomial distribution allows zero trials. * Poisson distribution now accept zero parameter. - * Integer overflow in caculation of Wilcoxon-T test is fixed.+ * Integer overflow in calculation of Wilcoxon-T test is fixed. * Bug in 'ContGen' instance for normal distribution is fixed. @@ -308,7 +313,7 @@ * Root finding is added, in S.Math.RootFinding. * The complCumulative function is added to the Distribution- class in order to accurately assess probalities P(X>x) which are+ class in order to accurately assess probabilities P(X>x) which are used in one-tailed tests. * A stdDev function is added to the Variance class for@@ -323,7 +328,7 @@ * Bugs in quantile estimations for chi-square and gamma distribution are fixed. - * Integer overlow in mannWhitneyUCriticalValue is fixed. It+ * Integer overflow in mannWhitneyUCriticalValue is fixed. It produced incorrect critical values for moderately large samples. Something around 20 for 32-bit machines and 40 for 64-bit ones.@@ -345,18 +350,18 @@ * Mean and variance for gamma distribution are fixed. - * Much faster cumulative probablity functions for Poisson and+ * Much faster cumulative probability functions for Poisson and hypergeometric distributions. * Better density functions for gamma and Poisson distributions. * Student-T, Fisher-Snedecor F-distributions and Cauchy-Lorentz- distrbution are added.+ distribution are added. * The function S.Function.create is removed. Use generateM from the vector package instead. - * Function to perform approximate comparion of doubles is added to+ * Function to perform approximate comparison of doubles is added to S.Function.Comparison * Regularized incomplete beta function and its inverse are added to
statistics.cabal view
@@ -1,5 +1,5 @@ name: statistics-version: 0.16.0.2+version: 0.16.1.0 synopsis: A library of statistical types, data, and functions description: This library provides a number of common functions and types useful@@ -120,14 +120,13 @@ , binary >= 0.5.1.0 , primitive >= 0.3 , dense-linear-algebra >= 0.1 && <0.2+ , parallel >= 3.2.2.0 && <3.3 , vector >= 0.10 , vector-algorithms >= 0.4 , vector-th-unbox , vector-binary-instances >= 0.2.1 , data-default-class >= 0.1.2- if !impl(ghcjs)- build-depends:- monad-par >= 0.3.4+ -- Older GHC if impl(ghc < 7.6) build-depends:
tests/Tests/Distribution.hs view
@@ -166,9 +166,9 @@ -- -- > CDF(i) - CDF(i-e) = P(i) --- -- Apporixmate equality is tricky here. Scale is set by maximum- -- value of CDF and probability. Case when all proabilities are- -- zero should be trated specially.+ -- Approximate equality is tricky here. Scale is set by maximum+ -- value of CDF and probability. Case when all probabilities are+ -- zero should be treated specially. badN = [ printf "N=%3i p[i]=%g\tp[i+1]=%g\tdP=%g\trelerr=%g" i p p1 dp ((p1-p-dp) / max p1 dp) | i <- [0 .. 100] , let p = cumulative d $ fromIntegral i - 1e-6@@ -277,9 +277,9 @@ $ counterexample (printf "Sum = %g" p2) $ counterexample (printf "Delta = %g" (abs (p1 - p2))) $ abs (p1 - p2) < 3e-10- -- Avoid too large differeneces. Otherwise there is to much to sum+ -- Avoid too large differences. Otherwise there is to much to sum --- -- Absolute difference is used guard againist precision loss when+ -- Absolute difference is used guard against precision loss when -- close values of CDF are subtracted where n = min a b@@ -360,7 +360,7 @@ instance Param ExponentialDistribution instance Param GammaDistribution where -- We lose precision near `incompleteGamma 10` because of error- -- introuced by exp . logGamma. This could only be fixed in+ -- introduced by exp . logGamma. This could only be fixed in -- math-function by implementing gamma prec_quantile_CDF _ = (24,24) prec_logDensity _ = 64