Several algorithms have changed their names, but also their role:
-
MCMCSampling
has becomeTransformedMCMC
. -
MetropolisHastings
has becomeRandomWalk
. It's parameters have changed (no deprecation for the parameter changes). Tuning and sample weighting scheme selection have moved toTransformedMCMC
. -
PriorToGaussian
has becomePriorToNormal
.
Partial deprecations are available for the above, a lot of old code should run more or less unchanged (with deprecation warnings). Also:
-
AdaptiveMHTuning
has becomeAdaptiveAffineTuning
, but is now used as a parameter forTransformedMCMC
(formerlyMCMCSampling
) instead ofRandomWalk
(formerlyMetropolisHastings
). -
MCMCNoOpTuning
has becomeNoMCMCTransformTuning
. -
The parameters of
HamiltonianMC
have changed. -
MCMCTuningAlgorithm
has been replaced byMCMCTransformTuning
. -
The
trafo
parameter of algorithms has been renamed topretransform
, thetrafo
field in algorithm results has been renamed tof_pretransform
.
-
Sampling, integration and mode-finding algorithms now generate a return value
result = ..., evaluated::EvaluatedMeasure = ..., ...)
if their target is a probability measure/distribution. -
The new
RAMTuning
is now the default (transform) tuning algorithm forRandomWalk
(formerlyMetropolisHastings
). It typically results in a much faster burn-in process thanAdaptiveAffineTuning
(formerlyAdaptiveMHTuning
, the previous default). -
MCMC Sampling handles parameter scale and correlation adaptivity via via tunable space transformations instead of tuning covariance matrices in proposal distributions.
-
MCMC tuning has been split into proposal tuning (algorithms of type
MCMCProposalTuning
) and transform turning (algorithms of typeMCMCTransformTuning
). Proposal tuning has now a much more limited role and often may beNoMCMCProposalTuning()
(e.g. forRandomWalk
). -
Added
MGVISampling
for Metric Gaussian Variational Inference.
-
AbstractVariateTransform
and the functionladjof
have been removed, BAT parameter transformations do not need to have a specific supertype any longer (see above). -
The new
BATContext
replaces passingrng::AbstractRNG
random number generators around. -
Pending:
LogDVal
has been deprecated soon and will removed in BAT v3.1 or v3.2. Do not do this any longer:likelihood = let data = mydata function(v) log_likelihood_value = ... return LogDVal(log_likelihood_value) end end
Instead, use the DensityInterface API (see above), like this:
likelihood = let data = mydata logfuncdensity(function(v) log_likelihood_value = ... return log_likelihood_value end) end
or like this
struct MyLikeLihood{D} data::D end @inline DensityInterface.DensityKind(::MyLikeLihood) = IsDensity() function DensityInterface.logdensityof(likelihood::MyLikeLihood, v) log_likelihood_value = ... return log_likelihood_value end likelihood = MyLikeLihood(mydata)
This allows for defining likelihoods without depending on BAT.
-
New behavior of
ValueShapes.NamedTupleShape
andValueShapes.NamedTupleDist
: Due to changes in ValueShapes v0.10,NamedTupleShape
andNamedTupleDist
now either (by default) useNamedTuple
or (optionally)ValueShapes.ShapedAsNT
, but no longer a mix of them. As a result, the behavior of BAT has changed as well when using aNamedTupleDist
as a prior. For example,mode(samples).result
returns aNamedTuple
now directly. -
SampledMeasure
(formerlySampledDensity
) have been replaced byEvaluatedMeasure
. -
Some type-pirating prior plotting recipes have been removed, to be re-added in a clean way.
-
Pending: BAT will rely less on ValueShapes in the future. Do not use ValueShapes functionality directly where avoidable. Use
distprod
instead of usingValueShapes.NamedTupleDist
directly, and favor usingbat_transform
instead of shaping and unshaping data using values shapes directly, if possible. -
Use the new function
bat_report
to generate a sampling output report instead ofshow(BAT.SampledDensity(samples))
. -
The field types of
EvaluatedMeasure
have changed.
-
Support for DensityInterface: BAT will now accept any object that implements the DensityInterface API (specifically
DensityInterface.densitykind
andDensityInterface.logdensityof
) as likelihoods. In return, all BAT priors and posteriors support the DensityInterface API as well. -
Support for InverseFunctions and ChangesOfVariables: Parameter transformations in BAT now implement the DensityInterface API. Any function that supports
InverseFunctions.inverse
ChangesOfVariables.with_logabsdet_jacobian
output_shape = f(input_shape::ValueShapes.AbstractValueShape)::AbstractValueShape
can now be used as a parameter transformation in BAT.
-
BATContext
,get_batcontext
andset_batcontext
-
bat_transform
with enhanced capabilities -
distprod
,distbind
andlbqintegral
are the new ways to express priors and posteriors in BAT. -
bat_report
-
BAT.enable_error_log
(experimental) -
BAT.error_log
(experimental) -
BridgeSampling
(experimental) -
EllipsoidalNestedSampling
(experimental) -
ReactiveNestedSampling
(experimental)