Skip to content

Commit

Permalink
Update notebook GLM-negative-binomial-regression to pymc v5 (#575)
Browse files Browse the repository at this point in the history
* Add seaborn to the requirements-docs.txt

* Update notebook GLM-negative-binomial-regression to pymc v5

* Run pre-commit

* Remove unrelated files, sort requirements alphabetically, edit notebook based on PR feedback

* Add seaborn to notebook extra dependency and remove from requirements-docs.txt

* get ready to merge

---------

Co-authored-by: Oriol Abril-Pla <[email protected]>
  • Loading branch information
wesleyboelrijk and OriolAbril authored Nov 23, 2023
1 parent 2861d6a commit 695a1b0
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 113 deletions.
207 changes: 104 additions & 103 deletions examples/generalized_linear_models/GLM-negative-binomial-regression.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,26 @@ jupytext:
format_name: myst
format_version: 0.13
kernelspec:
display_name: Python 3.9.12 ('pymc-dev-py39')
display_name: Python 3 (ipykernel)
language: python
name: python3
myst:
substitutions:
extra_dependencies: seaborn
---

(GLM-negative-binomial-regression)=
# GLM: Negative Binomial Regression

:::{post} June, 2022
:::{post} September, 2023
:tags: negative binomial regression, generalized linear model,
:category: beginner
:author: Ian Ozsvald, Abhipsha Das, Benjamin Vincent
:::

:::{include} ../extra_installs.md
:::

```{code-cell} ipython3
import arviz as az
import numpy as np
Expand All @@ -33,7 +39,7 @@ from scipy import stats
RANDOM_SEED = 8927
rng = np.random.default_rng(RANDOM_SEED)
%config InlineBackend.figure_format = 'retina'
%config InlineBackend.figure_format = "retina"
az.style.use("arviz-darkgrid")
```

Expand Down Expand Up @@ -221,19 +227,24 @@ Finally, the mean of `nsneeze_alpha` is also quite close to its actual value of

+++

See also, [`bambi's` negative binomial example](https://bambinos.github.io/bambi/master/notebooks/negative_binomial.html) for further reference.
See also, [`bambi's` negative binomial example](https://bambinos.github.io/bambi/notebooks/negative_binomial.html) for further reference.

+++

## Authors
- Created by [Ian Ozsvald](https://github.com/ianozsvald)
- Updated by [Abhipsha Das](https://github.com/chiral-carbon) in August 2021
- Updated by [Benjamin Vincent](https://github.com/drbenvincent) to PyMC v4 in June 2022
- Updated by [Wesley Boelrijk](https://github.com/wesleyboelrijk) to PyMC v5 in September 2023

```{code-cell} ipython3
%load_ext watermark
%watermark -n -u -v -iv -w -p pytensor,aeppl,xarray
%watermark -n -u -v -iv -w -p pytensor,xarray
```

:::{include} ../page_footer.md
:::

```{code-cell} ipython3
```
10 changes: 5 additions & 5 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ablog<0.11
matplotlib
myst-nb
sphinx-codeautolink
sphinx>=5
pymc-sphinx-theme==0.14
sphinx-design
sphinx-copybutton
sphinx-design
sphinx-notfound-page
sphinxcontrib-bibtex
ablog<0.11
sphinxext-opengraph
sphinx-codeautolink
sphinx-notfound-page
matplotlib
sphinxext-rediraffe

0 comments on commit 695a1b0

Please sign in to comment.