mcmc-0.8.3.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.Acceptance

Description

Creation date: Thu Jul 8 18:12:07 2021.

Synopsis

Acceptance rates

type AcceptanceRate = Double Source #

Acceptance rate.

data AcceptanceCounts Source #

Number of accepted and rejected proposals.

Constructors

AcceptanceCounts 

Fields

data Acceptance Source #

Stored actual acceptance counts and maybe expected acceptance rates.

data Acceptances k Source #

For each key k, store the number of accepted and rejected proposals.

Instances

Instances details
(Ord k, FromJSONKey k) => FromJSON (Acceptances k) Source # 
Instance details

Defined in Mcmc.Acceptance

ToJSONKey k => ToJSON (Acceptances k) Source # 
Instance details

Defined in Mcmc.Acceptance

Show k => Show (Acceptances k) Source # 
Instance details

Defined in Mcmc.Acceptance

Eq k => Eq (Acceptances k) Source # 
Instance details

Defined in Mcmc.Acceptance

emptyA :: Ord k => [k] -> Acceptances k Source #

In the beginning there was the Word.

Initialize an empty storage of accepted/rejected values.

pushAccept :: Ord k => Maybe AcceptanceRates -> k -> Acceptances k -> Acceptances k Source #

For key k, add an accept.

pushReject :: Ord k => Maybe AcceptanceRates -> k -> Acceptances k -> Acceptances k Source #

For key k, add a reject.

data ResetAcceptance Source #

Reset acceptance specification.

Constructors

ResetEverything

Reset actual acceptance counts and expected acceptance rates.

ResetExpectedRatesOnly

Only reset expected acceptance rates.

resetA :: Ord k => ResetAcceptance -> Acceptances k -> Acceptances k Source #

Reset acceptance counts.

transformKeysA :: (Ord k1, Ord k2) => [(k1, k2)] -> Acceptances k1 -> Acceptances k2 Source #

Transform keys using the given lists. Keys not provided will not be present in the new Acceptance variable.

acceptanceRate Source #

Arguments

:: Ord k 
=> k 
-> Acceptances k 
-> (Int, Int, Maybe AcceptanceRate, Maybe AcceptanceRate)

(nAccepts, nRejects, actualRate, expectedRate)

Compute acceptance counts, and actual and expected acceptances rates for a specific proposal.

Return Just (accepts, rejects, acceptance rate).

Return Nothing if no proposals have been accepted or rejected (division by zero).

acceptanceRates :: Acceptances k -> Map k (Maybe AcceptanceRate) Source #

Compute actual acceptance rates for all proposals.

Set rate to Nothing if no proposals have been accepted or rejected (division by zero).