Permalink
Browse files

Bump version.

  • Loading branch information...
1 parent 216ddcb commit 0041c7e2a03aa23006daf577c892028e19312a36 @bos committed Sep 26, 2009
Showing with 9 additions and 3 deletions.
  1. +6 −0 Statistics/Function.hs
  2. +2 −2 Statistics/Resampling.hs
  3. +1 −1 statistics.cabal
View
@@ -15,6 +15,7 @@ module Statistics.Function
minMax
, sort
, partialSort
+ , indices
-- * Array setup
, createU
, createIO
@@ -40,6 +41,11 @@ partialSort :: (UA e, Ord e) =>
partialSort k = apply (\a -> I.partialSort a k)
{-# INLINE partialSort #-}
+-- | Return the indices of an array.
+indices :: (UA a) => UArr a -> UArr Int
+indices a = enumFromToU 0 (lengthU a - 1)
+{-# INLINE indices #-}
+
data MM = MM {-# UNPACK #-} !Double {-# UNPACK #-} !Double
-- | Compute the minimum and maximum of an array in one pass.
View
@@ -20,7 +20,7 @@ import Control.Monad (forM_)
import Control.Monad.ST (ST)
import Data.Array.Vector
import Data.Array.Vector.Algorithms.Intro (sort)
-import Statistics.Function (createU)
+import Statistics.Function (createU, indices)
import Statistics.RandomVariate (Gen, uniform)
import Statistics.Types (Estimator, Sample)
@@ -53,7 +53,7 @@ resample gen ests numResamples samples = do
-- | Compute a statistical estimate repeatedly over a sample, each
-- time omitting a successive element.
jackknife :: Estimator -> Sample -> UArr Double
-jackknife est sample = mapU f . enumFromToU 0 . subtract 1 . lengthU $ sample
+jackknife est sample = mapU f . indices $ sample
where f i = est (dropAt i sample)
{-# INLINE jackknife #-}
View
@@ -1,5 +1,5 @@
name: statistics
-version: 0.3.3
+version: 0.3.4
synopsis: A library of statistical types, data, and functions
description:
This library provides a number of common functions and types useful

0 comments on commit 0041c7e

Please sign in to comment.