rhine-bayes-1.1: monad-bayes backend for Rhine
Safe HaskellSafe-Inferred
LanguageHaskell2010

FRP.Rhine.Bayes

Synopsis

Inference methods

runPopulationCl Source #

Arguments

:: forall m cl a b. Monad m 
=> Int

Number of particles

-> (forall x. Population m x -> Population m x)

Resampler (see Population for some standard choices)

-> ClSF (Population m) cl a b

A signal function modelling the stochastic process on which to perform inference. a represents observations upon which the model should condition, using e.g. score. It can also additionally contain hyperparameters. b is the type of estimated current state.

-> ClSF m cl a [(b, Log Double)] 

Run the Sequential Monte Carlo algorithm continuously on a ClSF.

Short standard library of stochastic processes

type StochasticProcess time a = forall m. MonadDistribution m => Behaviour m time a Source #

A stochastic process is a behaviour that uses, as only effect, random sampling.

type StochasticProcessF time a b = forall m. MonadDistribution m => BehaviourF m time a b Source #

Like StochasticProcess, but with a live input.

whiteNoise :: Double -> StochasticProcess td Double Source #

White noise, that is, an independent normal distribution at every time step.

whiteNoiseVarying :: StochasticProcessF td Double Double Source #

Like whiteNoise, that is, an independent normal distribution at every time step.

levy Source #

Arguments

:: (MonadDistribution m, VectorSpace v (Diff td)) 
=> (Diff td -> m v)

The increment function at every time step. The argument is the difference between times.

-> Behaviour m td v 

Construct a Lévy process from the increment between time steps.

wiener Source #

Arguments

:: (MonadDistribution m, Diff td ~ Double) 
=> Diff td

Time scale of variance.

-> Behaviour m td Double 

The Wiener process, also known as Brownian motion.

brownianMotion Source #

Arguments

:: (MonadDistribution m, Diff td ~ Double) 
=> Diff td

Time scale of variance.

-> Behaviour m td Double 

The Wiener process, also known as Brownian motion.

wienerVarying :: Diff td ~ Double => StochasticProcessF td (Diff td) Double Source #

The Wiener process, also known as Brownian motion, with varying variance parameter.

brownianMotionVarying :: Diff td ~ Double => StochasticProcessF td (Diff td) Double Source #

The Wiener process, also known as Brownian motion, with varying variance parameter.

wienerLogDomain Source #

Arguments

:: Diff td ~ Double 
=> Diff td

Time scale of variance

-> StochasticProcess td (Log Double) 

The wiener process transformed to the Log domain, also called the geometric Wiener process.

poissonInhomogeneous :: (MonadDistribution m, Real (Diff td), Fractional (Diff td)) => BehaviourF m td (Diff td) Int Source #

Inhomogeneous Poisson point process, as described in: https://en.wikipedia.org/wiki/Poisson_point_process#Inhomogeneous_Poisson_point_process

  • The input is the inverse of the current rate or intensity. It corresponds to the average duration between two events.
  • The output is the number of events since the last tick.

poissonHomogeneous Source #

Arguments

:: (MonadDistribution m, Real (Diff td), Fractional (Diff td)) 
=> Diff td

The (constant) rate of the process

-> BehaviourF m td () Int 

Like poissonInhomogeneous, but the rate is constant.

gammaInhomogeneous Source #

Arguments

:: (MonadDistribution m, Real (Diff td), Fractional (Diff td), Floating (Diff td)) 
=> Diff td

The scale parameter

-> BehaviourF m td (Diff td) Int 

The Gamma process, https://en.wikipedia.org/wiki/Gamma_process.

The live input corresponds to inverse shape parameter, which is variance over mean.

bernoulliInhomogeneous :: MonadDistribution m => BehaviourF m td Double Bool Source #

The inhomogeneous Bernoulli process, https://en.wikipedia.org/wiki/Bernoulli_process

Throws a coin to a given probability at each tick. The live input is the probability.