-
Notifications
You must be signed in to change notification settings - Fork 1
/
flat-mcmc.cabal
99 lines (91 loc) · 2.86 KB
/
flat-mcmc.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: flat-mcmc
version: 1.5.2
synopsis: Painless general-purpose sampling.
homepage: https://github.com/jtobin/flat-mcmc
license: MIT
license-file: LICENSE
author: Jared Tobin
maintainer: [email protected]
category: Math
build-type: Simple
cabal-version: >= 1.18
tested-with: GHC == 8.6.5
description:
flat-mcmc is a Haskell library for painless, efficient, general-purpose
sampling from continuous distributions.
.
flat-mcmc uses an ensemble sampler that is invariant to affine
transformations of space. It wanders a target probability distribution's
parameter space as if it had been "flattened" or "unstretched" in some sense,
allowing many particles to explore it locally and in parallel.
.
In general this sampler is useful when you want decent performance without
dealing with any tuning parameters or local proposal distributions.
.
flat-mcmc exports an 'mcmc' function that prints a trace to stdout, as well
as a 'flat' transition operator that can be used more generally.
.
> import Numeric.MCMC.Flat
> import qualified Data.Vector.Unboxed as U (unsafeIndex)
>
> rosenbrock :: Particle -> Double
> rosenbrock xs = negate (5 * (x1 - x0 ^ 2) ^ 2 + 0.05 * (1 - x0) ^ 2) where
> x0 = U.unsafeIndex xs 0
> x1 = U.unsafeIndex xs 1
>
> origin :: Ensemble
> origin = ensemble [
> particle [negate 1.0, negate 1.0]
> , particle [negate 1.0, 1.0]
> , particle [1.0, negate 1.0]
> , particle [1.0, 1.0]
> ]
>
> main :: IO ()
> main = withSystemRandom . asGenIO $ mcmc 12500 origin rosenbrock
Source-repository head
Type: git
Location: http://github.com/jtobin/flat-mcmc.git
library
default-language: Haskell2010
hs-source-dirs: lib
ghc-options:
-Wall
exposed-modules:
Numeric.MCMC.Flat
other-modules:
Data.Vector.Extended
build-depends:
base > 4 && < 6
, formatting >= 6 && < 8
, mcmc-types >= 1.0.1 && < 2
, monad-par >= 0.3.4.7 && < 1
, monad-par-extras >= 0.3.3 && < 1
, mwc-probability >= 1.0.1 && < 3
, pipes >= 4 && < 5
, primitive >= 0.6 && < 1
, text >= 1.2 && < 2
, transformers >= 0.2 && < 0.6
, vector >= 0.10 && < 1
Test-suite rosenbrock
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: Rosenbrock.hs
default-language: Haskell2010
ghc-options:
-rtsopts -threaded
build-depends:
base
, flat-mcmc
, vector
Test-suite bnn
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: BNN.hs
default-language: Haskell2010
ghc-options:
-rtsopts -threaded
build-depends:
base
, flat-mcmc
, vector