turion / rhine

Haskell Functional Reactive Programming framework with type-level clocks
http://hackage.haskell.org/package/rhine
123 stars 21 forks source link

Further features for rhine-bayes #206

Open turion opened 1 year ago

turion commented 1 year ago

Leftovers from https://github.com/turion/rhine/pull/186#issue-1371220322:

reubenharry commented 1 year ago

I implemented what I assume is a Bernoulli process-like thing using ClExcept (i.e. switching at random times from True to False), which seems to work ok. Not sure if that should be in the library too.

turion commented 1 year ago

I implemented what I assume is a Bernoulli process-like thing using ClExcept (i.e. switching at random times from True to False), which seems to work ok. Not sure if that should be in the library too.

That sounds great!

turion commented 1 year ago

Not sure anymore about Bernoulli processes. Isn't that just the same as constMCl $ bernoulli p? I.e. at every tick we throw a coin?

turion commented 1 year ago

Gamma process

Wikipedia says:

The process is a pure-jump increasing Lévy process with intensity measure ν ( x ) = γ x − 1 exp ⁡ ( − λ x ) , for all positive x x. Thus jumps whose size lies in the interval [ x , x + d x ) occur as a Poisson process with intensity ν ( x ) d x .

I'm surprised by the dx. I would have expected the intensity to be simply ν ( x ).

reubenharry commented 1 year ago

Ah, I meant a switching process (don't know the proper name) where a bool value flips its value at random points (but then stays at the same value until the next random point at which it flips).

turion commented 1 year ago

Ok, if the switching is memoryless, then this sounds a lot like a Poisson process where we throw an exception for every event. See https://github.com/turion/rhine/pull/218, it should be possible to implement it using the Poisson process from there, and standard exception throwing.