mcmc-0.7.0.1: Sample from a posterior using Markov chain Monte Carlo
Copyright2021 Dominik Schrempf
LicenseGPL-3.0-or-later
Safe HaskellNone
LanguageHaskell2010

Mcmc.Chain.Save

Description

 
Synopsis

Documentation

data SavedChain a Source #

Storable values of a Markov chain.

See toSavedChain.

Instances

Instances details
Eq a => Eq (SavedChain a) Source # 
Instance details

Defined in Mcmc.Chain.Save

Methods

(==) :: SavedChain a -> SavedChain a -> Bool #

(/=) :: SavedChain a -> SavedChain a -> Bool #

Show a => Show (SavedChain a) Source # 
Instance details

Defined in Mcmc.Chain.Save

ToJSON a => ToJSON (SavedChain a) Source # 
Instance details

Defined in Mcmc.Chain.Save

FromJSON a => FromJSON (SavedChain a) Source # 
Instance details

Defined in Mcmc.Chain.Save

toSavedChain :: Chain a -> IO (SavedChain a) Source #

Save a chain.

fromSavedChain :: PriorFunction a -> LikelihoodFunction a -> Cycle a -> Monitor a -> SavedChain a -> IO (Chain a) Source #

Load a saved chain.

Perform some safety checks:

Check that the number of proposals is equal.

Recompute and check the prior and likelihood for the last state because the functions may have changed. Of course, we cannot test for the same function, but having the same prior and likelihood at the last state is already a good indicator.

fromSavedChainUnsafe :: PriorFunction a -> LikelihoodFunction a -> Cycle a -> Monitor a -> SavedChain a -> IO (Chain a) Source #

See fromSavedChain but do not perform sanity checks. Useful when restarting a run with changed prior function, likelihood function or proposals.