RELEASE-NOTES.md document.
If you want a description of the highlights of this release, check out the release announcement on our new website. Feel free to read it, print it out, and give it to people on the street -- because everybody has to know PyMC 4.0 is officially out 🍾
⚠️ The project was renamed to "PyMC". Now the library is installed as "pip install pymc" and imported likeimport pymc as pm. See this migration guide for more details.⚠️ Theano-PyMC has been replaced with Aesara, so all external references totheanoandttneed to be replaced withaesaraandat, respectively (see 4471).⚠️ Support for JAX and JAX samplers, also allows sampling on GPUs. This benchmark shows speed-ups of up to 11x.⚠️ Random seeding behavior changed (see #5787)!- Sampling results will differ from those of v3 when passing the same
random_seedas before. They will be consistent across subsequent v4 releases unless mentioned otherwise. - Sampling functions no longer respect user-specified global seeding! Always pass
random_seedto ensure reproducible behavior. random_seednow accepts RandomState and Generators besides integers.
- Sampling results will differ from those of v3 when passing the same
⚠️ The GLM submodule was removed, please use Bambi instead.⚠️ PyMC now requires SciPy version>= 1.4.1(see #4857).
- MvNormalRandomWalk, MvStudentTRandomWalk, GARCH11 and EulerMaruyama distributions (see #4642)
- Nested Mixture distributions (see #5533)
pm.sample_posterior_predictive_w(see #4807)- Partially observed Multivariate distributions (see #5260)
-
Distributions:
-
Univariate censored distributions are now available via
pm.Censored. #5169 -
The
CARdistribution has been added to allow for use of conditional autoregressions which often are used in spatial and network models. -
Added a
logcdfimplementation for the Kumaraswamy distribution (see #4706). -
The
OrderedMultinomialdistribution has been added for use on ordinal data which are aggregated by trial, like multinomial observations, whereasOrderedLogisticonly accepts ordinal data in a disaggregated format, like categorical observations (see #4773). -
The
Polya-Gammadistribution has been added (see #4531). To make use of this distribution, thepolyagamma>=1.3.1library must be installed and available in the user's environment. -
pm.DensityDistcan now accept an optionallogcdfkeyword argument to pass in a function to compute the cumulative density function of the distribution (see 5026). -
pm.DensityDistcan now accept an optionalmomentkeyword argument to pass in a function to compute the moment of the distribution (see 5026). -
Added an alternative parametrization,
logit_ptopm.Binomialandpm.Categoricaldistributions (see 5637).
-
-
Model dimensions:
- The dimensionality of model variables can now be parametrized through either of
shapeordims(see #4696):- With
shapethe length of dimensions must be given numerically or as scalar AesaraVariables. Numeric entries inshaperestrict the model variable to the exact length and re-sizing is no longer possible. dimskeeps model variables re-sizeable (for example throughpm.Data) and leads to well defined coordinates inInferenceDataobjects.- An
Ellipsis(...) in the last position ofshapeordimscan be used as short-hand notation for implied dimensions.
- With
- New features for
pm.Datacontainers:- With
pm.Data(..., mutable=False), or by usingpm.ConstantData()one can now createTensorConstantdata variables. These can be more performant and compatible in situations where a variable doesn't need to be changed viapm.set_data(). See #5295. If you do need to change the variable, usepm.Data(..., mutable=True), orpm.MutableData(). - New named dimensions can be introduced to the model via
pm.Data(..., dims=...). For mutable data variables (see above) the lengths of these dimensions are symbolic, so they can be re-sized viapm.set_data(). pm.Datanow passes additional kwargs toaesara.shared/at.as_tensor. #5098.
- With
- The length of
dimsin the model is now tracked symbolically throughModel.dim_lengths(see #4625).
- The dimensionality of model variables can now be parametrized through either of
-
Sampling:
- A small change to the mass matrix tuning methods jitter+adapt_diag (the default) and adapt_diag improves performance early on during tuning for some models. #5004
- New experimental mass matrix tuning method jitter+adapt_diag_grad. #5004
- Support for samplers written in JAX:
- Adding support for numpyro's NUTS sampler via
pymc.sampling_jax.sample_numpyro_nuts() - Adding support for blackjax's NUTS sampler via
pymc.sampling_jax.sample_blackjax_nuts()(see #5477) pymc.sampling_jaxsamplers supportlog_likelihood,observed_data, andsample_statsin returnedInferenceDataobject (see #5189)- Adding support for
pm.Deterministicinpymc.sampling_jax(see #5182)
- Adding support for numpyro's NUTS sampler via
-
Miscellaneous:
- The new
pm.find_constrained_priorfunction can be used to find optimized prior parameters of a distribution under some constraints (e.g lower and upper bound). See #5231. - Nested models now inherit the parent model's coordinates. #5344
softmaxandlog_softmaxfunctions added tomathmodule (see #5279).- Added the low level
compile_forward_sampling_functionmethod to compile the aesara function responsible for generating forward samples (see #5759).
- The new
pm.sample(return_inferencedata=True)is now the default (see #4744).- ArviZ
plotsandstatswrappers were removed. The functions are now just available by their original names (see #4549 and3.11.2release notes). pm.sample_posterior_predictive(vars=...)kwarg was removed in favor ofvar_names(see #4343).ElemwiseCategoricalstep method was removed (see #4701)LKJCholeskyCov'scompute_corrkeyword argument is now set toTrueby default (see#5382)- Alternative
sdkeyword argument has been removed from all distributions.sigmashould be used instead (see #5583).
Read on if you're a developer. Or curious. Or both.
pm.Boundinterface no longer accepts a callable class as argument, instead it requires an instantiated distribution (created via the.dist()API) to be passed as an argument. In addition, Bound no longer returns a class instance but works as a normal PyMC distribution. Finally, it is no longer possible to do predictive random sampling from Bounded variables. Please, consult the new documentation for details on how to use Bounded variables (see 4815).- BART has received various updates (5091, 5177, 5229, 4914) but was removed from the main package in #5566. It is now available from pymc-experimental.
- Removed
AR1.ARof order 1 should be used instead. (see 5734). - The
pm.EllipticalSlicesampler was removed (see #5756). BaseStochasticGradientwas removed (see #5630)pm.Distribution(...).logp(x)is nowpm.logp(pm.Distribution(...), x).pm.Distribution(...).logcdf(x)is nowpm.logcdf(pm.Distribution(...), x).pm.Distribution(...).random(size=x)is nowpm.draw(pm.Distribution(...), draws=x).pm.draw_values(...)andpm.generate_samples(...)were removed.pm.fast_sample_posterior_predictivewas removed.pm.sample_prior_predictive,pm.sample_posterior_predictiveandpm.sample_posterior_predictive_wnow return anInferenceDataobject by default, instead of a dictionary (see #5073).pm.sample_prior_predictiveno longer returns transformed variable values by default. Pass them by name invar_namesif you want to obtain these draws (see 4769).pm.sample(trace=...)no longer acceptsMultiTraceorlen(.) > 0traces (see 5019#).- Setting of initial values:
- Setting initial values through
pm.Distribution(testval=...)is nowpm.Distribution(initval=...). Model.update_start_values(...)was removed. Initial values can be set in theModel.initial_valuesdictionary directly.- Test values can no longer be set through
pm.Distribution(testval=...)and must be assigned manually.
- Setting initial values through
transformsmodule is no longer accessible at the root level. It is accessible atpymc.distributions.transforms(see#5347).logp,dlogp, andd2logpandnojacvariations were removed. UseModel.compile_logp,compile_dlgopandcompile_d2logpwithjacobiankeyword instead.pm.DensityDistno longer accepts thelogpas its first position argument. It is now an optional keyword argument. If you pass a callable as the first positional argument, aTypeErrorwill be raised (see 5026).pm.DensityDistnow accepts distribution parameters as positional arguments. Passing them as a dictionary in theobservedkeyword argument is no longer supported and will raise an error (see 5026).- The signature of the
logpandrandomfunctions that can be passed into apm.DensityDisthas been changed (see 5026).
-
Signature and default parameters changed for several distributions:
pm.StudentTnow requires eithersigmaorlamas kwarg (see #5628)pm.StudentTnow requiresnuto be specified (no longer defaults to 1) (see #5628)pm.AsymmetricLaplacepositional arguments re-ordered (see #5628)pm.AsymmetricLaplacenow requiresmuto be specified (no longer defaults to 0) (see #5628)ZeroInflatedPoissonthetaparameter was renamed tomu(see #5584).pm.GaussianRandomWalkinitial distribution defaults to zero-centered normal with sigma=100 instead of flat (see#5779)pm.ARinitial distribution defaults to unit normal instead of flat (see#5779)
-
logpt,logpt_sum,logp_elemwisetandnojacvariations were removed. UseModel.logpt(jacobian=True/False, sum=True/False)instead. -
dlogp_nojactandd2logp_nojactwere removed. UseModel.dlogptandd2logptwithjacobian=Falseinstead. -
model.makefnis now calledModel.compile_fn, andmodel.fnwas removed. -
Methods starting with
fast_*, such asModel.fast_logp, were removed. Same applies toPointFuncclasses -
Model(model=...)kwarg was removed -
Model(theano_config=...)kwarg was removed -
Model.sizeproperty was removed (useModel.ndiminstead). -
dimsandcoordshandling: -
Transform.forwardandTransform.backwardsignatures changed. -
Changes to the Gaussian Process (GP) submodule (see 5055):
- The
gp.prior(..., shape=...)kwarg was renamed tosize. - Multiple methods including
gp.priornow require explicit kwargs. - For all implementations,
gp.Latent,gp.Marginaletc.,cov_funcandmean_funcare required kwargs. - In Windows test conda environment the
mklversion is fixed to version 2020.4, andmkl-serviceis fixed to2.3.0. This was required forgp.MarginalKronto function properly. gp.MvStudentTuses rotated samples fromStudentTdirectly now, instead of sampling frompm.Chi2and then frompm.Normal.- The "jitter" parameter, or the diagonal noise term added to Gram matrices such that the Cholesky is numerically stable, is now exposed to the user instead of hard-coded. See the function
gp.util.stabilize. - The
is_observedarguement forgp.Marginal*implementations has been deprecated. - In the gp.utils file, the
kmeans_inducing_pointsfunction now passes throughkmeans_kwargsto scipy's k-means function. - The function
replace_with_valuesfunction has been added togp.utils. MarginalSparsehas been renamedMarginalApprox.
- The
-
Removed
MixtureSameFamily.Mixtureis now capable of handling batched multivariate components (see #5438).
- Switched to the pydata-sphinx-theme
- Updated our documentation tooling to use MyST, MyST-NB, sphinx-design, notfound.extension, sphinx-copybutton and sphinx-remove-toctrees.
- Separated the builds of the example notebooks and of the versioned docs.
- Restructured the documentation to facilitate learning paths
- Updated API docs to document objects at the path users should use to import them
⚠️ Fixed old-time bug in Slice sampler that resulted in biased samples (see #5816).- Removed float128 dtype support (see #4514).
- Logp method of
UniformandDiscreteUniformno longer depends onpymc.distributions.dist_math.boundfor proper evaluation (see #4541). - We now include
cloudpickleas a required dependency, and no longer depend ondill(see #4858). - The
incomplete_betafunction inpymc.distributions.dist_mathwas replaced byaesara.tensor.betainc(see 4857). math.log1mexpandmath.log1mexp_numpywill expect negative inputs in the future. AFutureWarningis now raised unlessnegative_input=Trueis set (see #4860).- Changed name of
Lognormaldistribution toLogNormalto harmonize CamelCase usage for distribution names. - Attempt to iterate over MultiTrace will raise NotImplementedError.
- Removed silent normalisation of
pparameters in Categorical and Multinomial distributions (see #5370).
pm.math.cartesiancan now handle inputs that are themselves >1D (see #4482).- Statistics and plotting functions that were removed in
3.11.0were brought back, albeit with deprecation warnings if an old naming scheme is used (see #4536). In order to future proof your code, rename these function calls:pm.traceplot→pm.plot_tracepm.compareplot→pm.plot_compare(here you might need to rename some columns in the input according to thearviz.plot_comparedocumentation)pm.autocorrplot→pm.plot_autocorrpm.forestplot→pm.plot_forestpm.kdeplot→pm.plot_kdepm.energyplot→pm.plot_energypm.densityplot→pm.plot_densitypm.pairplot→pm.plot_pair
- ⚠ Our memoization mechanism wasn't robust against hash collisions (#4506), sometimes resulting in incorrect values in, for example, posterior predictives. The
pymc.memoizemodule was removed and replaced withcachetools. Thehashablefunction andWithMemoizationclass were moved topymc.util(see #4525). pm.make_shared_replacementsnow retains broadcasting information which fixes issues with Metropolis samplers (see #4492).
Release manager for 3.11.2: Michael Osthege (@michaelosthege)
- Automatic imputations now also work with
ndarraydata, not justpd.Seriesorpd.DataFrame(see#4439). pymc.sampling_jax.sample_numpyro_nutsnow returns samples from transformed random variables, rather than from the unconstrained representation (see #4427).
- We upgraded to
Theano-PyMC v1.1.2which includes bugfixes for...- ⚠ a problem with
tt.switchthat affected the behavior of several distributions, including at least the following special cases (see #4448)Bernoulliwhen all the observed values were the same (e.g.,[0, 0, 0, 0, 0]).TruncatedNormalwhensigmawas constant andmuwas being automatically broadcasted to match the shape of observations.
- Warning floods and compiledir locking (see #4444)
- ⚠ a problem with
math.log1mexp_numpyno longer raises RuntimeWarning when given very small inputs. These were commonly observed during NUTS sampling (see #4428).ScalarSharedVariablecan now be used as an input to other RVs directly (see #4445).pm.sampleandpm.find_MAPno longer change thestartargument (see #4458).- Fixed
Dirichlet.logpmethod to work with unit batch or event shapes (see #4454). - Bugfix in logp and logcdf methods of
Triangulardistribution (see #4470).
Release manager for 3.11.1: Michael Osthege (@michaelosthege)
This release breaks some APIs w.r.t. 3.10.0. It also brings some dreadfully awaited fixes, so be sure to go through the (breaking) changes below.
- ⚠ Many plotting and diagnostic functions that were just aliasing ArviZ functions were removed (see 4397). This includes
pm.summary,pm.traceplot,pm.essand many more! - ⚠ We now depend on
Theano-PyMCversion1.1.0exactly (see #4405). Major refactorings were done inTheano-PyMC1.1.0. If you implement customOps or interact with Theano in any way yourself, make sure to read the Theano-PyMC 1.1.0 release notes. - ⚠ Python 3.6 support was dropped (by no longer testing) and Python 3.9 was added (see #4332).
- ⚠ Changed shape behavior: No longer collapse length 1 vector shape into scalars. (see #4206 and #4214)
- Applies to random variables and also the
.random(size=...)kwarg! - To create scalar variables you must now use
shape=Noneorshape=(). shape=(1,)andshape=1now become vectors. Previously they were collapsed into scalars- 0-length dimensions are now ruled illegal for random variables and raise a
ValueError.
- Applies to random variables and also the
- In
sample_prior_predictivethevarskwarg was removed in favor ofvar_names(see #4327). - Removed
theanof.set_theano_configbecause it illegally changed Theano's internal state (see #4329).
- Option to set
check_bounds=Falsewhen instantiatingpymc.Model(). This turns off bounds checks that ensure that input parameters of distributions are valid. For correctly specified models, this is unnecessary as all parameters get automatically transformed so that all values are valid. Turning this off should lead to faster sampling (see #4377). OrderedProbitdistribution added (see #4232).plot_posterior_predictive_glmnow works witharviz.InferenceDataas well (see #4234)- Add
logcdfmethod to all univariate discrete distributions (see #4387). - Add
randommethod toMvGaussianRandomWalk(see #4388) AsymmetricLaplacedistribution added (see #4392).DirichletMultinomialdistribution added (see #4373).- Added a new
predictmethod toBARTto compute out of sample predictions (see #4310).
- Fixed bug whereby partial traces returns after keyboard interrupt during parallel sampling had fewer draws than would've been available #4318
- Make
sample_shapesame across all contexts indraw_values(see #4305). - The notebook gallery has been moved to https://github.com/pymc-devs/pymc-examples (see #4348).
math.logsumexpnow matchesscipy.special.logsumexpwhen arrays contain infinite values (see #4360).- Fixed mathematical formulation in
MvStudentTrandom method. (see #4359) - Fix issue in
logpmethod ofHyperGeometric. It now returns-inffor invalid parameters (see 4367) - Fixed
MatrixNormalrandom method to work with parameters as random variables. (see #4368) - Update the
logcdfmethod of several continuous distributions to return -inf for invalid parameters and values, and raise an informative error when multiple values cannot be evaluated in a single call. (see 4393 and #4421) - Improve numerical stability in
logpandlogcdfmethods ofExGaussian(see #4407) - Issue UserWarning when doing prior or posterior predictive sampling with models containing Potential factors (see #4419)
- Dirichlet distribution's
randommethod is now optimized and gives outputs in correct shape (see #4416) - Attempting to sample a named model with SMC will now raise a
NotImplementedError. (see #4365)
Release manager for 3.11.0: Eelke Spaak (@Spaak)
This is a major release with many exciting new features. The biggest change is that we now rely on our own fork of Theano-PyMC. This is in line with our big announcement about our commitment to PyMC3 and Theano.
When upgrading, make sure that Theano-PyMC and not Theano are installed (the imports remain unchanged, however). If not, you can uninstall Theano:
conda remove theano
And to install:
conda install -c conda-forge theano-pymc
Or, if you are using pip (not recommended):
pip uninstall theano
And to install:
pip install theano-pymc
This new version of Theano-PyMC comes with an experimental JAX backend which, when combined with the new and experimental JAX samplers in PyMC3, can greatly speed up sampling in your model. As this is still very new, please do not use it in production yet but do test it out and let us know if anything breaks and what results you are seeing, especially speed-wise.
- New experimental JAX samplers in
pymc.sample_jax(see notebook and #4247). Requires JAX and either TFP or numpyro. - Add MLDA, a new stepper for multilevel sampling. MLDA can be used when a hierarchy of approximate posteriors of varying accuracy is available, offering improved sampling efficiency especially in high-dimensional problems and/or where gradients are not available (see #3926)
- Add Bayesian Additive Regression Trees (BARTs) #4183)
- Added
pymc.gp.cov.Circularkernel for Gaussian Processes on circular domains, e.g. the unit circle (see #4082). - Added a new
MixtureSameFamilydistribution to handle mixtures of arbitrary dimensions in vectorized form for improved speed (see #4185). sample_posterior_predictive_wcan now feed onxarray.Dataset- e.g. fromInferenceData.posterior. (see #4042)- Change SMC metropolis kernel to independent metropolis kernel #4115)
- Add alternative parametrization to NegativeBinomial distribution in terms of n and p (see #4126)
- Added semantically meaningful
strrepresentations to PyMC3 objects for console, notebook, and GraphViz use (see #4076, #4065, #4159, #4217, #4243, and #4260). - Add Discrete HyperGeometric Distribution (see #4249)
- Switch the dependency of Theano to our own fork, Theano-PyMC.
- Removed non-NDArray (Text, SQLite, HDF5) backends and associated tests.
- Use dill to serialize user defined logp functions in
DensityDist. The previous serialization code fails if it is used in notebooks on Windows and Mac.dillis now a required dependency. (see #3844). - Fixed numerical instability in ExGaussian's logp by preventing
logpowfrom returning-inf(see #4050). - Numerically improved stickbreaking transformation - e.g. for the
Dirichletdistribution. #4129 - Enabled the
Multinomialdistribution to handle batch sizes that have more than 2 dimensions. #4169 - Test model logp before starting any MCMC chains (see #4211)
- Fix bug in
model.check_test_pointthat caused thetest_pointargument to be ignored. (see PR #4211) - Refactored MvNormal.random method with better handling of sample, batch and event shapes. #4207
- The
InverseGammadistribution now implements alogcdf. #3944 - Make starting jitter methods for nuts sampling more robust by resampling values that lead to non-finite probabilities. A new optional argument
jitter-max-retriescan be passed topm.sample()andpm.init_nuts()to control the maximum number of retries per chain. 4298
- Added a new notebook demonstrating how to incorporate sampling from a conjugate Dirichlet-multinomial posterior density in conjunction with other step methods (see #4199).
- Mentioned the way to do any random walk with
theano.tensor.cumsum()inGaussianRandomWalkdocstrings (see #4048).
Release manager for 3.10.0: Eelke Spaak (@Spaak)
- Introduce optional arguments to
pm.sample:mp_ctxto control how the processes for parallel sampling are started, andpickle_backendto specify which library is used to pickle models in parallel sampling when the multiprocessing context is not of typefork(see #3991). - Add sampler stats
process_time_diff,perf_counter_diffandperf_counter_start, that record wall and CPU times for each NUTS and HMC sample (see #3986). - Extend
keep_sizeargument handling forsample_posterior_predictiveandfast_sample_posterior_predictive, to work on ArviZInferenceDataand xarrayDatasetinput values (see PR #4006 and issue #4004). - SMC-ABC: add the Wasserstein and energy distance functions. Refactor API, the distance, sum_stats and epsilon arguments are now passed
pm.Simulatorinstead ofpm.sample_smc. Add random method topm.Simulator. Add option to save the simulated data. Improved LaTeX representation #3996. - SMC-ABC: Allow use of potentials by adding them to the prior term. #4016.
- Fix an error on Windows and Mac where error message from unpickling models did not show up in the notebook, or where sampling froze when a worker process crashed (see #3991).
- Require Theano >= 1.0.5 (see #4032).
- Notebook on multilevel modeling has been rewritten to showcase ArviZ and xarray usage for inference result analysis (see #3963).
NB: The docs/* folder is still removed from the tarball due to an upload size limit on PyPi.
Release manager for 3.9.3: Kyle Beauchamp (@kyleabeauchamp)
- Warning added in GP module when
input_dimis lower than the number of columns inXto compute the covariance function (see #3974). - Pass the
tuneargument fromsamplewhen usingadvi+adapt_diag_grad(see issue #3965, fixed by #3979). - Add simple test case for new coords and dims feature in
pm.Model(see #3977). - Require ArviZ >= 0.9.0 (see #3977).
- Fixed issue #3962 by making a change in the
_random()method ofGaussianRandomWalkclass (see PR #3985). Further testing revealed a new issue which is being tracked by #4010.
NB: The docs/* folder is still removed from the tarball due to an upload size limit on PyPi.
Release manager for 3.9.2: Alex Andorra (@AlexAndorra)
The v3.9.0 upload to PyPI didn't include a tarball, which is fixed in this release.
Though we had to temporarily remove the docs/* folder from the tarball due to a size limit.
Release manager for 3.9.1: Michael Osthege (@michaelosthege)
- Use fastprogress instead of tqdm #3693.
DEMetropoliscan now tune bothlambdaandscalingparameters, but by default neither of them are tuned. See #3743 for more info.DEMetropolisZ, an improved variant ofDEMetropolisbrings better parallelization and higher efficiency with fewer chains with a slower initial convergence. This implementation is experimental. See #3784 for more info.- Notebooks that give insight into
DEMetropolis,DEMetropolisZand theDifferentialEquationinterface are now located in the Tutorials/Deep Dive section. - Add
fast_sample_posterior_predictive, a vectorized alternative tosample_posterior_predictive. This alternative is substantially faster for large models. - GP covariance functions can now be exponentiated by a scalar. See PR #3852
sample_posterior_predictivecan now feed onxarray.Dataset- e.g. fromInferenceData.posterior. (see #3846)SamplerReport(MultiTrace.report) now has propertiesn_tune,n_draws,t_samplingfor increased convenience (see #3827)pm.sample(..., return_inferencedata=True)can now directly return the trace asarviz.InferenceData(see #3911)pm.samplenow has support for adapting dense mass matrix usingQuadPotentialFullAdapt(see #3596, #3705, #3858, and #3893). Useinit="adapt_full"orinit="jitter+adapt_full"to use.Moyaldistribution added (see #3870).pm.LKJCholeskyCovnow automatically computes and returns the unpacked Cholesky decomposition, the correlations and the standard deviations of the covariance matrix (see #3881).pm.Datacontainer can now be used for index variables, i.e with integer data and not only floats (issue #3813, fixed by #3925).pm.Datacontainer can now be used as input for other random variables (issue #3842, fixed by #3925).- Allow users to specify coordinates and dimension names instead of numerical shapes when specifying a model. This makes interoperability with ArviZ easier. (see #3551)
- Plots and Stats API sections now link to ArviZ documentation #3927
- Add
SamplerReportwith propertiesn_draws,t_samplingandn_tuneto SMC.n_tuneis always 0 #3931. - SMC-ABC: add option to define summary statistics, allow to sample from more complex models, remove redundant distances #3940
- Tuning results no longer leak into sequentially sampled
Metropolischains (see #3733 and #3796). - We'll deprecate the
TextandSQLitebackends and thesave_trace/load_tracefunctions, since this is now done with ArviZ. (see #3902) - ArviZ
v0.8.3is now the minimum required version - In named models,
pm.Dataobjects now get model-relative names (see #3843). -
pm.samplenow takes 1000 draws and 1000 tuning samples by default, instead of 500 previously (see #3855). - Moved argument division out of
NegativeBinomialrandommethod. Fixes #3864 in the style of #3509. - The Dirichlet distribution now raises a ValueError when it's initialized with <= 0 values (see #3853).
- Dtype bugfix in
MvNormalandMvStudentT(see 3836). - End of sampling report now uses
arviz.InferenceDatainternally and avoids storing pointwise log likelihood (see #3883). - The multiprocessing start method on MacOS is now set to "forkserver", to avoid crashes (see issue #3849, solved by #3919).
- The AR1 logp now uses the precision of the whole AR1 process instead of just the innovation precision (see issue #3892, fixed by #3899).
- Forced the
Betadistribution'srandommethod to generate samples that are in the open interval$(0, 1)$ , i.e. no value can be equal to zero or equal to one (issue #3898 fixed by #3924). - Fixed an issue that happened on Windows, that was introduced by the clipped beta distribution rvs function (#3924). Windows does not support the
float128dtype, but we had assumed that it had to be available. The solution was to only supportfloat128on Linux and Darwin systems (see issue #3929 fixed by #3930).
- Remove
sample_ppcandsample_ppc_wthat were deprecated in 3.6. - Deprecated
sdhas been replaced bysigma(already in version 3.7) in continuous, mixed and timeseries distributions and now raisesDeprecationWarningwhensdis used. (see #3837 and #3688). - We'll deprecate the
TextandSQLitebackends and thesave_trace/load_tracefunctions, since this is now done with ArviZ. (see #3902) - Dropped some deprecated kwargs and functions (see #3906)
- Dropped the outdated 'nuts' initialization method for
pm.sample(see #3863).
Release manager for 3.9.0: Michael Osthege (@michaelosthege)
- Implemented robust u turn check in NUTS (similar to stan-dev/stan#2800). See PR [#3605]
- Add capabilities to do inference on parameters in a differential equation with
DifferentialEquation. See #3590 and #3634. - Distinguish between
DataandDeterministicvariables when graphing models with graphviz. PR #3491. - Sequential Monte Carlo - Approximate Bayesian Computation step method is now available. The implementation is in an experimental stage and will be further improved.
- Added
Matern12covariance function for Gaussian processes. This is the Matern kernel with nu=1/2. - Progressbar reports number of divergences in real time, when available #3547.
- Sampling from variational approximation now allows for alternative trace backends [#3550].
- Infix
@operator now works with random variables and deterministics #3619. - ArviZ is now a requirement, and handles plotting, diagnostics, and statistical checks.
- Can use GaussianRandomWalk in sample_prior_predictive and sample_prior_predictive #3682
- Now 11 years of S&P returns in data set#3682
- Moved math operations out of
Rice,TruncatedNormal,TriangularandZeroInflatedNegativeBinomialrandommethods. Math operations on values returned bydraw_valuesmight not broadcast well, and all thesizeaware broadcasting is left togenerate_samples. Fixes #3481 and #3508 - Parallelization of population steppers (
DEMetropolis) is now set via thecoresargument. (#3559) - Fixed a bug in
Categorical.logp. In the case of multidimensionalp's, the indexing was done wrong leading to incorrectly shaped tensors that consumedO(n**2)memory instead ofO(n). This fixes issue #3535 - Fixed a defect in
OrderedLogistic.__init__that unnecessarily increased the dimensionality of the underlyingp. Related to issue issue #3535 but was not the true cause of it. - SMC: stabilize covariance matrix 3573
- SMC: is no longer a step method of
pm.samplenow it should be called usingpm.sample_smc3579 - SMC: improve computation of the proposal scaling factor 3594 and 3625
- SMC: reduce number of logp evaluations 3600
- SMC: remove
scalingandtune_scalingarguments as is a better idea to always allow SMC to automatically compute the scaling factor 3625 - Now uses
multiprocessongrather thanpsutilto count CPUs, which results in reliable core counts on Chromebooks. sample_posterior_predictivenow preallocates the memory required for its output to improve memory usage. Addresses problems raised in this discourse thread.- Fixed a bug in
Categorical.logp. In the case of multidimensionalp's, the indexing was done wrong leading to incorrectly shaped tensors that consumedO(n**2)memory instead ofO(n). This fixes issue #3535 - Fixed a defect in
OrderedLogistic.__init__that unnecessarily increased the dimensionality of the underlyingp. Related to issue issue #3535 but was not the true cause of it. - Wrapped
DensityDist.randwithgenerate_samplesto make it aware of the distribution's shape. Added control flow attributes to still be able to behave as in earlier versions, and to control how to interpret thesizeparameter in therandomcallable signature. Fixes 3553 - Added
theano.gof.graph.Constantto type checks done in_draw_value(fixes issue 3595) HalfNormaldid not used to work properly indraw_values,sample_prior_predictive, orsample_posterior_predictive(fixes issue 3686)- Random variable transforms were inadvertently left out of the API documentation. Added them. (See PR 3690).
- Refactored
pymc.model.get_named_nodes_and_relationsto use the ancestors and descendents, in a way that is consistent withtheano's naming convention. - Changed the way in which
pymc.model.get_named_nodes_and_relationscomputes nodes without ancestors to make it robust to changes in var_name orderings (issue #3643)
- 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_datato update variables defined asData. Mixturenow supports mixtures of multidimensional probability distributions, not just lists of 1D distributions.GLM.from_formulaandLinearComponent.from_formulacan extract variables from the calling scope. Customizable via the neweval_envargument. Fixing #3382.- Added the
distributions.shape_utilsmodule with functions used to help broadcast samples drawn from distributions using thesizekeyword argument. - Used
numpy.vectorizeindistributions.distribution._compile_theano_function. This enablessample_prior_predictiveandsample_posterior_predictiveto ask for tuples of samples instead of just integers. This fixes issue #3422.
- All occurrences of
sdas a parameter name have been renamed tosigma.sdwill continue to function for backwards compatibility. HamiltonianMCwas ignoring certain arguments liketarget_accept, and not using the custom step size jitter function with expectation 1.- Made
BrokenPipeErrorfor parallel sampling more verbose on Windows. - Added the
broadcast_distribution_samplesfunction that helps broadcasting arrays of drawn samples, taking into account the requestedsizeand the inferred distribution shape. This sometimes is needed by distributions that call severalrvsseparately within theirrandommethod, such as theZeroInflatedPoisson(fixes issue #3310). - The
Wald,Kumaraswamy,LogNormal,Pareto,Cauchy,HalfCauchy,WeibullandExGaussiandistributionsrandommethod used a hidden_randomfunction 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 (fixes issue #3122).
- The
draw_valuesfunction was too permissive with what could be grabbed from insidepoint, which lead to an error when sampling posterior predictives of variables that depended on shared variables that had changed their shape afterpm.sample()had been called (fix issue #3346). draw_valuesnow adds the theano graph descendants ofTensorConstantorSharedVariablesto the named relationship nodes stack, only if these descendants areObservedRVorMultiObservedRVinstances (fixes issue #3354).- 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 oftensordotfor Cholesky encoded covariances. This lead to wrong axis broadcasting and seemed to be the cause for issue #3343. - Fixed defect in
Mixture.randomwhen 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.randomto allow better use of vectorized calls tocomp_dists.random. - Added tests for mixtures of multidimensional distributions to the test suite.
- Fixed incorrect usage of
broadcast_distribution_samplesinDiscreteWeibull. Mixture's default dtype is now determined bytheano.config.floatX.dist_math.random_choicenow handles nd-arrays of category probabilities, and also handles sizes that are notNone. Also removed unusedkkwarg fromdist_math.random_choice.- Changed
Categorical.modeto preserve all the dimensions ofpexcept the last one, which encodes each category's probability. - Changed initialization of
Categorical.p.pis now normalized to sum to1insidelogpandrandom, but not during initialization. This could hide negative values supplied topas mentioned in #2082. Categoricalnow accepts elements ofpequal to0.logpwill return-infif there arevaluesthat index to the zero probability categories.- Add
sigma,tau, andsdto signature ofNormalMixture. - 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 (fixes issue #3248).
- Converted all calls to
pm.distributions.bound._ContinuousBoundedandpm.distributions.bound._DiscreteBoundedto use only and all positional arguments (fixes issue #3399). - Restructured
distributions.distribution.generate_samplesto use theshape_utilsmodule. This solves issues #3421 and #3147 by using thesizeaware broadcating functions inshape_utils. - Fixed the
Multinomial.randomandMultinomial.random_methods to make them compatible with the newgenerate_samplesfunction. In the process, a bug of theMultinomial.random_shape handling was discovered and fixed. - Fixed a defect found in
Bound.randomwhere thepointdictionary was passed togenerate_samplesas anarginstead of innot_broadcast_kwargs. - Fixed a defect found in
Bound.random_wheretotal_sizecould end up as afloat64instead of being an integer if givensize=tuple(). - Fixed an issue in
model_graphthat caused construction of the graph of the model for rendering to hang: replaced a search over the powerset of the nodes with a breadth-first search over the nodes. Fix for #3458. - Removed variable annotations from
model_graphbut left type hints (Fix for #3465). This means that we supportpython>=3.5.4. - Default
target_acceptforHamiltonianMCis now 0.65, as suggested in Beskos et. al. 2010 and Neal 2001. - Fixed bug in
draw_valuesthat lead to intermittent errors in python3.5. This happened with some deterministic nodes that were drawn but not added togivens.
nuts_kwargsandstep_kwargshave been deprecated in favor of using the standardkwargsto pass optional step method arguments.SGFSandCSGhave been removed (Fix for #3353). They have been moved to pymc-experimental.- References to
live_plotand corresponding notebooks have been removed. - Function
approx_hessianwas removed, due tonumdifftoolsbecoming incompatible with currentscipy. The function was already optional, only available to a user who installednumdifftoolsseparately, and not hit on any common codepaths. #3485. - Deprecated
varsparameter ofsample_posterior_predictivein favor ofvarnames. - References to
live_plotand corresponding notebooks have been removed. - Deprecated
varsparameters ofsample_posterior_predictiveandsample_prior_predictivein favor ofvar_names. At least for the latter, this is more accurate, since thevarsparameter actually took names.
45 Luciano Paz
38 Thomas Wiecki
23 Colin Carroll
19 Junpeng Lao
15 Chris Fonnesbeck
13 Juan Martín Loyola
13 Ravin Kumar
8 Robert P. Goldman
5 Tim Blazina
4 chang111
4 adamboche
3 Eric Ma
3 Osvaldo Martin
3 Sanmitra Ghosh
3 Saurav Shekhar
3 chartl
3 fredcallaway
3 Demetri
2 Daisuke Kondo
2 David Brochart
2 George Ho
2 Vaibhav Sinha
1 rpgoldman
1 Adel Tomilova
1 Adriaan van der Graaf
1 Bas Nijholt
1 Benjamin Wild
1 Brigitta Sipocz
1 Daniel Emaasit
1 Hari
1 Jeroen
1 Joseph Willard
1 Juan Martin Loyola
1 Katrin Leinweber
1 Lisa Martin
1 M. Domenzain
1 Matt Pitkin
1 Peadar Coyle
1 Rupal Sharma
1 Tom Gilliss
1 changjiangeng
1 michaelosthege
1 monsta
1 579397
This will be the last release to support Python 2.
- 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_predictiveis 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._DrawValuesContextcontext manager. This is used to store the values already drawn in nestedrandomanddraw_valuescalls, enablingdraw_valuesto draw samples from the joint probability distribution of RVs and not the marginals. Custom distributions that must calldraw_valuesseveral times in theirrandommethod, or that invoke many calls to other distribution'srandommethods (e.g. mixtures) must do all of these calls under the same_DrawValuesContextcontext manager instance. If they do not, the conditional relations between the distribution's parameters could be broken, andrandomcould return values drawn from an incorrect distribution. Ricedistribution is now defined with either the noncentrality parameter or the shape parameter (#3287).
- Big rewrite of documentation (#3275)
- Fixed Triangular distribution
cattribute handling inrandomand updated sample codes for consistency (#3225) - Refactor SMC and properly compute marginal likelihood (#3124)
- Removed use of deprecated
yminkeyword in matplotlib'sAxes.set_ylim(#3279) - Fix for #3210. Now
distribution.draw_values(params), will draw theparamsvalues 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._randommethod to better handle shape broadcasting (#3271) - Fixed
Ricedistribution, which inconsistently mixed two parametrizations (#3286). Ricedistribution now accepts multiple parameters and observations and is usable with NUTS (#3289).sample_posterior_predictiveno longer callsdraw_valuesto initialize the shape of the ppc trace. This called could lead toValueError's when sampling the ppc from a model withFlatorHalfFlatprior distributions (Fix issue #3294).- Added explicit conversion to
floatXandint32for the continuous and discrete probability distribution parameters (addresses issue #3223).
- Renamed
sample_ppc()andsample_ppc_w()tosample_posterior_predictive()andsample_posterior_predictive_w(), respectively.
- Add documentation section on survival analysis and censored data models
- Add
check_test_pointmethod topm.Model - Add
OrderedTransformation andOrderedLogisticdistribution - Add
Chaintransformation - Improve error message
Mass matrix contains zeros on the diagonal. Some derivatives might always be zeroduring tuning ofpm.sample - Improve error message
NaN occurred in optimization.during ADVI - Save and load traces without
pickleusingpm.save_traceandpm.load_trace - Add
Kumaraswamydistribution - Add
TruncatedNormaldistribution - 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_predictivewhich 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 dependencygraphviz) 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__toSingleGroupApproximationto improve autocompletion in interactive environments
- Fixed grammar in divergence warning, previously
There were 1 divergences ...could be raised. - Fixed
KeyErrorraised when only subset of variables are specified to be recorded in the trace. - Removed unused
repeat=Nonearguments from allrandom()methods in distributions. - Deprecated the
sigmaargument inMarginalSparse.marginal_likelihoodin favor ofnoise - Fixed unexpected behavior in
random. Now therandomfunctionality is more robust and will work better forsample_priorwhen that is implemented. - Fixed
scale_cost_to_minibatchbehaviour, previously this was not working and alwaysFalse
- Add
logit_pkeyword topm.Bernoulli, so that users can specify the logit of the success probability. This is faster and more stable than usingp=tt.nnet.sigmoid(logit_p). - Add
randomkeyword topm.DensityDistthus enabling users to pass custom random method which in turn makes sampling from aDensityDistpossible. - 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_nnow can reports N_eff>N. - Added
KroneckerNormaldistribution and a correspondingMarginalKronGaussian Process implementation for efficient inference, along with lower-level functions such ascartesianandkroneckerproducts. - Added
Coregioncovariance 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 then. - Add
offsetkwarg to.glm. - Changed the
comparefunction 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).
VonMisesdoes 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
bwcontrolling 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
randommethod, 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,theanowould try to compile it and fail to find inputs, raising atheano.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 betheano.tensor.TensorConstants ortheano.tensor.sharedvar.SharedVariables. Nevertheless, indistribution._draw_value, these would be passed todistribution._compile_theano_functionas if they weretheano.tensor.TensorVariables. This could lead to the following exceptionsTypeError: ('Constants not allowed in param list', ...)orTypeError: Cannot use a shared variable (...). The fix was to not addtheano.tensor.TensorConstantortheano.tensor.sharedvar.SharedVariablenamed nodes into thegivensdict that could be used indistribution._compile_theano_function. - Exponential support changed to include zero values.
- DIC and BPIC calculations have been removed
- df_summary have been removed, use summary instead
njobsandnchainskwarg are deprecated in favor ofcoresandchainsforsamplelagkwarg inpm.stats.autocorrandpm.stats.autocovis deprecated.
- Improve NUTS initialization
advi+adapt_diag_gradand addjitter+adapt_diag_grad(#2643) - Added
MatrixNormalclass for representing vectors of multivariate normal variables - Implemented
HalfStudentTdistribution - New benchmark suite added (see http://pandas.pydata.org/speed/pymc/)
- 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, theDEMetropolissampler 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)
- Fixed
compareplotto useloooutput. - Improved
posteriorplotto scale fonts sample_ppc_wnow broadcastsdf_summaryfunction renamed tosummary- Add test for
model.logp_arrayandmodel.bijection(#2724) - Fixed
sample_ppcandsample_ppc_wto 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)
- Old (
minibatch-)adviis removed (#2781)
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 andApproximationobjects. These make it easier to extend existingvariationalclasses, and to derive inference fromvariationaloptimizations, respectively. Thevariationalmodule now also includes normalizing flows (NFVI). - Bill Engels added an extensive new Gaussian processes (
gp) module. Standard GPs can be specified using eitherLatentorMarginalclasses, depending on the nature of the underlying function. A Student-T processTPhas been added. In order to accommodate 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.
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. PyMC3 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.
The following people contributed to this release (ordered by number of commits):
Maxim Kochurov maxim.v.kochurov@gmail.com Bill Engels w.j.engels@gmail.com Chris Fonnesbeck chris.fonnesbeck@vanderbilt.edu Junpeng Lao junpeng.lao@unifr.ch Adrian Seyboldt adrian.seyboldt@gmail.com AustinRochford arochford@monetate.com Osvaldo Martin aloctavodia@gmail.com Colin Carroll colcarroll@gmail.com Hannes Vasyura-Bathke hannes.bathke@gmx.net Thomas Wiecki thomas.wiecki@gmail.com michaelosthege thecakedev@hotmail.com Marco De Nadai me@marcodena.it Kyle Beauchamp kyleabeauchamp@gmail.com Massimo mcavallaro@users.noreply.github.com ctm22396 ctm22396@gmail.com Max Horn maexlich@gmail.com Hennadii Madan madanh2014@gmail.com Hassan Naseri h.nasseri@gmail.com Peadar Coyle peadarcoyle@googlemail.com Saurav R. Tuladhar saurav@fastmail.com Shashank Shekhar shashank.f1@gmail.com Eric Ma ericmjl@users.noreply.github.com Ed Herbst ed.herbst@gmail.com tsdlovell dlovell@twosigma.com zaxtax zaxtax@users.noreply.github.com Dan Nichol daniel.nichol@univ.ox.ac.uk Benjamin Yetton bdyetton@gmail.com jackhansom jack.hansom@outlook.com Jack Tsai jacksctsai@gmail.com Andrés Asensio Ramos aasensioramos@gmail.com
-
New user forum at http://discourse.pymc.io
-
Much improved variational inference support:
-
Add Stein-Variational Gradient Descent as well as Amortized SVGD (experimental).
-
Added various optimizers including ADAM.
-
Stopping criterion implemented via callbacks.
-
sample() defaults changed: tuning is enabled for the first 500 samples which are then discarded from the trace as burn-in.
-
MvNormal supports Cholesky Decomposition now for increased speed and numerical stability.
-
Many optimizations and speed-ups.
-
NUTS implementation now matches current Stan implementation.
-
Add higher-order integrators for HMC.
-
ADVI stopping criterion implemented.
-
Improved support for theano's floatX setting to enable GPU computations (work in progress).
-
MvNormal supports Cholesky Decomposition now for increased speed and numerical stability.
-
Added support for multidimensional minibatches
-
Added
Approximationclass and the ability to convert a sampled trace into an approximation via itsEmpiricalsubclass. -
Modelcan now be inherited from and act as a base class for user specified models (see pymc.models.linear). -
Add MvGaussianRandomWalk and MvStudentTRandomWalk distributions.
-
GLM models do not need a left-hand variable anymore.
-
Refactored HMC and NUTS for better readability.
-
Add support for Python 3.6.
-
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.
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.
Since the beta release last year, the following improvements have been implemented:
-
Added
variationalsubmodule, 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
samplefunction. -
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
joblibfor managing parallel computation of chains. -
Added contributor guidelines, contributor code of conduct and governance document.
- 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).
MvNormalcalling 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.
The following authors contributed to this release:
Chris Fonnesbeck chris.fonnesbeck@vanderbilt.edu John Salvatier jsalvatier@gmail.com Thomas Wiecki thomas.wiecki@gmail.com Colin Carroll colcarroll@gmail.com Maxim Kochurov maxim.v.kochurov@gmail.com Taku Yoshioka taku.yoshioka.4096@gmail.com Peadar Coyle (springcoil) peadarcoyle@googlemail.com Austin Rochford arochford@monetate.com Osvaldo Martin aloctavodia@gmail.com Shashank Shekhar shashank.f1@gmail.com
In addition, the following community members contributed to this release:
A Kuz for.akuz@gmail.com A. Flaxman abie@alum.mit.edu Abraham Flaxman abie@alum.mit.edu Alexey Goldin alexey.goldin@gmail.com Anand Patil anand.prabhakar.patil@gmail.com Andrea Zonca code@andreazonca.com Andreas Klostermann andreasklostermann@googlemail.com Andres Asensio Ramos Andrew Clegg andrew.clegg@pearson.com Anjum48 Benjamin Edwards bedwards@cs.unm.edu Boris Avdeev borisaqua@gmail.com Brian Naughton briannaughton@gmail.com Byron Smith Chad Heyne chadheyne@gmail.com Corey Farwell coreyf@rwell.org David Huard david.huard@gmail.com David Stück dstuck@users.noreply.github.com DeliciousHair mshepit@gmail.com Dustin Tran Eigenblutwurst Hannes.Bathke@gmx.net Gideon Wulfsohn gideon.wulfsohn@gmail.com Gil Raphaelli g@raphaelli.com Gogs gogitservice@gmail.com Ilan Man Imri Sofer imrisofer@gmail.com Jake Biesinger jake.biesinger@gmail.com James Webber jamestwebber@gmail.com John McDonnell john.v.mcdonnell@gmail.com Jon Sedar jon.sedar@applied.ai Jordi Diaz Jordi Warmenhoven jordi.warmenhoven@gmail.com Karlson Pfannschmidt kiudee@mail.uni-paderborn.de Kyle Bishop citizenphnix@gmail.com Kyle Meyer kyle@kyleam.com Lin Xiao Mack Sweeney mackenzie.sweeney@gmail.com Matthew Emmett memmett@unc.edu Michael Gallaspy gallaspy.michael@gmail.com Nick nalourie@example.com Osvaldo Martin aloctavodia@gmail.com Patricio Benavente patbenavente@gmail.com Raymond Roberts Rodrigo Benenson rodrigo.benenson@gmail.com Sergei Lebedev superbobry@gmail.com Skipper Seabold chris.fonnesbeck@vanderbilt.edu Thomas Kluyver takowl@gmail.com Tobias Knuth mail@tobiasknuth.de Volodymyr Kazantsev Wes McKinney wesmckinn@gmail.com Zach Ploskey zploskey@gmail.com akuz for.akuz@gmail.com brandon willard brandonwillard@gmail.com dstuck dstuck88@gmail.com ingmarschuster ingmar.schuster.linguistics@gmail.com jan-matthis mail@jan-matthis.de jason JasonTam22@gmailcom kiudee quietdeath@gmail.com maahnman github@mm.maahn.de macgyver neil.rabinowitz@merton.ox.ac.uk mwibrow mwibrow@gmail.com olafSmits o.smits@gmail.com paul sorenson paul@metrak.com redst4r redst4r@web.de santon steven.anton@idanalytics.com sgenoud stevegenoud+github@gmail.com stonebig Tal Yarkoni tyarkoni@gmail.com x2apps x2apps@yahoo.com zenourn daniel@zeno.co.nz
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.
- Transforms now automatically applied to constrained distributions
- Transforms now specified with a
transform=argument on Distributions.model.TransformedVaris 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)
- A. Flaxman abie@alum.mit.edu
- Andrea Zonca code@andreazonca.com
- Andreas Klostermann andreasklostermann@googlemail.com
- Andrew Clegg andrew.clegg@pearson.com
- AustinRochford arochford@monetate.com
- Benjamin Edwards bedwards@cs.unm.edu
- Brian Naughton briannaughton@gmail.com
- Chad Heyne chadheyne@gmail.com
- Chris Fonnesbeck fonnesbeck@gmail.com
- Corey Farwell coreyf@rwell.org
- John Salvatier jsalvatier@gmail.com
- Karlson Pfannschmidt quietdeath@gmail.com
- Kyle Bishop citizenphnix@gmail.com
- Kyle Meyer kyle@kyleam.com
- Mack Sweeney mackenzie.sweeney@gmail.com
- Osvaldo Martin aloctavodia@gmail.com
- Raymond Roberts rayvroberts@gmail.com
- Rodrigo Benenson rodrigo.benenson@gmail.com
- Thomas Wiecki thomas.wiecki@gmail.com
- Zach Ploskey zploskey@gmail.com
- maahnman github@mm.maahn.de
- paul sorenson paul@metrak.com
- zenourn daniel@zeno.co.nz