MCMC


The main object with which the user declares the type of MCMC algorithm to use is

ExtensibleMCMC.MCMCType
mutable struct MCMC
    updates::Vector
    updates_and_decorators::Vector
    backend::MCMCBackend
    schedule::MCMCSchedule
    workspace::GlobalWorkspace
end

A struct for defining a list of updates and specifying the backend algorithm doing the MCMC sampling. Any other functionality is done solely by the internal mechanizms of function the run!.

MCMC(
    updt_and_decor::Vector{<:Union{MCMCUpdate,MCMCUpdateDecorator}};
    backend=GenericMCMCBackend()
)

The main constructor of an MCMC struct. It accepts an array of updates and update decorators updates_and_decorators which together constitute a single MCMC step. Additionally, backend specialized to a particular, overarching MCMC algorithm (if it exists). An example of a backend would be DiffusionMCMCBackend (from the package DiffusionMCMC.jl).

source

The constructor of MCMC accepts a list of updates that de facto define the MCMC algorithm. To learn more about them see the section on update functions.

The main algorithm may by run by passing an instance of MCMC, together with some additional parameters to the function

ExtensibleMCMC.run!Function
run!(
    mcmc::MCMC, num_mcmc_steps, data, θinit, callbacks=Callback[];
    kwargs...
)

The main calling function of this package that initializes, runs and outputs the results of an MCMC sampler for discretely observed stochastic processes.

Arguments

  • mcmc::MCMC: specifies a sequence of updates that constitute a single MCMC step and provides additional info about the MCMC backend algorithm to be used
  • num_mcmc_steps: the total number of MCMC steps
  • data: completely characterizes everything that is known about the observations (including everything known about the underlying dynamics and the way it was collected),
  • θinit: an initial guess for the unknown parameters
  • callbacks: a collection of extra utility functions that do extra work around MCMC sampling.
  • exclude_updates: a standard named argument which lists the update indices and corresponding ranges of MCMC iterations at which given updates are supposed to be omitted.
  • kwargs...: additional named arguments, passed onto initializers of global workspace; they depend on the chosen MCMCBackend
source

The output of run! is a tuple of a global workspace and local workspaces. These can be used to query such objects as a chain of accepted parameters, a chain of proposed parameters, corresponding log-likelihood functions and more. See the section on Workspaces to learn more.