Skip to content

Latest commit

 

History

History
518 lines (384 loc) · 28.6 KB

RELEASE-NOTES.md

File metadata and controls

518 lines (384 loc) · 28.6 KB

Release Notes

PyMC3 3.7 (unreleased)

New features

  • Add data container class (Data) that wraps the theano SharedVariable class and let the model be aware of its inputs and outputs.
  • Add function set_data to update variables defined as Data.
  • Mixture now supports mixtures of multidimensional probability distributions, not just lists of 1D distributions.
  • GLM.from_formula and LinearComponent.from_formula can extract variables from the calling scope. Customizable via the new eval_env argument. Fixing #3382.

Maintenance

  • All occurances of sd as a parameter name have been renamed to sigma. sd will continue to function for backwards compatibility.
  • Made BrokenPipeError for parallel sampling more verbose on Windows.
  • Added the broadcast_distribution_samples function that helps broadcasting arrays of drawn samples, taking into account the requested size and the inferred distribution shape. This sometimes is needed by distributions that call several rvs separately within their random method, such as the ZeroInflatedPoisson (Fix issue #3310).
  • The Wald, Kumaraswamy, LogNormal, Pareto, Cauchy, HalfCauchy, Weibull and ExGaussian distributions random method used a hidden _random function that was written with scalars in mind. This could potentially lead to artificial correlations between random draws. Added shape guards and broadcasting of the distribution samples to prevent this (Similar to issue #3310).
  • Added a fix to allow the imputation of single missing values of observed data, which previously would fail (Fix issue #3122).
  • Fix for #3346. The draw_values function was too permissive with what could be grabbed from inside point, which lead to an error when sampling posterior predictives of variables that depended on shared variables that had changed their shape after pm.sample() had been called.
  • Fix for #3354. draw_values now adds the theano graph descendants of TensorConstant or SharedVariables to the named relationship nodes stack, only if these descendants are ObservedRV or MultiObservedRV instances.
  • Fixed bug in broadcast_distrution_samples, which did not handle correctly cases in which some samples did not have the size tuple prepended.
  • Changed MvNormal.random's usage of tensordot for Cholesky encoded covariances. This lead to wrong axis broadcasting and seemed to be the cause for issue #3343.
  • Fixed defect in Mixture.random when multidimensional mixtures were involved. The mixture component was not preserved across all the elements of the dimensions of the mixture. This meant that the correlations across elements within a given draw of the mixture were partly broken.
  • Restructured Mixture.random to allow better use of vectorized calls to comp_dists.random.
  • Added tests for mixtures of multidimensional distributions to the test suite.
  • Fixed incorrect usage of broadcast_distribution_samples in DiscreteWeibull.
  • Mixture's default dtype is now determined by theano.config.floatX.
  • dist_math.random_choice now handles nd-arrays of category probabilities, and also handles sizes that are not None. Also removed unused k kwarg from dist_math.random_choice.
  • Changed Categorical.mode to preserve all the dimensions of p except the last one, which encodes each category's probability.
  • Changed initialization of Categorical.p. p is now normalized to sum to 1 inside logp and random, but not during initialization. This could hide negative values supplied to p as mentioned in #2082.
  • Categorical now accepts elements of p equal to 0. logp will return -inf if there are values that index to the zero probability categories.
  • Add sigma, tau, and sd to signature of NormalMixture.
  • Resolved issue #3248. Set default lower and upper values of -inf and inf for pm.distributions.continuous.TruncatedNormal. This avoids errors caused by their previous values of None.
  • Resolved issue #3399. Converted all calls to pm.distributions.bound._ContinuousBounded and pm.distributions.bound._DiscreteBounded to use only and all positional arguments.

Deprecations

  • nuts_kwargs and step_kwargs have been deprecated in favor of using the standard kwargs to pass optional step method arguments.
  • SGFS and CSG have been removed (Fix for #3353). They have been moved to pymc3-experimental.
  • References to live_plot and corresponding notebooks have been removed.

PyMC3 3.6 (Dec 21 2018)

This will be the last release to support Python 2.

New features

  • Track the model log-likelihood as a sampler stat for NUTS and HMC samplers (accessible as trace.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 the trace. Previously, by default it would produce 1 chain worth of samples, using a random selection from the trace (#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 nested random and draw_values calls, enabling draw_values to draw samples from the joint probability distribution of RVs and not the marginals. Custom distributions that must call draw_values several times in their random method, or that invoke many calls to other distribution's random 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, and random 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 in random and updated sample codes for consistency (#3225)
  • Refactor SMC and properly compute marginal likelihood (#3124)
  • Removed use of deprecated ymin keyword in matplotlib's Axes.set_ylim (#3279)
  • Fix for #3210. Now distribution.draw_values(params), will draw the params 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 calls draw_values to initialize the shape of the ppc trace. This called could lead to ValueError's when sampling the ppc from a model with Flat or HalfFlat prior distributions (Fix issue #3294).
  • Added explicit conversion to floatX and int32 for the continuous and discrete probability distribution parameters (addresses issue #3223).

Deprecations

  • Renamed sample_ppc() and sample_ppc_w() to sample_posterior_predictive() and sample_posterior_predictive_w(), respectively.

PyMC 3.5 (July 21 2018)

New features

  • Add documentation section on survival analysis and censored data models
  • Add check_test_point method to pm.Model
  • Add Ordered Transformation and OrderedLogistic distribution
  • Add Chain transformation
  • Improve error message Mass matrix contains zeros on the diagonal. Some derivatives might always be zero during tuning of pm.sample
  • Improve error message NaN occurred in optimization. during ADVI
  • Save and load traces without pickle using pm.save_trace and pm.load_trace
  • Add Kumaraswamy distribution
  • Add TruncatedNormal distribution
  • Rewrite parallel sampling of multiple chains on py3. This resolves long standing issues when transferring large traces to the main process, avoids pickling issues on UNIX, and allows us to show a progress bar for all chains. If parallel sampling is interrupted, we now return partial results.
  • Add sample_prior_predictive which allows for efficient sampling from the unconditioned model.
  • SMC: remove experimental warning, allow sampling using sample, reduce autocorrelation from final trace.
  • Add model_to_graphviz (which uses the optional dependency graphviz) to plot a directed graph of a PyMC3 model using plate notation.
  • Add beta-ELBO variational inference as in beta-VAE model (Christopher P. Burgess et al. NIPS, 2017)
  • Add __dir__ to SingleGroupApproximation to improve autocompletion in interactive environments

Fixes

  • Fixed grammar in divergence warning, previously There were 1 divergences ... could be raised.
  • Fixed KeyError raised when only subset of variables are specified to be recorded in the trace.
  • Removed unused repeat=None arguments from all random() methods in distributions.
  • Deprecated the sigma argument in MarginalSparse.marginal_likelihood in favor of noise
  • Fixed unexpected behavior in random. Now the random functionality is more robust and will work better for sample_prior when that is implemented.
  • Fixed scale_cost_to_minibatch behaviour, previously this was not working and always False

PyMC 3.4.1 (April 18 2018)

New features

  • Add logit_p keyword to pm.Bernoulli, so that users can specify the logit of the success probability. This is faster and more stable than using p=tt.nnet.sigmoid(logit_p).
  • Add random keyword to pm.DensityDist thus enabling users to pass custom random method which in turn makes sampling from a DensityDist possible.
  • Effective sample size computation is updated. The estimation uses Geyer's initial positive sequence, which no longer truncates the autocorrelation series inaccurately. pm.diagnostics.effective_n now can reports N_eff>N.
  • Added KroneckerNormal distribution and a corresponding MarginalKron Gaussian Process implementation for efficient inference, along with lower-level functions such as cartesian and kronecker products.
  • Added Coregion covariance function.
  • Add new 'pairplot' function, for plotting scatter or hexbin matrices of sampled parameters. Optionally it can plot divergences.
  • Plots of discrete distributions in the docstrings
  • Add logitnormal distribution
  • Densityplot: add support for discrete variables
  • Fix the Binomial likelihood in .glm.families.Binomial, with the flexibility of specifying the n.
  • Add offset kwarg to .glm.
  • Changed the compare function to accept a dictionary of model-trace pairs instead of two separate lists of models and traces.
  • add test and support for creating multivariate mixture and mixture of mixtures
  • distribution.draw_values, now is also able to draw values from conditionally dependent RVs, such as autotransformed RVs (Refer to PR #2902).

Fixes

  • VonMises does not overflow for large values of kappa. i0 and i1 have been removed and we now use log_i0 to compute the logp.
  • The bandwidth for KDE plots is computed using a modified version of Scott's rule. The new version uses entropy instead of standard deviation. This works better for multimodal distributions. Functions using KDE plots has a new argument bw controlling the bandwidth.
  • fix PyMC3 variable is not replaced if provided in more_replacements (#2890)
  • Fix for issue #2900. For many situations, named node-inputs do not have a random method, while some intermediate node may have it. This meant that if the named node-input at the leaf of the graph did not have a fixed value, theano would try to compile it and fail to find inputs, raising a theano.gof.fg.MissingInputError. This was fixed by going through the theano variable's owner inputs graph, trying to get intermediate named-nodes values if the leafs had failed.
  • In distribution.draw_values, some named nodes could be theano.tensor.TensorConstants or theano.tensor.sharedvar.SharedVariables. Nevertheless, in distribution._draw_value, these would be passed to distribution._compile_theano_function as if they were theano.tensor.TensorVariables. This could lead to the following exceptions TypeError: ('Constants not allowed in param list', ...) or TypeError: Cannot use a shared variable (...). The fix was to not add theano.tensor.TensorConstant or theano.tensor.sharedvar.SharedVariable named nodes into the givens dict that could be used in distribution._compile_theano_function.
  • Exponential support changed to include zero values.

Deprecations

  • DIC and BPIC calculations have been removed
  • df_summary have been removed, use summary instead
  • njobs and nchains kwarg are deprecated in favor of cores and chains for sample
  • lag kwarg in pm.stats.autocorr and pm.stats.autocov is deprecated.

PyMC 3.3 (January 9, 2018)

New features

  • Improve NUTS initialization advi+adapt_diag_grad and add jitter+adapt_diag_grad (#2643)
  • Added MatrixNormal class for representing vectors of multivariate normal variables
  • Implemented HalfStudentT distribution
  • New benchmark suite added (see http://pandas.pydata.org/speed/pymc3/)
  • Generalized random seed types
  • Update loo, new improved algorithm (#2730)
  • New CSG (Constant Stochastic Gradient) approximate posterior sampling algorithm (#2544)
  • Michael Osthege added support for population-samplers and implemented differential evolution metropolis (DEMetropolis). For models with correlated dimensions that can not use gradient-based samplers, the DEMetropolis sampler can give higher effective sampling rates. (also see PR#2735)
  • Forestplot supports multiple traces (#2736)
  • Add new plot, densityplot (#2741)
  • DIC and BPIC calculations have been deprecated
  • Refactor HMC and implemented new warning system (#2677, #2808)

Fixes

  • Fixed compareplot to use loo output.
  • Improved posteriorplot to scale fonts
  • sample_ppc_w now broadcasts
  • df_summary function renamed to summary
  • Add test for model.logp_array and model.bijection (#2724)
  • Fixed sample_ppc and sample_ppc_w to iterate all chains(#2633, #2748)
  • Add Bayesian R2 score (for GLMs) stats.r2_score (#2696) and test (#2729).
  • SMC works with transformed variables (#2755)
  • Speedup OPVI (#2759)
  • Multiple minor fixes and improvements in the docs (#2775, #2786, #2787, #2789, #2790, #2794, #2799, #2809)

Deprecations

  • Old (minibatch-)advi is removed (#2781)

PyMC3 3.2 (October 10, 2017)

New features

This version includes two major contributions from our Google Summer of Code 2017 students:

  • Maxim Kochurov extended and refactored the variational inference module. This primarily adds two important classes, representing operator variational inference (OPVI) objects and Approximation objects. These make it easier to extend existing variational classes, and to derive inference from variational optimizations, respectively. The variational module now also includes normalizing flows (NFVI).
  • Bill Engels added an extensive new Gaussian processes (gp) module. Standard GPs can be specified using either Latent or Marginal classes, depending on the nature of the underlying function. A Student-T process TP has been added. In order to accomodate larger datasets, approximate marginal Gaussian processes (MarginalSparse) have been added.

Documentation has been improved as the result of the project's monthly "docathons".

An experimental stochastic gradient Fisher scoring (SGFS) sampling step method has been added.

The API for find_MAP was enhanced.

SMC now estimates the marginal likelihood.

Added Logistic and HalfFlat distributions to set of continuous distributions.

Bayesian fraction of missing information (bfmi) function added to stats.

Enhancements to compareplot added.

QuadPotential adaptation has been implemented.

Script added to build and deploy documentation.

MAP estimates now available for transformed and non-transformed variables.

The Constant variable class has been deprecated, and will be removed in 3.3.

DIC and BPIC calculations have been sped up.

Arrays are now accepted as arguments for the Bound class.

random method was added to the Wishart and LKJCorr distributions.

Progress bars have been added to LOO and WAIC calculations.

All example notebooks updated to reflect changes in API since 3.1.

Parts of the test suite have been refactored.

Fixes

Fixed sampler stats error in NUTS for non-RAM backends

Matplotlib is no longer a hard dependency, making it easier to use in settings where installing Matplotlib is problematic. PyMC will only complain if plotting is attempted.

Several bugs in the Gaussian process covariance were fixed.

All chains are now used to calculate WAIC and LOO.

AR(1) log-likelihood function has been fixed.

Slice sampler fixed to sample from 1D conditionals.

Several docstring fixes.

Contributors

The following people contributed to this release (ordered by number of commits):

Maxim Kochurov [email protected] Bill Engels [email protected] Chris Fonnesbeck [email protected] Junpeng Lao [email protected] Adrian Seyboldt [email protected] AustinRochford [email protected] Osvaldo Martin [email protected] Colin Carroll [email protected] Hannes Vasyura-Bathke [email protected] Thomas Wiecki [email protected] michaelosthege [email protected] Marco De Nadai [email protected] Kyle Beauchamp [email protected] Massimo [email protected] ctm22396 [email protected] Max Horn [email protected] Hennadii Madan [email protected] Hassan Naseri [email protected] Peadar Coyle [email protected] Saurav R. Tuladhar [email protected] Shashank Shekhar [email protected] Eric Ma [email protected] Ed Herbst [email protected] tsdlovell [email protected] zaxtax [email protected] Dan Nichol [email protected] Benjamin Yetton [email protected] jackhansom [email protected] Jack Tsai [email protected] Andrés Asensio Ramos [email protected]

PyMC3 3.1 (June 23, 2017)

New features

Fixes

  • Bound now works for discrete distributions as well.

  • Random sampling now returns the correct shape even for higher dimensional RVs.

  • Use theano Psi and GammaLn functions to enable GPU support for them.

PyMC3 3.0 (January 9, 2017)

We are proud and excited to release the first stable version of PyMC3, the product of more than 5 years of ongoing development and contributions from over 80 individuals. PyMC3 is a Python module for Bayesian modeling which focuses on modern Bayesian computational methods, primarily gradient-based (Hamiltonian) MCMC sampling and variational inference. Models are specified in Python, which allows for great flexibility. The main technological difference in PyMC3 relative to previous versions is the reliance on Theano for the computational backend, rather than on Fortran extensions.

New features

Since the beta release last year, the following improvements have been implemented:

  • Added variational submodule, which features the automatic differentiation variational inference (ADVI) fitting method. Also supports mini-batch ADVI for large data sets. Much of this work was due to the efforts of Taku Yoshioka, and important guidance was provided by the Stan team (specifically Alp Kucukelbir and Daniel Lee).

  • Added model checking utility functions, including leave-one-out (LOO) cross-validation, BPIC, WAIC, and DIC.

  • Implemented posterior predictive sampling (sample_ppc).

  • Implemented auto-assignment of step methods by sample function.

  • Enhanced IPython Notebook examples, featuring more complete narratives accompanying code.

  • Extensive debugging of NUTS sampler.

  • Updated documentation to reflect changes in code since beta.

  • Refactored test suite for better efficiency.

  • Added von Mises, zero-inflated negative binomial, and Lewandowski, Kurowicka and Joe (LKJ) distributions.

  • Adopted joblib for managing parallel computation of chains.

  • Added contributor guidelines, contributor code of conduct and governance document.

Deprecations

  • Argument order of tau and sd was switched for distributions of the normal family:
  • Normal()
  • Lognormal()
  • HalfNormal()

Old: Normal(name, mu, tau) New: Normal(name, mu, sd) (supplying keyword arguments is unaffected).

  • MvNormal calling signature changed: Old: MvNormal(name, mu, tau) New: MvNormal(name, mu, cov) (supplying keyword arguments is unaffected).

We on the PyMC3 core team would like to thank everyone for contributing and now feel that this is ready for the big time. We look forward to hearing about all the cool stuff you use PyMC3 for, and look forward to continued development on the package.

Contributors

The following authors contributed to this release:

Chris Fonnesbeck [email protected] John Salvatier [email protected] Thomas Wiecki [email protected] Colin Carroll [email protected] Maxim Kochurov [email protected] Taku Yoshioka [email protected] Peadar Coyle (springcoil) [email protected] Austin Rochford [email protected] Osvaldo Martin [email protected] Shashank Shekhar [email protected]

In addition, the following community members contributed to this release:

A Kuz [email protected] A. Flaxman [email protected] Abraham Flaxman [email protected] Alexey Goldin [email protected] Anand Patil [email protected] Andrea Zonca [email protected] Andreas Klostermann [email protected] Andres Asensio Ramos Andrew Clegg [email protected] Anjum48 Benjamin Edwards [email protected] Boris Avdeev [email protected] Brian Naughton [email protected] Byron Smith Chad Heyne [email protected] Corey Farwell [email protected] David Huard [email protected] David Stück [email protected] DeliciousHair [email protected] Dustin Tran Eigenblutwurst [email protected] Gideon Wulfsohn [email protected] Gil Raphaelli [email protected] Gogs [email protected] Ilan Man Imri Sofer [email protected] Jake Biesinger [email protected] James Webber [email protected] John McDonnell [email protected] Jon Sedar [email protected] Jordi Diaz Jordi Warmenhoven [email protected] Karlson Pfannschmidt [email protected] Kyle Bishop [email protected] Kyle Meyer [email protected] Lin Xiao Mack Sweeney [email protected] Matthew Emmett [email protected] Michael Gallaspy [email protected] Nick [email protected] Osvaldo Martin [email protected] Patricio Benavente [email protected] Raymond Roberts Rodrigo Benenson [email protected] Sergei Lebedev [email protected] Skipper Seabold [email protected] Thomas Kluyver [email protected] Tobias Knuth [email protected] Volodymyr Kazantsev Wes McKinney [email protected] Zach Ploskey [email protected] akuz [email protected] brandon willard [email protected] dstuck [email protected] ingmarschuster [email protected] jan-matthis [email protected] jason JasonTam22@gmailcom kiudee [email protected] maahnman [email protected] macgyver [email protected] mwibrow [email protected] olafSmits [email protected] paul sorenson [email protected] redst4r [email protected] santon [email protected] sgenoud [email protected] stonebig Tal Yarkoni [email protected] x2apps [email protected] zenourn [email protected]

PyMC3 3.0b (June 16th, 2015)

Probabilistic programming allows for flexible specification of Bayesian statistical models in code. PyMC3 is a new, open-source probabilistic programmer framework with an intuitive, readable and concise, yet powerful, syntax that is close to the natural notation statisticians use to describe models. It features next-generation fitting techniques, such as the No U-Turn Sampler, that allow fitting complex models with thousands of parameters without specialized knowledge of fitting algorithms.

PyMC3 has recently seen rapid development. With the addition of two new major features: automatic transforms and missing value imputation, PyMC3 has become ready for wider use. PyMC3 is now refined enough that adding features is easy, so we don't expect adding features in the future will require drastic changes. It has also become user friendly enough for a broader audience. Automatic transformations mean NUTS and find_MAP work with less effort, and friendly error messages mean its easy to diagnose problems with your model.

Thus, Thomas, Chris and I are pleased to announce that PyMC3 is now in Beta.

Highlights

  • Transforms now automatically applied to constrained distributions
  • Transforms now specified with a transform= argument on Distributions. model.TransformedVar is gone.
  • Transparent missing value imputation support added with MaskedArrays or pandas.DataFrame NaNs.
  • Bad default values now ignored
  • Profile theano functions using model.profile(model.logpt)

Contributors since 3.0a