-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Sample values from collections.
--   
--   Basic sampling tools.
--   
--   Exports variations on two simple functions for sampling from arbitrary
--   <a>Foldable</a> collections:
--   
--   <ul>
--   <li><a>sample</a>, for sampling without replacement</li>
--   <li><a>resample</a>, for sampling with replacement (i.e., a
--   bootstrap)</li>
--   </ul>
--   
--   Each variation can be prefixed with <a>p</a> to sample from a
--   container of values weighted by probability.
@package sampling
@version 0.3.2

module Numeric.Sampling

-- | (<i>O(n)</i>) Sample uniformly, without replacement.
--   
--   Returns Nothing if the desired sample size is larger than the
--   collection being sampled from.
sample :: (PrimMonad m, Foldable f) => Int -> f a -> Gen (PrimState m) -> m (Maybe [a])

-- | (<i>O(n)</i>) <a>sample</a> specialized to IO.
sampleIO :: Foldable f => Int -> f a -> IO (Maybe [a])

-- | (<i>O(n log n)</i>) Sample uniformly with replacement (bootstrap).
resample :: (PrimMonad m, Foldable f) => Int -> f a -> Gen (PrimState m) -> m [a]

-- | (<i>O(n log n)</i>) <a>resample</a> specialized to IO.
resampleIO :: Foldable f => Int -> f a -> IO [a]

-- | (<i>O(n log n)</i>) Unequal probability sampling.
--   
--   Returns Nothing if the desired sample size is larger than the
--   collection being sampled from.
psample :: (PrimMonad m, Foldable f) => Int -> f (Double, a) -> Gen (PrimState m) -> m (Maybe [a])

-- | (<i>O(n log n)</i>) <a>psample</a> specialized to IO.
psampleIO :: Foldable f => Int -> f (Double, a) -> IO (Maybe [a])

-- | (<i>O(n log n)</i>) Unequal probability resampling.
presample :: (PrimMonad m, Foldable f) => Int -> f (Double, a) -> Gen (PrimState m) -> m [a]

-- | (<i>O(n log n)</i>) <a>presample</a> specialized to IO.
presampleIO :: (Foldable f) => Int -> f (Double, a) -> IO [a]
