commit 17b5f1b632dd101b4fc8c3d840c1f329f52477ee
parent a0649b01979309e2f9d38985d8c3d81ca5881948
Author: Jared Tobin <jared@jtobin.ca>
Date: Tue, 6 Oct 2015 22:31:41 +1300
Add ghc-prim dep.
Diffstat:
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/mighty-metropolis.cabal b/mighty-metropolis.cabal
@@ -10,7 +10,19 @@ category: Numeric
build-type: Simple
cabal-version: >= 1.10
description:
- The Metropolis algorithm.
+ The classic Metropolis algorithm. Wander around parameter space according to a
+ simple spherical Gaussian distribution.
+ .
+ Exports a 'mcmc' function that prints a trace to stdout, as well as a
+ 'metropolis' transition operator that can be used more generally.
+ .
+ > import Numeric.MCMC.Metropolis
+ >
+ > rosenbrock :: [Double] -> Double
+ > rosenbrock [x0, x1] = negate (5 *(x1 - x0 ^ 2) ^ 2 + 0.05 * (1 - x0) ^ 2)
+ >
+ > main :: IO ()
+ > main = withSystemRandom . asGenIO $ mcmc 10000 1 [0, 0] rosenbrock
Source-repository head
Type: git
@@ -24,6 +36,7 @@ library
Numeric.MCMC.Metropolis
build-depends:
base < 5
+ , ghc-prim
, pipes
, primitive
, mcmc-types >= 1.0.1