v3.6
This is a major new release from 3.5 with many new features and important bugfixes. The highlight is certainly our completely revamped website: https://docs.pymc.io/
Note also, that this release will be the last to be compatible with Python 2. Thanks to all contributors!
New features
- Track the model log-likelihood as a sampler stat for NUTS and HMC samplers
(accessible astrace.get_sampler_stats('model_logp')
) (#3134) - Add Incomplete Beta function
incomplete_beta(a, b, value)
- Add log CDF functions to continuous distributions:
Beta
,Cauchy
,ExGaussian
,Exponential
,Flat
,Gumbel
,HalfCauchy
,HalfFlat
,HalfNormal
,Laplace
,Logistic
,Lognormal
,Normal
,Pareto
,StudentT
,Triangular
,Uniform
,Wald
,Weibull
. - Behavior of
sample_posterior_predictive
is now to produce posterior predictive samples, in order, from all values of thetrace
. Previously, by default it would produce 1 chain worth of samples, using a random selection from thetrace
(#3212) - Show diagnostics for initial energy errors in HMC and NUTS.
- PR #3273 has added the
distributions.distribution._DrawValuesContext
context
manager. This is used to store the values already drawn in nestedrandom
anddraw_values
calls, enablingdraw_values
to draw samples from the
joint probability distribution of RVs and not the marginals. Custom
distributions that must calldraw_values
several times in theirrandom
method, or that invoke many calls to other distribution'srandom
methods
(e.g. mixtures) must do all of these calls under the same_DrawValuesContext
context manager instance. If they do not, the conditional relations between
the distribution's parameters could be broken, andrandom
could return
values drawn from an incorrect distribution. Rice
distribution is now defined with either the noncentrality parameter or the shape parameter (#3287).
Maintenance
- Big rewrite of documentation (#3275)
- Fixed Triangular distribution
c
attribute handling inrandom
and updated sample codes for consistency (#3225) - Refactor SMC and properly compute marginal likelihood (#3124)
- Removed use of deprecated
ymin
keyword in matplotlib'sAxes.set_ylim
(#3279) - Fix for #3210. Now
distribution.draw_values(params)
, will draw theparams
values from their joint probability distribution and not from combinations of their marginals (Refer to PR #3273). - Removed dependence on pandas-datareader for retrieving Yahoo Finance data in examples (#3262)
- Rewrote
Multinomial._random
method to better handle shape broadcasting (#3271) - Fixed
Rice
distribution, which inconsistently mixed two parametrizations (#3286). Rice
distribution now accepts multiple parameters and observations and is usable with NUTS (#3289).sample_posterior_predictive
no longer callsdraw_values
to initialize the shape of the ppc trace. This called could lead toValueError
's when sampling the ppc from a model withFlat
orHalfFlat
prior distributions (Fix issue #3294).
Deprecations
- Renamed
sample_ppc()
andsample_ppc_w()
tosample_posterior_predictive()
andsample_posterior_predictive_w()
, respectively.