Skip to content

Commit 3e1dcf6

Browse files
author
Tom Gilliss
committed
2 parents b18623b + 6b25adf commit 3e1dcf6

File tree

78 files changed

+4632
-4353
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+4632
-4353
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ benchmarks/env/
3232
benchmarks/html/
3333
benchmarks/results/
3434
.pytest_cache/
35+
36+
# VSCode
37+
.vscode/

.travis.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ before_install:
1818

1919
install:
2020
- . ./scripts/create_testenv.sh
21-
- pip install coveralls travis-sphinx==2.0.0
21+
- pip install coveralls
22+
- conda list && pip freeze
2223

2324
env:
24-
- FLOATX='float32' TESTCMD="--durations=10 --ignore=pymc3/tests/test_examples.py --cov-append --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py --ignore=pymc3/tests/test_sampling.py"
25-
- FLOATX='float32' RUN_PYLINT="true" TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py"
26-
- FLOATX='float32' TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_posteriors.py"
25+
- FLOATX='float32' TESTCMD="--durations=10 --ignore=pymc3/tests/test_examples.py --cov-append --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py --ignore=pymc3/tests/test_sampling.py --ignore=pymc3/tests/test_parallel_sampling.py --ignore=pymc3/tests/test_dist_math.py --ignore=pymc3/tests/test_distribution_defaults.py --ignore=pymc3/tests/test_distributions_timeseries.py --ignore=pymc3/tests/test_random.py --ignore=pymc3/tests/test_gp.py"
26+
- FLOATX='float32' RUN_PYLINT="true" TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py pymc3/tests/test_parallel_sampling.py pymc3/tests/test_dist_math.py pymc3/tests/test_distribution_defaults.py pymc3/tests/test_distributions_timeseries.py pymc3/tests/test_random.py"
27+
- FLOATX='float32' TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_posteriors.py pymc3/tests/test_gp.py"
2728
- FLOATX='float32' TESTCMD="--durations=10 --cov-append pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py"
28-
- FLOATX='float64' TESTCMD="--durations=10 --cov-append --ignore=pymc3/tests/test_examples.py --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py --ignore=pymc3/tests/test_sampling.py"
29-
- FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py"
30-
- FLOATX='float64' BUILD_DOCS="true" TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_posteriors.py"
29+
- FLOATX='float64' TESTCMD="--durations=10 --cov-append --ignore=pymc3/tests/test_examples.py --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py --ignore=pymc3/tests/test_sampling.py --ignore=pymc3/tests/test_parallel_sampling.py --ignore=pymc3/tests/test_dist_math.py --ignore=pymc3/tests/test_distribution_defaults.py --ignore=pymc3/tests/test_distributions_timeseries.py --ignore=pymc3/tests/test_random.py --ignore=pymc3/tests/test_gp.py"
30+
- FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py pymc3/tests/test_parallel_sampling.py pymc3/tests/test_dist_math.py pymc3/tests/test_distribution_defaults.py pymc3/tests/test_distributions_timeseries.py pymc3/tests/test_random.py"
31+
- FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_posteriors.py pymc3/tests/test_gp.py"
3132
- FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py"
3233

3334
script:
3435
- . ./scripts/test.sh $TESTCMD
3536
- . ./scripts/confirm_mpl_optional.sh
3637

3738
after_success:
38-
- if [[ "$BUILD_DOCS" == "true" ]]; then travis-sphinx deploy -c "docs.pymc.io"; fi
3939
- coveralls

README.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ Or via conda-forge:
7878

7979
conda install -c conda-forge pymc3
8080

81+
Plotting is done using `ArviZ <https://arviz-devs.github.io/arviz/>`__
82+
which may be installed separately, or along with PyMC3:
83+
84+
::
85+
86+
pip install pymc3[plots]
87+
8188
The current development branch of PyMC3 can be installed from GitHub, also using ``pip``:
8289

8390
::
@@ -169,7 +176,7 @@ page <https://github.com/pymc-devs/pymc3/graphs/contributors>`__
169176
Support
170177
=======
171178

