speedy-slice.cabal (2401B)
1 name: speedy-slice 2 version: 0.3.2 3 synopsis: Speedy slice sampling. 4 homepage: http://github.com/jtobin/speedy-slice 5 license: MIT 6 license-file: LICENSE 7 author: Jared Tobin 8 maintainer: jared@jtobin.ca 9 category: Math 10 build-type: Simple 11 tested-with: GHC == 8.8.3 12 cabal-version: >=1.10 13 description: 14 Speedy slice sampling. 15 . 16 This implementation of the slice sampling algorithm uses 'lens' as a means to 17 operate over generic indexed traversable functors, so you can expect it to 18 work if your target function takes a list, vector, map, sequence, etc. as its 19 argument. 20 . 21 Additionally you can sample over anything that's an instance of both 'Num' and 22 'Variate', which is useful in the case of discrete parameters. 23 . 24 Exports a 'mcmc' function that prints a trace to stdout, a 'chain' function 25 for collecting results in memory, and a 'slice' transition operator that can 26 be used more generally. 27 . 28 > import Numeric.MCMC.Slice 29 > import Data.Sequence (Seq, index, fromList) 30 > 31 > bnn :: Seq Double -> Double 32 > bnn xs = -0.5 * (x0 ^ 2 * x1 ^ 2 + x0 ^ 2 + x1 ^ 2 - 8 * x0 - 8 * x1) where 33 > x0 = index xs 0 34 > x1 = index xs 1 35 > 36 > main :: IO () 37 > main = withSystemRandom . asGenIO $ mcmc 10000 1 (fromList [0, 0]) bnn 38 39 Source-repository head 40 Type: git 41 Location: http://github.com/jtobin/speedy-slice.git 42 43 library 44 default-language: Haskell2010 45 exposed-modules: 46 Numeric.MCMC.Slice 47 build-depends: 48 base >= 4 && < 6 49 , kan-extensions >= 5 && < 6 50 , lens >= 4 && < 6 51 , primitive >= 0.6 && < 1.0 52 , mcmc-types >= 1.0.1 53 , mwc-probability >= 1.0.1 54 , pipes >= 4 && < 5 55 , transformers >= 0.5 && < 1.0 56 57 Test-suite rosenbrock 58 type: exitcode-stdio-1.0 59 hs-source-dirs: test 60 main-is: Rosenbrock.hs 61 default-language: Haskell2010 62 ghc-options: 63 -rtsopts 64 build-depends: 65 base >= 4 && < 6 66 , speedy-slice 67 68 Test-suite bnn 69 type: exitcode-stdio-1.0 70 hs-source-dirs: test 71 main-is: BNN.hs 72 default-language: Haskell2010 73 ghc-options: 74 -rtsopts 75 build-depends: 76 base >= 4 && < 6 77 , containers >= 0.5 && < 0.8 78 , speedy-slice 79