Block
A smallest unit that is needed for blocking.
DiffusionMCMCTools.Block — Typemutable struct Block{L,TGP,TGPl,TW,TWn,TX}
PP::TVIEW{TGP}
P_last::TVIEW{TGPl} # view into a single element
WW::TVIEW{TW}
Wnr::TWn
XX::TVIEW{TX}
ll::Float64
ll_history::Vector{Float64}
endThe smallest "containerless" unit that provides a view into SamplingUnit restricted to a range i:j of a block. L is an important flag that indicates whether it is a terminal block or not.
Fields
PP: a vector of views into relevantGuidPropP_last: a view into a single (or none)GuidPropcorresponding to the terminal sub-interval.WW: a vector of views into containers for sampled Wiener processWnr: a flag for sampling Wiener processesXX: a vector of views into containers for a sampled processll: a placeholder for computed log-likelihoodll_history: a history of computed log-likelihoods (useful for MCMC)
function Block(
u::SamplingUnit,
range::UnitRange{Int64},
last_block=false,
ll_hist_len=0
)Base constructor.
It is rarely used on its own. Instead, it is used mainly as a building block of other, composite units. Nevertheless, there are a couple of useful functions implemented for it:
DiffusionMCMCTools.set_ll! — Methodset_ll!(b::Block, i::Int, v)Set the internal log-likelihood history field b.ll_history[i] with a value v
DiffusionMCMCTools.save_ll! — Methodsave_ll!(b::Block, i::Int)Commit the current log-likelihood field ll to history b.ll_history at index i.
GuidedProposals.recompute_guiding_term! — MethodGP.recompute_guiding_term!(b::Block)Recompute the guiding term.
DiffusionMCMCTools.find_W_for_X! — Methodfind_W_for_X!(b::Block)Compute the Wiener process b.WW that is needed for obtaining path b.XX under the law stored in b.
GuidedProposals.loglikhd — MethodGP.loglikhd(b::Block)Compute the log-likelihood evaluated at a sampled path.
DiffusionMCMCTools.loglikhd! — Methodloglikhd!(b::Block)Compute the log-likelihood evaluated at a sampled path and store the result in an internal field ll.
DiffusionMCMCTools.recompute_path! — Functionrecompute_path!(b::Block, WW=b.WW; skip=0)Recompute the path b.XX for a given wiener process WW.