Skip to content

Commit

Permalink
Adapt and run blackbox likelihood tutorial with numpy (pymc-devs#28)
Browse files Browse the repository at this point in the history
* Add numpy version of blackbox likelihood notebook

* edit titles to distinguish the two different versions

* update numpy version of blackbox likelihood nb

* add target to custom distribution notebook

* add tags

* fix code block syntax

* rerun and fix section headings

* move section to right place

* review changes and rename

* address more review comments
  • Loading branch information
OriolAbril authored Dec 19, 2021
1 parent 212a201 commit 3290b46
Show file tree
Hide file tree
Showing 5 changed files with 906 additions and 7 deletions.
12 changes: 9 additions & 3 deletions examples/case_studies/blackbox_external_likelihood.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Using a \"black box\" likelihood function"
"(blackbox_external_likelihood)=\n",
"# Using a \"black box\" likelihood function (Cython)\n",
"\n",
":::{note}\n",
"This notebook in part of a set of two twin notebooks that perform the exact same task, this one\n",
"uses Cython whereas {ref}`this other one <blackbox_external_likelihood_numpy>` uses NumPy\n",
":::"
]
},
{
Expand Down Expand Up @@ -818,7 +824,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -832,7 +838,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.9.7"
}
},
"nbformat": 4,
Expand Down
890 changes: 890 additions & 0 deletions examples/case_studies/blackbox_external_likelihood_numpy.ipynb

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions examples/pymc3_howto/custom_distribution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"(custom_distribution)=\n",
"# Defining a Custom Distribution in PyMC3"
]
},
Expand Down Expand Up @@ -534,7 +535,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -548,7 +549,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.1"
"version": "3.9.7"
}
},
"nbformat": 4,
Expand Down
5 changes: 3 additions & 2 deletions examples/pymc3_howto/profiling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"(profiling)=\n",
"# Profiling\n",
"Sometimes computing the likelihood is not as fast as we would like. Theano provides handy profiling tools which are wrapped in PyMC3 by `model.profile`. This function returns a `ProfileStats` object conveying information about the underlying Theano operations. Here we'll profile the likelihood and gradient for the stochastic volatility example.\n",
"\n",
Expand Down Expand Up @@ -315,7 +316,7 @@
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -329,7 +330,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
"version": "3.9.7"
}
},
"nbformat": 4,
Expand Down
1 change: 1 addition & 0 deletions examples/table_of_contents_tutorials.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Gallery.contents = {
"samplers/DEMetropolisZ_tune_drop_fraction": "Deep dives",
"case_studies/factor_analysis": "Deep dives",
"case_studies/blackbox_external_likelihood": "How-To",
"case_studies/blackbox_external_likelihood_numpy": "How-To",
"pymc3_howto/profiling": "How-To",
"pymc3_howto/howto_debugging": "How-To",
"diagnostics_and_criticism/model_averaging": "How-To",
Expand Down

0 comments on commit 3290b46

Please sign in to comment.