172-
PyMC3 is a non-profit project under NumFOCUS umbrella. If you want to support PyMC3 financially, you can donate `here <https://www.flipcause.com/widget/widget_home/MTE4OTc=>`__.
179+
PyMC3 is a non-profit project under NumFOCUS umbrella. If you want to support PyMC3 financially, you can donate `here <https://numfocus.salsalabs.org/donate-to-pymc3/index.html>`__.
173180

174181
Sponsors
175182
========

RELEASE-NOTES.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,37 @@
44

55
### New features
66

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

12+
### Maintenance
913
- All occurances of `sd` as a parameter name have been renamed to `sigma`. `sd` will continue to function for backwards compatibility.
1014
- Made `BrokenPipeError` for parallel sampling more verbose on Windows.
1115
- 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).
1216
- 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).
17+
- Added a fix to allow the imputation of single missing values of observed data, which previously would fail (Fix issue #3122).
18+
- 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.
19+
- 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.
20+
- Fixed bug in broadcast_distrution_samples, which did not handle correctly cases in which some samples did not have the size tuple prepended.
21+
- 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.
22+
- 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.
23+
- Restructured `Mixture.random` to allow better use of vectorized calls to `comp_dists.random`.
24+
- Added tests for mixtures of multidimensional distributions to the test suite.
25+
- Fixed incorrect usage of `broadcast_distribution_samples` in `DiscreteWeibull`.
26+
- `Mixture`'s default dtype is now determined by `theano.config.floatX`.
27+
- `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`.
28+
- Changed `Categorical.mode` to preserve all the dimensions of `p` except the last one, which encodes each category's probability.
29+
- 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.
30+
- `Categorical` now accepts elements of `p` equal to `0`. `logp` will return `-inf` if there are `values` that index to the zero probability categories.
31+
- Add `sigma`, `tau`, and `sd` to signature of `NormalMixture`.
1332

1433
### Deprecations
1534

35+
- `nuts_kwargs` and `step_kwargs` have been deprecated in favor of using the standard `kwargs` to pass optional step method arguments.
36+
- `SGFS` and `CSG` have been removed (Fix for [#3353](https://github.com/pymc-devs/pymc3/issues/3353)). They have been moved to [pymc3-experimental](https://github.com/pymc-devs/pymc3-experimental).
37+
1638
## PyMC3 3.6 (Dec 21 2018)
1739

1840
This will be the last release to support Python 2.
@@ -491,4 +513,3 @@ Thus, Thomas, Chris and I are pleased to announce that PyMC3 is now in Beta.
491513
* maahnman <[email protected]>
492514
* paul sorenson <[email protected]>
493515
* zenourn <[email protected]>
494-

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127

128128
<div class="ui bottom attached segment">
129129
<h2 class="ui dividing header">Support and sponsors</h2>
130-
<p>PyMC3 is a non-profit project under NumFOCUS umbrella. If you want to support PyMC3 financially, you <a href="https://www.flipcause.com/widget/widget_home/MTE4OTc=">can donate here</a>.</p>
130+
<p>PyMC3 is a non-profit project under NumFOCUS umbrella. If you want to support PyMC3 financially, you <a href="https://numfocus.salsalabs.org/donate-to-pymc3/index.html">can donate here</a>.</p>
131131

132132
<div class="ui equal width grid">
133133
<div class="column">

docs/source/notebooks/BEST.ipynb

Lines changed: 59 additions & 58 deletions
Large diffs are not rendered by default.

docs/source/notebooks/Diagnosing_biased_Inference_with_Divergences.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@
10021002
"source": [
10031003
"with Centered_eight:\n",
10041004
" fit_cp85 = pm.sample(5000, chains=2, tune=2000,\n",
1005-
" nuts_kwargs=dict(target_accept=.85))"
1005+
" target_accept=.85)"
10061006
]
10071007
},
10081008
{
@@ -1029,7 +1029,7 @@
10291029
"source": [
10301030
"with Centered_eight:\n",
10311031
" fit_cp90 = pm.sample(5000, chains=2, tune=2000,\n",
1032-
" nuts_kwargs=dict(target_accept=.90))"
1032+
" target_accept=.90)"
10331033
]
10341034
},
10351035
{
@@ -1056,7 +1056,7 @@
10561056
"source": [
10571057
"with Centered_eight:\n",
10581058
" fit_cp95 = pm.sample(5000, chains=2, tune=2000,\n",
1059-
" nuts_kwargs=dict(target_accept=.95))"
1059+
" target_accept=.95)"
10601060
]
10611061
},
10621062
{
@@ -1083,7 +1083,7 @@
10831083
"source": [
10841084
"with Centered_eight:\n",
10851085
" fit_cp99 = pm.sample(5000, chains=2, tune=2000,\n",
1086-
" nuts_kwargs=dict(target_accept=.99))"
1086+
" target_accept=.99)"
10871087
]
10881088
},
10891089
{
@@ -1350,7 +1350,7 @@
13501350
"source": [
13511351
"with NonCentered_eight:\n",
13521352
" fit_ncp80 = pm.sample(5000, chains=2, tune=1000, random_seed=SEED,\n",
1353-
" nuts_kwargs=dict(target_accept=.80))"
1353+
" target_accept=.80)"
13541354
]
13551355
},
13561356
{
@@ -1708,7 +1708,7 @@
17081708
"source": [
17091709
"with NonCentered_eight:\n",
17101710
" fit_ncp90 = pm.sample(5000, chains=2, tune=1000, random_seed=SEED,\n",
1711-
" nuts_kwargs=dict(target_accept=.90))\n",
1711+
" target_accept=.90)\n",
17121712
" \n",
17131713
"# display the total number and percentage of divergent\n",
17141714
"divergent = fit_ncp90['diverging']\n",

docs/source/notebooks/GLM-hierarchical-binominal-model.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@
309309
" theta = pm.Beta('theta', alpha=ab[0], beta=ab[1], shape=N)\n",
310310
"\n",
311311
" p = pm.Binomial('y', p=theta, observed=y, n=n)\n",
312-
" trace = pm.sample(1000, tune=2000, nuts_kwargs={'target_accept': .95})\n",
312+
" trace = pm.sample(1000, tune=2000, target_accept=0.95)\n",
313313
" "
314314
]
315315
},

docs/source/notebooks/GLM-rolling-regression.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@
328328
"source": [
329329
"with model_randomwalk:\n",
330330
" trace_rw = pm.sample(tune=2000, cores=4, samples=200, \n",
331-
" nuts_kwargs=dict(target_accept=.9))"
331+
" target_accept=0.9)"
332332
]
333333
},
334334
{

docs/source/notebooks/GP-MaunaLoa2.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
],
261261
"source": [
262262
"with model:\n",
263-
" tr = pm.sample(1000, tune=1000, chains=2, cores=1, nuts_kwargs={\"target_accept\":0.95})"
263+
" tr = pm.sample(1000, tune=1000, chains=2, cores=1, target_accept=0.95)"
264264
]
265265
},
266266
{
@@ -595,7 +595,7 @@
595595
],
596596
"source": [
597597
"with model:\n",
598-
" tr = pm.sample(1000, tune=1000, chains=2, cores=1, nuts_kwargs={\"target_accept\":0.95})"
598+
" tr = pm.sample(1000, tune=1000, chains=2, cores=1, target_accept=0.95)"
599599
]
600600
},
601601
{
@@ -1084,7 +1084,7 @@
10841084
],
10851085
"source": [
10861086
"with model:\n",
1087-
" tr = pm.sample(500, chains=2, cores=1, nuts_kwargs={\"target_accept\": 0.95})"
1087+
" tr = pm.sample(500, chains=2, cores=1, target_accept=0.95)"
10881088
]
10891089
},
10901090
{

0 commit comments

Comments
 (0)