Safe Haskell | None |
---|---|
Language | Haskell2010 |
Infering latent variables in graphical models.
Synopsis
- conjugatedBayesRule :: forall f y x z w. (Map Natural f x y, Bilinear f y x, ConjugatedLikelihood f y x z w) => (Natural # Affine f y z x) -> (Natural # w) -> SamplePoint z -> Natural # w
- conjugatedRecursiveBayesianInference :: (Map Natural f x y, Bilinear f y x, ConjugatedLikelihood f y x z w) => (Natural # Affine f y z x) -> (Natural # w) -> Sample z -> [Natural # w]
- conjugatedPredictionStep :: (ConjugatedLikelihood f x x w w, Bilinear f x x) => (Natural # Affine f x w x) -> (Natural # w) -> Natural # w
- conjugatedForwardStep :: (ConjugatedLikelihood g x x w w, Bilinear g x x, ConjugatedLikelihood f y x z w, Bilinear f y x, Map Natural g x x, Map Natural f x y) => (Natural # Affine g x w x) -> (Natural # Affine f y z x) -> (Natural # w) -> SamplePoint z -> Natural # w
- regressConjugationParameters :: (Map Natural f z x, LegendreExponentialFamily z, ExponentialFamily x) => (Natural # f z x) -> Sample x -> (Double, Natural # x)
- conjugationCurve :: ExponentialFamily x => Double -> (Natural # x) -> Sample x -> [Double]
Inference
conjugatedBayesRule :: forall f y x z w. (Map Natural f x y, Bilinear f y x, ConjugatedLikelihood f y x z w) => (Natural # Affine f y z x) -> (Natural # w) -> SamplePoint z -> Natural # w Source #
The posterior distribution given a prior and likelihood, where the likelihood is conjugated.
Recursive
conjugatedRecursiveBayesianInference Source #
:: (Map Natural f x y, Bilinear f y x, ConjugatedLikelihood f y x z w) | |
=> (Natural # Affine f y z x) | Likelihood |
-> (Natural # w) | Prior |
-> Sample z | Observations |
-> [Natural # w] | Updated prior |
The posterior distribution given a prior and likelihood, where the likelihood is conjugated.
Dynamic
conjugatedPredictionStep :: (ConjugatedLikelihood f x x w w, Bilinear f x x) => (Natural # Affine f x w x) -> (Natural # w) -> Natural # w Source #
The predicted distribution given a current distribution and transition distribution, where the transition distribution is (doubly) conjugated.
conjugatedForwardStep Source #
:: (ConjugatedLikelihood g x x w w, Bilinear g x x, ConjugatedLikelihood f y x z w, Bilinear f y x, Map Natural g x x, Map Natural f x y) | |
=> (Natural # Affine g x w x) | Transition Distribution |
-> (Natural # Affine f y z x) | Emission Distribution |
-> (Natural # w) | Beliefs at time $t-1$ |
-> SamplePoint z | Observation at time $t$ |
-> Natural # w | Beliefs at time $t$ |
Forward inference based on conjugated models: priors at a previous time are first predicted into the current time, and then updated with Bayes rule.
Conjugation
regressConjugationParameters Source #
:: (Map Natural f z x, LegendreExponentialFamily z, ExponentialFamily x) | |
=> (Natural # f z x) | PPC |
-> Sample x | Sample points |
-> (Double, Natural # x) | Approximate conjugation parameters |
Returns the conjugation parameters which best satisfy the conjugation equation for the given population code according to linear regression.