mcmc-0.8.2.0: Sample from a posterior using Markov chain Monte Carlo
Copyright2021 Dominik Schrempf
LicenseGPL-3.0-or-later
Maintainerdominik.schrempf@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Mcmc.Cycle

Contents

Description

Creation date: Thu Jul 8 17:56:03 2021.

Synopsis

Cycles

data Order Source #

Define the order in which Proposals are executed in a Cycle. The total number of Proposals per Cycle may differ between Orders (e.g., compare RandomO and RandomReversibleO).

Constructors

RandomO

Shuffle the Proposals in the Cycle. The Proposals are replicated according to their weights and executed in random order. If a Proposal has weight w, it is executed exactly w times per iteration.

SequentialO

The Proposals are executed sequentially, in the order they appear in the Cycle. Proposals with weight w>1 are repeated immediately w times (and not appended to the end of the list).

RandomReversibleO

Similar to RandomO. However, a reversed copy of the list of shuffled Proposals is appended such that the resulting Markov chain is reversible. Note: the total number of Proposals executed per cycle is twice the number of RandomO.

SequentialReversibleO

Similar to SequentialO. However, a reversed copy of the list of sequentially ordered Proposals is appended such that the resulting Markov chain is reversible.

Instances

Instances details
Show Order Source # 
Instance details

Defined in Mcmc.Cycle

Methods

showsPrec :: Int -> Order -> ShowS #

show :: Order -> String #

showList :: [Order] -> ShowS #

Eq Order Source # 
Instance details

Defined in Mcmc.Cycle

Methods

(==) :: Order -> Order -> Bool #

(/=) :: Order -> Order -> Bool #

data Cycle a Source #

In brief, a Cycle is a list of proposals.

The state of the Markov chain will be logged only after all Proposals in the Cycle have been completed, and the iteration counter will be increased by one. The order in which the Proposals are executed is specified by Order. The default is RandomO.

No proposals with the same name and description are allowed in a Cycle, so that they can be uniquely identified.

cycleFromList :: [Proposal a] -> Cycle a Source #

Create a Cycle from a list of Proposals; use RandomO, but see setOrder.

setOrder :: Order -> Cycle a -> Cycle a Source #

Set the order of Proposals in a Cycle.

data IterationMode Source #

Use all proposals, or use fast proposals only?

Instances

Instances details
Eq IterationMode Source # 
Instance details

Defined in Mcmc.Cycle

prepareProposals :: StatefulGen g m => IterationMode -> Cycle a -> g -> m [Proposal a] Source #

Replicate Proposals according to their weights and possibly shuffle them.

autoTuneCycle :: TuningType -> Acceptances (Proposal a) -> Maybe (Vector a) -> Cycle a -> Cycle a Source #

Calculate acceptance rates and auto tunes the Proposals in the Cycle.

Do not change Proposals that are not tuneable.

Output

summarizeCycle :: IterationMode -> Acceptances (Proposal a) -> Cycle a -> ByteString Source #

Summarize the Proposals in the Cycle. Also report acceptance rates.