module TimeSeries.Plot where
import TimeSeries.Utils
rho09_100000 :: IO ()
rho09_100000 = rho09 "data/correlated-walks_rho09_n100000_k5.csv"
rho09_10000 :: IO ()
rho09_10000 = rho09 "data/correlated-walks_rho09_n10000_k5.csv"
rho09 :: FilePath -> IO ()
rho09 path = do
csvData <- readFile path
let csvValues = tail $ lines csvData
f [t,v1,v2,v3,v4,v5] =
let t' = filter (/= '"') t
in unlines
[ unwords [t', "=V1", v1]
, unwords [t', "=V2", v2]
, unwords [t', "=V3", v3]
, unwords [t', "=V4", v4]
, unwords [t', "=V5", v5]
]
f _ = error "malformed input"
res = unlines . map (f . comma) $ csvValues
writeFile "rho09.tmp" res