Workspaces


Workspaces are containers on which most of the computations done by the MCMC algorithm are performed. It is not important to know how this work is dealt with internally; however, it is helpful to know what are the entries of the global and local workspace for diffusions, as the output of the call to run! is precisely that:

  • the DiffusionGlobalWorkspace, as well as
  • DiffusionLocalWorkspace for each update.

Global workspaces


Global workspace holds information about the history of the parameters (both accepted and proposed) as well as some standard, already pre-computed statistics about the chain.

DiffusionMCMC.DiffusionGlobalSubworkspaceType
struct DiffusionGlobalSubworkspace{T,TGP,TW,TWn,TX} <: eMCMC.GlobalWorkspace{T}
    P::TGP
    WW::TW
    Wnr::TWn
    XX::TX
end

Convenience sub-workspace that holds

  • P::Vector{<:Vector{<:GuidProp}}: the GuidProp laws [TODO change to PP or PPP]
  • WW::Vector{<:Vector{<:Trajectory}}: the containers for sampling the Wiener noise
  • Wnr::Vector{<:Wiener}: the flags for the Wiener noise
  • XX::Vector{<:Vector{<:Trajectory}}: the containers for sampling the diffusion paths

The outer array corresponds to successive recordings, the inner arrays correspond to successive observations within each recording. Each DiffusionSubworkspace has two DiffusionGlobalSubworkspaces, one for the accepted law/path another for the proposal.

DiffusionGlobalSubworkspace{T}(
    aux_laws, data::AllObservations, tts, args,
) where T

A standard constructor. aux_laws is a list of auxiliary laws (one for each recording), data holds the observations, tts are the time-grids on which to do imputation when sampling and args are additional positional arguments passed to initializers of GuidProp.

source
DiffusionMCMC.DiffusionGlobalWorkspaceType
struct DiffusionGlobalWorkspace{T,SW,SWD,TD,TX} <: eMCMC.GlobalWorkspace{T}
    sub_ws::SW
    sub_ws_diff::SWD
    sub_ws_diff°::SWD
    data::TD
    stats::GenericChainStats{T}
    XX_buffer::TX
    pnames::Vector{Symbol}
end

Global workspace for MCMC problems concerning diffusions.

Arguments

  • sub_ws: GenericGlobalSubworkspace from ExtensibleMCMC that stores info about the parameter chain
  • sub_ws_diff: DiffusionGlobalSubworkspace containers for the accepted diffusion law/paths
  • sub_ws_diff°: DiffusionGlobalSubworkspace containers for the proposed diffusion law/paths
  • data: observations
  • stats::GenericChainStats: generic online statistics for the param chain
  • XX_buffer: cache for saving a chain of paths
  • pnames: a list of parameter names that are being updated
source

Local workspaces


Local workspaces hold information pertinent to particular updates. In particular it collects such information as acceptance history or a history of log-likelihoods.

DiffusionMCMC.DiffusionLocalSubworkspaceType
struct DiffusionLocalSubworkspace{T,TP,TW,TWn,TX,Tz0} <: eMCMC.LocalWorkspace{T}
    ll::Vector{Float64}
    ll_history::Vector{Vector{Float64}}
    P::TP
    WW::TW
    Wnr::TWn
    XX::TX
    z0s::Tz0
end

Convenience sub-workspace that holds

  • ll::Vector{Float64}: computational buffer for log-likelihoods (one for each recording)
  • ll_history::Vector{Vector{Float64}}: history of all log-likelihoods
  • P: appropriately shaped views to containers with GuidProps
  • WW: appropriately shaped views to containers for sampled Wiener process
  • Wnr: list of Wiener flags for each recording
  • XX: appropriately shaped views to containers for sampled diffusion paths
  • z0s: list of white noise for starting points (one for each recording)
source
DiffusionMCMC.DiffusionLocalWorkspaceType
struct DiffusionLocalWorkspace{T,SW,SWD,Tpr,AH} <: eMCMC.LocalWorkspace{T}
    sub_ws::SW
    sub_ws°::SW
    sub_ws_diff::SWD
    sub_ws_diff°::SWD
    xx0_priors::Tpr
    acceptance_history::Vector{AH}
    loc_pnames::LocalUpdtParamNames
    critical_param_change::Vector{Bool}
end

Local workspace for MCMC problems concerning diffusions.

Arguments

  • sub_ws: GenericLocalSubworkspace from ExtensibleMCMC that acts as a local cache for some light parameter computations
  • sub_ws°: same as sub_ws, but concerns the proposed parameter
  • sub_ws_diff: DiffusionLocalSubworkspace, views to containers for the accepted diffusion law/paths
  • sub_ws_diff°: DiffusionLocalSubworkspace, views to containers for the proposed diffusion law/paths
  • xx0_priors: priors over starting points
  • acceptance_history: history of results from the accept/reject Metropolis–Hastings step
  • loc_pnames: various lists of parameter names helping in performing the update in a clean way
  • critical_param_change: a list of flags for whether a given update by itself prompts for recomputation of the guiding term
source