Copyright | 2021 Dominik Schrempf |
---|---|
License | GPL-3.0-or-later |
Maintainer | dominik.schrempf@gmail.com |
Stability | unstable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Creation date: Thu May 14 20:26:27 2020.
Synopsis
- genericContinuous :: (ContDistr d, ContGen d) => d -> (a -> Double -> a) -> Maybe (Double -> Double) -> Maybe (a -> Double -> Jacobian) -> PFunction a
- genericDiscrete :: (DiscreteDistr d, DiscreteGen d) => d -> (a -> Int -> a) -> Maybe (Int -> Int) -> PFunction a
Documentation
:: (ContDistr d, ContGen d) | |
=> d | Probability distribution |
-> (a -> Double -> a) | Forward operator \(\odot\). For example, for a multiplicative proposal on one variable the forward
operator is |
-> Maybe (Double -> Double) | Inverse operator \(g\) of the auxiliary variable. For example, 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 Required for proposals for which the 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). |
-> PFunction a |
Generic function to create proposals for continuous parameters (e.g.,
Double
).
The procedure is as follows: Let \(\mathbb{X}\) be the state space and \(x\) be the current state.
- Let \(D\) be a continuous probability distribution on \(\mathbb{D}\); sample an auxiliary variable \(epsilon \sim D\).
- Suppose \(\odot : \mathbb{X} \times \mathbb{D} \to \mathbb{X}\). PFunction a new state \(x' = x \odot \epsilon\).
- If the proposal is unbiased, the Metropolis-Hastings-Green ratio can directly be calculated using the posterior function.
- However, if the proposal is biased: Suppose (g : mathbb{D} to mathbb{D}) inverses the auxiliary variable \(\epsilon\) such that (x = x' odot g(epsilon)). Calculate the Metropolis-Hastings-Green ratio using the posterior function, \(g\), \(D\), \(\epsilon\), and possibly a Jacobian function.
:: (DiscreteDistr d, DiscreteGen d) | |
=> d | Probability distribution. |
-> (a -> Int -> a) | Forward operator. For example, (+), so that x + dx = x'. |
-> Maybe (Int -> Int) | Inverse operator \(g\) of the auxiliary variable. For example, Only required for biased proposals. |
-> PFunction a |
Generic function to create proposals for discrete parameters (e.g., Int
).
See genericContinuous
.