mcmc-0.7.0.1: Sample from a posterior using Markov chain Monte Carlo
Copyright2021 Dominik Schrempf
LicenseGPL-3.0-or-later
Maintainerdominik.schrempf@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
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 k Source #

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

Instances

Instances details
Eq k => Eq (Acceptance k) Source # 
Instance details

Defined in Mcmc.Acceptance

Methods

(==) :: Acceptance k -> Acceptance k -> Bool #

(/=) :: Acceptance k -> Acceptance k -> Bool #

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

Defined in Mcmc.Acceptance

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

Defined in Mcmc.Acceptance

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

Defined in Mcmc.Acceptance

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

In the beginning there was the Word.

Initialize an empty storage of accepted/rejected values.

pushAccept :: Ord k => k -> Acceptance k -> Acceptance k Source #

For key k, add an accept.

pushReject :: Ord k => k -> Acceptance k -> Acceptance k Source #

For key k, add a reject.

pushAcceptanceCounts :: Ord k => k -> AcceptanceCounts -> Acceptance k -> Acceptance k Source #

For key k, add acceptance counts.

resetA :: Ord k => Acceptance k -> Acceptance k Source #

Reset acceptance storage.

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

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

acceptanceRate :: Ord k => k -> Acceptance k -> Maybe (Int, Int, AcceptanceRate) Source #

Acceptance counts and rate for a specific proposal.

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

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

Acceptance rates for all proposals.

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