DiffusionMCMCTools

DiffusionDefinition.set_parameters!Function
DD.set_parameters!(
    bb::BiBlock,
    θ°,
    pnames,
    critical_change=is_critical_update(bb, pnames)
)

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.

source
DiffusionMCMCTools._eql_PP!Method
_eql_PP!(PP, PP°, var_p_names, var_p_aux_names)

Go through all GuidProp structs in PP and PP° and make sure that the parameters listed in var_p_names and var_p_aux_names agree. Equalize them if they do not. var_p_names should list all parameter names from the target law and var_p_aux_names should list all parameters from the auxiliary law.

source
DiffusionMCMCTools.accpt_rateMethod
accpt_rate(be::BlockEnsemble, range)

Compute the acceptance rate over the range of MCMC accept/reject history for each block for each recording.

source
DiffusionMCMCTools.fetch_llMethod
fetch_ll(be::BlockEnsemble)

Retreive the log-likelihood for all accepted paths

Warning

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!(be).

source
DiffusionMCMCTools.fetch_ll°Method
fetch_ll°(be::BlockEnsemble)

Retreive the log-likelihood for all proposed paths

Warning

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°!(be).

source
DiffusionMCMCTools.find_W_for_X!Method
find_W_for_X!(bc::BlockCollection)

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

source
DiffusionMCMCTools.find_θ_aux_names_for_MCMC_updateMethod
find_θ_aux_names_for_MCMC_update(θ_names_for_MCMC_update, PP)

Parse through PP and for each GuidProp struct enter the auxiliary law P_aux and pick out names from θ_names_for_MCMC_update that are relevant to this P_aux law.

source
DiffusionMCMCTools.find_θ_names_for_MCMC_updateMethod
find_θ_names_for_MCMC_update(θnames, pdep)

Parse through θnames i.e. a list of all parameter names that are relevant for a given MCMC update and pick out only those that are relevant for a given diffusion law. All information about the relevant parameters of the law should be stored inside pdep. Return a list of relevant parameter names in a format: idx-of-θ-to-relevant-value => name-of-param-inside-P_target-struct.

source
DiffusionMCMCTools.find_θ_obs_idx_for_MCMC_updateMethod
find_θ_obs_idx_for_MCMC_update(θnames, odeps)

Parse through θnames i.e. a list of all parameter names that are relevant for a given MCMC update and for each observation pick out only those that are relevant for it. All information about the relevant parameters of the observations should be stored inside odeps. Return a list of relevant parameter names in a format: idx-of-θ-to-relevant-value => idx-of-obs-inside-obs.θ.

source
DiffusionMCMCTools.ll_of_acceptedMethod
ll_of_accepted(be::BlockEnsemble, i)

Return an array of log-likelihoods (one for each block in each recording) of the paths that were accepted at the ith iteration.

source
DiffusionMCMCTools.set_proposal_law!Function
set_proposal_law!(
    be::BlockEnsemble,
    θ°,
    pnames,
    critical_change=GP.is_critical_update(bc, pnames);
    skip=0
)

Call set_proposal_law! separately for each recording.

source
DiffusionMCMCTools.set_proposal_law!Function
set_proposal_law!(
    bb::BiBlock,
    θ°,
    pnames,
    critical_change=GP.is_critical_update(bb, pnames);
    skip=0
)

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 θ°.

source
GuidedProposals.equalize_law_params!Method
GP.equalize_law_params!(bb::BiBlock, pnames)

Make sure that in the corresponding pairs of GuidProp structs of both bb.b and bb.b°, the variable parameters of each law are the same. If not, then set the ones in bb.b° to be the same as the ones in bb.b.

source
GuidedProposals.equalize_obs_params!Method
GP.equalize_obs_params!(bb::BiBlock)

Make sure that in the corresponding pairs of GuidProp structs of both bb.b and bb.b°, the parameters θ of the obs fields are the same. If not, then set the ones in bb.b° to be the same as the ones in bb.b.

source
GuidedProposals.is_critical_updateMethod
is_critical_update(bb::BiBlock, pnames)

Verify whether the update characterized by a list of parameter names stored in pnames is critical in a sense of prompting for recomputation of the guiding term.

source
GuidedProposals.is_critical_updateMethod
is_critical_update(bb::BlockCollection, pnames)

For each block in the collection verify whether the update characterized by a list of parameter names stored in pnames is critical in a sense of prompting for recomputation of the guiding term.

source
GuidedProposals.recompute_guiding_term!Method
GP.recompute_guiding_term!(bc::BlockCollection, [::Val{:_only}])

For each block in the collection recompute the guiding terms of both the proposal and the accepted laws. If an additional flag Val(:P_only) is passed, then recomputes the guiding term on accepted law only. If Val(:P°_only), then recomputes for the proposal law only.

source