-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathResamplingMain.hs
56 lines (45 loc) · 1.67 KB
/
ResamplingMain.hs
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
{-# OPTIONS_GHC -Wall #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
{-# OPTIONS_GHC -fno-warn-missing-methods #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ViewPatterns #-}
module Main ( main ) where
import Resampling
import ResamplingChart
import Diagrams.Prelude
import Diagrams.Backend.CmdLine
import Diagrams.Backend.Cairo.CmdLine
import qualified Data.Vector.Unboxed as U
displayHeader :: FilePath -> Diagram B R2 -> IO ()
displayHeader fn =
mainRender ( DiagramOpts (Just 900) (Just 700) fn
, DiagramLoopOpts False Nothing 0
)
diaNoisyData :: Diagram B R2
diaNoisyData =
diagSamps (zip (map fromIntegral [0..]) (take nObs ys))
(zip (map fromIntegral [0..]) (take nObs ys))
where ys = samples
diaPartEvolve2 :: Diagram B R2
diaPartEvolve2 = diagPartDist2 "Distribution of Particles Over Time"
(blue `withOpacity` 0.2)
(red `withOpacity` 0.5)
(concat (zipWith zip
(map repeat [0..])
xss))
(concat (zipWith zip
(map repeat [0..])
xss))
where
xss = map U.toList $ map snd $ snd runPopSir
main :: IO ()
main = do
displayHeader "diagrams/ResamplingPopGrowth.png" diaNoisyData
putStrLn "Hello"