BiBlock


A composite unit that represents a block. It can be used for sampling on a block in a setting of smoothing or inference.

DiffusionMCMCTools.BiBlockType
mutable struct BiBlock{L,TGP,TGPl,TW,TWn,TX}
    b::Block{L,TGP,TGPl,TW,TWn,TX}
    b°::Block{L,TGP,TGPl,TW,TWn,TX}
    ρ::Float64
    accpt_history::Vector{Bool}
end

Composite unit that allows for sampling of a single block. It provides two Blocks: one proposal , one accepted b that can be used for smoothing or inference problems. ρ is a memory parameter of the preconditioned Crank-Nicolson scheme and accpt_history stores the history of accept/reject decisions (useful for MCMC).

function BiBlock(
    sp::SamplingPair,
    range::UnitRange{Int64},
    ρ=0.0,
    last_block=false,
    ll_hist_len=0
)

Base constructor.

source

There are many functions implemented for it.

Imputation of paths


DiffusionMCMCTools.draw_proposal_path!Method
draw_proposal_path!(bb::BiBlock)

Sample a proposal path, compute log-likelihood along the way. Assumes bb.b.XX[1].x[1] is a starting point. Uses preconditioned Crank-Nicolson scheme with memory parameter set as bb.ρ.

source

Accept/reject decision in an MCMC setting


Adjustments made after the accept-reject decision (regardless of what it was)


Adjustments to the containers in case of acceptance of proposals:


Setting up a block


GuidedProposals.set_obs!Method
GP.set_obs!(bb::BiBlock)

Freeze an artificial observation at the terminal point of the block. For a terminal block nothing is done.

source
DiffusionMCMCTools.find_W_for_X!Method
find_W_for_X!(bb::BiBlock)

Find the Wiener process bb.b.WW that reconstructs path bb.b.XX under the accepted law bb.b.PP (possibly including bb.b.P_last).

source

Setting parameters


Missing docstring.

Missing docstring for DiffusionMCMCTools.set_proposal_law!( bb::DiffusionMCMCTools.BiBlock, θ°, pnames, critical_change=DiffusionMCMCTools.is_critical_update(bb, pnames), skip=0 ). Check Documenter's build log for details.

Utility


DiffusionMCMCTools.loglikhd!Method
loglikhd!(b::BiBlock)

Compute the log-likelihood for the accepted block, evaluated at a sampled path and store the result in an internal field ll.

source
DiffusionMCMCTools.loglikhd°!Method
loglikhd°!(b::BiBlock)

Compute the log-likelihood for the proposal block, evaluated at a sampled path and store the result in an internal field ll.

source
Note

As you can see above, BiBlock is the fundamental building block that is used for creating inference and smoothing algorithms. However, as the complexity of these algorithms grow it is useful to use some macro structures that operate on or are defined for multiple BiBlocks. This is precisely what the remaining tools defined in this package are for. Otherwise put, they aim to facilitate writing snippets of code as above in a much more compact and convenient way.