Reparameterizations of GuidProp


In an MCMC setting we may wish to change the values of some parameters of GuidProp. GuidProp is defined as an immutable struct; however, the fields containing parameter values are mutable, and thus, changing parameters may be done in-place. Changing them directly by accessing relevant places that store parameter values is not advisable, instead, it is recommended to use one of the relevant convenience functions:

DiffusionDefinition.set_parameters!Function
DD.set_parameters!(
    PP::AbstractArray{<:GuidProp},
    PP°::AbstractArray{<:GuidProp},
    θ°,
    var_p_names,
    var_p_aux_names,
    θ_local_names,
    θ_local_aux_names,
    θ_local_obs_ind,
    critical_change = is_critical_update(
        PP, θ_local_aux_names, θ_local_obs_ind
    ),
)

Set parameters of Guided proposals PP° in an MCMC setting.

...

Arguments

  • PP: containers indicating how PP° should look like before θ° update
  • θ°: a vector with new parameters to be potentially set inside PP°
  • var_p_names: list of all variable parameter names in PP
  • var_p_aux_names: list of all variable parameter names of auxiliary laws in

PP

  • θ_local_names: list of pairs with relevant θ° entries for the target law

in a format (idx-of-param-in-θ°::Int64, param-name-in-law::Symbol)

  • θ_local_aux_names: list of pairs with relevant θ° entries for the aux law

in a format (idx-of-param-in-θ°::Int64, param-name-in-law::Symbol)

  • θ_local_obs_ind: list of pairs with relevant θ° entries for the

observations in a format (idx-of-param-in-θ°::Int64, idx-in-obs::Int64)

  • critical_change: boolean for whether θ° update alters any critical

parameters prompting for recomputation of the guiding term ...

source
DD.set_parameters!(
    PP::AbstractArray{<:GuidProp},
    θ°,
    θ_local_names,
    θ_local_aux_names,
    θ_local_obs_ind
)

Go throught the collection of GuidProps in PP and set the new parameters θ° in relevant fields. θ_local_names lists which fields in the target law need changing. θ_local_aux_names lists the same for the auxiliary laws and θ_local_obs_ind for the observations.

source
DD.set_parameters!(
    P::GuidProp,
    θ°,
    θ_local_names,
    θ_local_aux_names,
    θ_local_obs_ind
)

Set the new parameters θ° in P. θ_local_names lists which fields in the target law need changing. θ_local_aux_names lists the same for the auxiliary law and θ_local_obs_ind for the observation.

source
DD.set_parameters!(P::GuidProp, θ°::Dict)

Convenience parameter setter

source
DD.set_parameters!(PP::AbstractArray{<:GuidProp}, θ°::Dict)

Convenience parameter setter

source
GuidedProposals.equalize_obs_params!Function
equalize_obs_params!(
    PP::AbstractArray{<:GuidProp},
    PP°::AbstractArray{<:GuidProp}
)

Go through a collection of GuidProp in PP° and make sure that all observation parameters are the same. If not, equalize them and return a critical_change flag indicating that GuidProp laws need to be recomputed.

source
GuidedProposals.equalize_law_params!Function
equalize_law_params!(
    PP::AbstractArray{<:GuidProp},
    PP°::AbstractArray{<:GuidProp},
    var_p_names,
    var_p_aux_names,
)

Go through two collections of GuidProp and compare their variable parameters. If any of the parameters in PP° ends up being different than in PP then equalize them and if any of them belongs to the auxiliary law then return a critical_change flag.

source
DiffusionDefinition.same_entriesFunction
DD.same_entries(
    PP::AbstractArray{<:GuidProp},
    PP°::AbstractArray{<:GuidProp},
    entries
)

Go through the collections of guided proposals PP and PP° and compare if they share the same values of fields listed in entries.

source
GuidedProposals.is_critical_updateFunction
is_critical_update(
    PP::AbstractArray{<:GuidProp},
    θ_local_aux_names,
    θ_local_obs_ind
)

Check if the update of parameters that updates the fields of the auxiliary law listed in θ_local_aux_names and the observations listed in θ_local_obs_ind is critical i.e. whether it prompts for recomputation of the guiding term.

source

Re-computing the guiding term


Sometimes changing parameter values is all that needs to be done; however, it is not always the case. Often changing parameter values implies that the terms used for computation of the guiding term also need to be updated. This needs to be done whenever any parameter of the auxiliary law or any parameter of an observation has changed.

To actually re-compute the guiding terms and finalize the reparameterization you need to call

GuidedProposals.recompute_guiding_term!Function
recompute_guiding_term!(P::GuidProp, next_guided_prop=nothing)

Recompute the guiding term (most often used after update of parameters or change of an observation). next_guided_prop is the guided proposal law from the subsequent interval

source
recompute_guiding_term!(PP::Vector{<:GuidProp})

Recompute the guiding term for the entire trajectory with all observations (most often used after update of parameters or change of an observation).

source

All changes above are done in-place.