SebaGraz / ZigZagBoomerang.jl

ZigZag, Boomerang and assorted piecewise deterministic Markov processes for MCMC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ZigZagBoomerang

Stable Dev Build Status

Example

See [https://github.com/mschauer/ZigZagBoomerang.jl/tree/master/scripts].

using ZigZagBoomerang

# negative log-density with respect to Lebesgue
ϕ(x) = cos(2pi*x) + x^2/2 # not needed

# gradient of ϕ(x)
∇ϕ(x) = -2*pi*sin(2*π*x) + x

x0, θ0 = randn(), 1.0
T = 100.0

c = 2π # parameter for the upper bound of the Poisson rate, will error if too small

# ZigZag
out1 = ZigZagBoomerang.pdmp(∇ϕ, x0, θ0, T, c, ZigZag())

# Boomerang with refreshment rate 0.5
out2 = ZigZagBoomerang.pdmp(∇ϕ, x0, θ0, T, c, Boomerang(0.5))

Literature

About

ZigZag, Boomerang and assorted piecewise deterministic Markov processes for MCMC

License:MIT License


Languages

Language:Julia 100.0%