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

Mcmc.Proposal.Generic

Description

Creation date: Thu May 14 20:26:27 2020.

Synopsis

Documentation

genericContinuous Source #

Arguments

:: (ContDistr d, ContGen d) 
=> d

Probability distribution

-> (a -> Double -> a)

Forward operator.

For example, for a multiplicative proposal on one variable the forward operator is (*), so that x * u = y.

-> Maybe (Double -> Double)

Inverse operator.

For example, recip for a multiplicative proposal on one variable, since y * (recip u) = x * u * (recip u) = x.

Required for biased proposals.

-> Maybe (a -> Double -> Jacobian)

Function to compute the absolute value of the determinant of the Jacobian matrix. For example, for a multiplicative proposal on one variable, we have

detJacobian _ u = Exp $ log $ recip u

That is, the determinant of the Jacobian matrix of multiplication is just the reciprocal value of u (with conversion to log domain).

Required for proposals for which absolute value of the determinant of the Jacobian differs from 1.0.

Conversion to log domain is necessary, because some determinants of Jacobians are very small (or large).

-> ProposalSimple a 

Generic function to create proposals for continuous parameters (Double).

genericDiscrete Source #

Arguments

:: (DiscreteDistr d, DiscreteGen d) 
=> d

Probability distribution.

-> (a -> Int -> a)

Forward operator, e.g. (+), so that x + dx = x'.

-> Maybe (Int -> Int)

Inverse operator, e.g., negate, so that x' + (negate dx) = x. Only required for biased proposals.

-> ProposalSimple a 

Generic function to create proposals for discrete parameters (Int).