mschauer / ZigZagBoomerang.jl

Sleek implementations of the ZigZag, Boomerang and other assorted piecewise deterministic Markov processes for Markov Chain Monte Carlo including Sticky PDMPs for variable selection
MIT License
101 stars 7 forks source link

Pass RNG as first argument #78

Open cscherrer opened 3 years ago

cscherrer commented 3 years ago

It would be helpful if methods like

pdmp(∇ϕ, x, θ, T, Flow::ContinuousDynamics; adapt=true,  factor=2.0)

could be replaced with

pdmp(rng::AbstractRNG, ∇ϕ, x, θ, T, Flow::ContinuousDynamics; adapt=true,  factor=2.0)

The standard approach is then to define

pdmp(∇ϕ, x, θ, T, Flow::ContinuousDynamics; adapt=true,  factor=2.0) = pdmp(GLOBAL_RNG, ∇ϕ, x, θ, T, Flow; adapt=adapt,  factor=factor)

so it wouldn't be a breaking change.

mschauer commented 3 years ago

Yeah, planned. I already did half of the changes necessary for that https://github.com/mschauer/ZigZagBoomerang.jl/commit/7c7b57f5ae87b6c283124f1ba1a07382be46da7c