Skip to content

Commit 3290b46

Browse files
authored
Adapt and run blackbox likelihood tutorial with numpy (#28)
* 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
1 parent 212a201 commit 3290b46

5 files changed

+906
-7
lines changed

examples/case_studies/blackbox_external_likelihood.ipynb

+9-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Using a \"black box\" likelihood function"
7+
"(blackbox_external_likelihood)=\n",
8+
"# Using a \"black box\" likelihood function (Cython)\n",
9+
"\n",
10+
":::{note}\n",
11+
"This notebook in part of a set of two twin notebooks that perform the exact same task, this one\n",
12+
"uses Cython whereas {ref}`this other one <blackbox_external_likelihood_numpy>` uses NumPy\n",
13+
":::"
814
]
915
},
1016
{
@@ -818,7 +824,7 @@
818824
],
819825
"metadata": {
820826
"kernelspec": {
821-
"display_name": "Python 3",
827+
"display_name": "Python 3 (ipykernel)",
822828
"language": "python",
823829
"name": "python3"
824830
},
@@ -832,7 +838,7 @@
832838
"name": "python",
833839
"nbconvert_exporter": "python",
834840
"pygments_lexer": "ipython3",
835-
"version": "3.8.5"
841+
"version": "3.9.7"
836842
}
837843
},
838844
"nbformat": 4,

examples/case_studies/blackbox_external_likelihood_numpy.ipynb

+890
Large diffs are not rendered by default.

examples/pymc3_howto/custom_distribution.ipynb

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7+
"(custom_distribution)=\n",
78
"# Defining a Custom Distribution in PyMC3"
89
]
910
},
@@ -534,7 +535,7 @@
534535
],
535536
"metadata": {
536537
"kernelspec": {
537-
"display_name": "Python 3",
538+
"display_name": "Python 3 (ipykernel)",
538539
"language": "python",
539540
"name": "python3"
540541
},
@@ -548,7 +549,7 @@
548549
"name": "python",
549550
"nbconvert_exporter": "python",
550551
"pygments_lexer": "ipython3",
551-
"version": "3.8.1"
552+
"version": "3.9.7"
552553
}
553554
},
554555
"nbformat": 4,

examples/pymc3_howto/profiling.ipynb

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7+
"(profiling)=\n",
78
"# Profiling\n",
89
"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",
910
"\n",
@@ -315,7 +316,7 @@
315316
"metadata": {
316317
"anaconda-cloud": {},
317318
"kernelspec": {
318-
"display_name": "Python 3",
319+
"display_name": "Python 3 (ipykernel)",
319320
"language": "python",
320321
"name": "python3"
321322
},
@@ -329,7 +330,7 @@
329330
"name": "python",
330331
"nbconvert_exporter": "python",
331332
"pygments_lexer": "ipython3",
332-
"version": "3.8.3"
333+
"version": "3.9.7"
333334
}
334335
},
335336
"nbformat": 4,

examples/table_of_contents_tutorials.js

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Gallery.contents = {
1616
"samplers/DEMetropolisZ_tune_drop_fraction": "Deep dives",
1717
"case_studies/factor_analysis": "Deep dives",
1818
"case_studies/blackbox_external_likelihood": "How-To",
19+
"case_studies/blackbox_external_likelihood_numpy": "How-To",
1920
"pymc3_howto/profiling": "How-To",
2021
"pymc3_howto/howto_debugging": "How-To",
2122
"diagnostics_and_criticism/model_averaging": "How-To",

0 commit comments

Comments
 (0)