speedy-slice: Speedy slice sampling.
Speedy slice sampling.
This implementation of the slice sampling algorithm uses
lens as a means to
operate over generic indexed traversable functors, so you can expect it to
work if your target function takes a list, vector, map, sequence, etc. as its
Additionally you can sample over anything that's an instance of both
Variate, which is useful in the case of discrete parameters.
mcmc function that prints a trace to stdout, as well as a
slice transition operator that can be used more generally.
import Numeric.MCMC.Slice import Data.Sequence (Seq, index, fromList) bnn :: Seq Double -> Double bnn xs = -0.5 * (x0 ^ 2 * x1 ^ 2 + x0 ^ 2 + x1 ^ 2 - 8 * x0 - 8 * x1) where x0 = index xs 0 x1 = index xs 1 main :: IO () main = withSystemRandom . asGenIO $ mcmc 10000 1 (fromList [0, 0]) bnn
|Versions [faq]||0.1.0.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.2.0, 0.3.0|
|Dependencies||base (>=4 && <6), lens (==4.*), mcmc-types (>=1.0.1), mwc-probability (>=1.0.1), pipes (==4.*), primitive (>=0.6 && <1.0), transformers (>=0.5 && <1.0) [details]|
|Source repo||head: git clone http://github.com/jtobin/speedy-slice.git|
|Uploaded||by JaredTobin at Mon Dec 19 18:31:36 UTC 2016|
|Distributions||LTSHaskell:0.3.0, NixOS:0.3.0, Stackage:0.3.0|
|Downloads||2521 total (89 in the last 30 days)|
|Rating||(no votes yet) [estimated by rule of succession]|
Docs available [build log]
Last success reported on 2016-12-19 [all 1 reports]
For package maintainers and hackage trustees