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