mcmc-0.3.0: Sample from a posterior using Markov chain Monte Carlo
Copyright(c) Dominik Schrempf 2020
LicenseGPL-3.0-or-later
Maintainerdominik.schrempf@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Mcmc.Save

Description

Creation date: Tue Jun 16 10:18:54 2020.

Save and load an MCMC run. It is easy to save and restore the current state and likelihood (or the trace), but it is not feasible to store all the proposals and so on, so they have to be provided again when continuing a run.

Synopsis

Documentation

saveStatus :: ToJSON a => FilePath -> Status a -> IO () Source #

Save a Status to file.

Some important values have to be provided upon restoring the status. See loadStatus.

loadStatus Source #

Arguments

:: FromJSON a 
=> (a -> Log Double)

Prior function.

-> (a -> Log Double)

Likelihood function.

-> Cycle a 
-> Monitor a 
-> Maybe (Cleaner a)

Cleaner, if needed.

-> FilePath

Path of status to load.

-> IO (Status a) 

Load a Status from file.

Important information that cannot be saved and has to be provided again when a chain is restored: - prior function - likelihood function - cleaning function - cycle - monitor

To avoid incomplete continued runs, the .mcmc file is removed after load.