BlockCollection
DiffusionMCMCTools.BlockCollection — Typestruct BlockCollection{TGP,TGPl,TW,TWn,TX}
blocks::Vector{BiBlock{_L,TGP,TGPl,TW,TWn,TX} where _L}
endGathers all blocks relevant for an entire single recording.
BlockCollection(
sp::SamplingPair{TGP,TGPl,TW,TWn,TX},
ranges,
ρρ=0.0,
ll_hist_len=0
) where {TGP,TGPl,TW,TWn,TX}Base constructor.
Imputation
DiffusionMCMCTools.draw_proposal_path! — Methoddraw_proposal_path!(bc::BlockCollection)Sample proposal paths on each block, compute log-likelihoods along the way. Assumes bc.blocks[i].b.XX[1].x[1] are starting points for each block. Uses the preconditioned Crank-Nicolson scheme.
Accept/reject decision
DiffusionMCMCTools.accept_reject_proposal_path! — Methodaccept_reject_proposal_path!(bc::BlockCollection, mcmciter)Accept/reject decision of the Metropolis-Hastings algorithm for the step of path imputation, done separately for each block.
Swaps
DiffusionMCMCTools.swap_paths! — Methodswap_paths!(bc::BlockCollection)For each block in the collection swap XX and WW containers between proposal-acceptance pair.
DiffusionMCMCTools.swap_XX! — Methodswap_XX!(bc::BlockCollection)For each block in the collection swap XX containers between proposal-acceptance pair.
DiffusionMCMCTools.swap_WW! — Methodswap_WW!(bc::BlockCollection)For each block in the collection swap WW containers between proposal-acceptance pair.
DiffusionMCMCTools.swap_PP! — Methodswap_PP!(bc::BlockCollection)For each block in the collection swap PP containers between proposal-acceptance pair.
DiffusionMCMCTools.swap_ll! — Methodswap_ll!(bc::BlockCollection)For each block in the collection swap ll fields between proposal-acceptance pair.
Setting up a block
GuidedProposals.set_obs! — MethodGP.set_obs!(bc::BlockCollection)Freeze an artificial observation at the terminal point of each block. For a terminal block nothing is done.
utility
DiffusionMCMCTools.loglikhd! — Methodloglikhd!(bc::BlockCollection)For each BiBlock in a collection compute the log-likelihood for the accepted block, evaluated at a sampled path and store the result in internal fields ll.
DiffusionMCMCTools.loglikhd°! — Methodloglikhd°!(bc::BlockCollection)For each BiBlock in a collection compute the log-likelihood for the proposal block, evaluated at a sampled path and store the result in internal fields ll.
DiffusionMCMCTools.fetch_ll — Methodfetch_ll(bc::BlockCollection)Retreive the log-likelihood for the entire accepted path.
The function uses only internal fields ll for this computation, which means that for the call to this function to make sense the log-likelihood must have been previously computed and stored in the field ll. If it hasn't been done, then you must first call loglikhd!(bc).
DiffusionMCMCTools.fetch_ll° — Methodfetch_ll°(bc::BlockCollection)Retreive the log-likelihood for the entire proposed path.
The function uses only internal fields ll for this computation, which means that for the call to this function to make sense the log-likelihood must have been previously computed and stored in the field ll. If it hasn't been done, then you must first call loglikhd°!(bc).
DiffusionMCMCTools.save_ll! — Methodsave_ll!(bc::BlockCollection, i::Int)For each block in the collection commit the current proposal and accepted log-likelihood fields ll to history, at index i.
DiffusionMCMCTools.ll_of_accepted — Methodll_of_accepted(bb::BlockCollection, i)Return an array of log-likelihoods (one for each block) of the paths that were accepted at the ith iteration.
DiffusionMCMCTools.accpt_rate — Methodaccpt_rate(bb::BlockCollection, range)Compute the acceptance rate over the range of MCMC accept/reject history for each block in the collection.
Setting parameters
DiffusionMCMCTools.set_proposal_law! — Functionset_proposal_law!(
bc::BlockCollection,
θ°,
pnames,
critical_change=GP.is_critical_update(bc, pnames);
skip=0
)For each block in the collection set the parameters in bb.b°.PP and bb.b°.P_last to θ° and make sure that all other parameters are shared with bb.b.PP and bb.b.P_last. Recompute the guiding term if needed, and then, compute the proposal trajectory bb.b°.XX for the proposal point θ°.