affine-invariant-ensemble-mcmc-0.1.0.0: General-purpose sampling

Safe HaskellSafe-Infered

Numeric.MCMC.Util

Description

Various internal utilities.

Synopsis

Documentation

genDiffInt :: PrimMonad m => Int -> (Int, Int) -> Gen (PrimState m) -> m IntSource

Given Int, bounds, and generator, generate a different Int in the bound.

mean :: [Double] -> DoubleSource

Tail-recursive, list-fused mean function.

mapPair :: (a -> b) -> (a, a) -> (b, b)Source

Map a function over a pair.

shortListToPair :: [a] -> (a, a)Source

Convert a list to a pair.

shuffle :: [a] -> Seed -> [a]Source

Knuth-shuffle a list. Uses Seq internally.

sample :: Int -> [a] -> Seed -> [a]Source

Sample from a list without replacement.