Global sampler

Global sampler

Link to the source files:


The path.jl file exports a type Path and a few functions that apply on such an object.

A Path object encapsulates

Auxiliary type

The type Segment is useful to encapsulate the information contained between two events. It contains:

Auxiliary functions


The simulate.jl file is the main file for the Global Sampler. It contains one main immutable object which contains all of the parameters of the simulation. This is convenient if multiple parameters need to be tested.

A number of default parameters are pre-encoded but some parameters are essential (starting point, starting velocity, etc).

Simulate function

This function should mimic rather closely the original paper. Note in the main loop:

tau = min(bounce.tau, taubd, tauref)

corresponds to finding which action needs to be executed (normal bounce, boundary bounce or refreshment). After this one of three branches is executed:

if tau==bounce.tau
elseif tau==taubd

The first branch corresponds to a bounce against the level set of the log-likelihood, the second to a boundary bounce and third a refreshment.

In the first branch, an explicit call to bounce.dobounce checks whether to thin the event or not. If the time is accepted then the velocity is refreshed otherwise the whole loop is ignored.