MCMCStreamTempering
Documentation for MCMCStreamTempering.
MCMCStreamTempering.MHLogDensityFunctionMCMCStreamTempering.NamedNTupleMCMCStreamTempering.NamedNTupleOrComponentVectorMCMCStreamTempering.StreamTemperingContextMCMCStreamTempering.TestLogModifyingChildContextMCMCStreamTempering.compute_T_streamsMCMCStreamTempering.dist_val_tupleMCMCStreamTempering.estimate_obs_uncMCMCStreamTempering.estimate_prop_weights_model_uncMCMCStreamTempering.set_namedtuple!
MCMCStreamTempering.NamedNTupleOrComponentVector — TypeNamedNTupleOrComponentVector{T}Shorthand for Union of NamedNTuple{T} or ComponentVector{T} of eltype(T).
MCMCStreamTempering.MHLogDensityFunction — TypeMHLogDensityFunctionA log density function for the MHSampler sampler.
This variant uses the set_namedtuple! function to update the VarInfo.
MCMCStreamTempering.NamedNTuple — TypeNamedNTuple{T}Shorthand for NamedTuple with Tuple type being an NTuple with eltype T`.
MCMCStreamTempering.StreamTemperingContext — TypeContext that multiplies each log-prior by mod used to test whether varwise_logpriors respects child-context.
MCMCStreamTempering.TestLogModifyingChildContext — TypeContext that multiplies each log-prior by mod used to test whether varwise_logpriors respects child-context.
MCMCStreamTempering.compute_T_streams — MethodCompute temperature of data streams for given ratio of r = model_discrepancy / stddev(obs_error).
MCMCStreamTempering.dist_val_tuple — Methoddist_val_tuple(spl::Sampler{<:MHSampler}, vi::VarInfo)Return two NamedTuples.
The first NamedTuple has symbols as keys and distributions as values. The second NamedTuple has model symbols as keys and their stored values as values.
MCMCStreamTempering.estimate_obs_unc — Methodestimate_obs_unc(x,y; span=0.8)Estimate std-deviation of observation error in a series by inspecting the residuals of a loess model y ~ x. Keyword argument span controls the smoothmess of the fit. A value of 1 corresponds to a straight line, 0.8 is adequate for a single maximum. The fit can be inspected by plotting pred ~ x in the same plot as y ~ x.
Return value is a NamedTuple
std_obsunc: estimated standard deviation of observation uncertaintySS_obsunc: sum of squared residuals of observation uncertaintypred: predictions by the loess model, useful to inspect smoothness.
MCMCStreamTempering.estimate_prop_weights_model_unc — Methodestimate_prop_weights_model_unc(obs_streams, std_eff_streams)Estimate ratio of spread / stddev(obs_error), where spread is the 95% interval of observed value.
This is helpful for allowing larger relative model discrepancy (per observation uncertainty) for the streams with a larger spread per observation uncertainty.
Arguments
obs_streams:ComponentVectororNamedTuplestream -> observationsstd_eff_streams:ComponentVectororNamedTuplestream -> std_dev(obs_error)
Result NamedTuple with ComponentVectors
w: multiplicators of allowed model discrepancy. Specificallyw0 ./ minimum(w0)w0: original ratiosspread / stddev(obs_error)
MCMCStreamTempering.set_namedtuple! — Methodset_namedtuple!(vi::VarInfo, nt::NamedTuple)Places the values of a NamedTuple into the relevant places of a VarInfo.