Skip to content

Commit 4d77004

Browse files
committed
edit titles to distinguish the two different versions
1 parent ec49d79 commit 4d77004

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

examples/case_studies/blackbox_external_likelihood.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Using a \"black box\" likelihood function"
7+
"# Using a \"black box\" likelihood function (Cython)"
88
]
99
},
1010
{
@@ -832,7 +832,7 @@
832832
"name": "python",
833833
"nbconvert_exporter": "python",
834834
"pygments_lexer": "ipython3",
835-
"version": "3.8.2"
835+
"version": "3.8.5"
836836
}
837837
},
838838
"nbformat": 4,

examples/case_studies/blackbox_external_likelihood_no_cython.ipynb

+16-15
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Using a \"black box\" likelihood function"
7+
"# Using a \"black box\" likelihood function (numpy)"
88
]
99
},
1010
{
@@ -79,11 +79,12 @@
7979
"source": [
8080
"def my_model(theta, x):\n",
8181
" m, c = theta\n",
82-
" return m*x + c\n",
82+
" return m * x + c\n",
83+
"\n",
8384
"\n",
8485
"def my_loglike(theta, x, data, sigma):\n",
85-
" model= my_model(theta, x)\n",
86-
" return -(0.5/sigma**2)*np.sum((data - model)**2)"
86+
" model = my_model(theta, x)\n",
87+
" return -(0.5 / sigma ** 2) * np.sum((data - model) ** 2)"
8788
]
8889
},
8990
{
@@ -327,7 +328,7 @@
327328
" the gradient of that function\n",
328329
" x, data, sigma:\n",
329330
" Observed variables as we have been using so far\n",
330-
" \n",
331+
"\n",
331332
"\n",
332333
" Returns\n",
333334
" -------\n",
@@ -336,10 +337,10 @@
336337
" \"\"\"\n",
337338
"\n",
338339
" grads = np.empty(2)\n",
339-
" aux_vect = (data - my_model(theta, x)) # /(2*sigma**2)\n",
340-
" grads[0] = np.sum(aux_vect*x)\n",
340+
" aux_vect = data - my_model(theta, x) # /(2*sigma**2)\n",
341+
" grads[0] = np.sum(aux_vect * x)\n",
341342
" grads[1] = np.sum(aux_vect)\n",
342-
" \n",
343+
"\n",
343344
" return grads"
344345
]
345346
},
@@ -673,10 +674,10 @@
673674
],
674675
"source": [
675676
"_, axes = plt.subplots(3, 2, sharex=True, sharey=True)\n",
676-
"az.plot_autocorr(idata_mh, combined=True, ax=axes[0,:]);\n",
677-
"az.plot_autocorr(idata_grad, combined=True, ax=axes[1,:]);\n",
678-
"az.plot_autocorr(idata, combined=True, ax=axes[2,:]);\n",
679-
"axes[2,0].set_xlim(right=40);"
677+
"az.plot_autocorr(idata_mh, combined=True, ax=axes[0, :])\n",
678+
"az.plot_autocorr(idata_grad, combined=True, ax=axes[1, :])\n",
679+
"az.plot_autocorr(idata, combined=True, ax=axes[2, :])\n",
680+
"axes[2, 0].set_xlim(right=40);"
680681
]
681682
},
682683
{
@@ -711,11 +712,11 @@
711712
"source": [
712713
"pair_kwargs = dict(\n",
713714
" kind=\"kde\",\n",
714-
" marginals=True, \n",
715-
" reference_values={\"m\": mtrue, \"c\": ctrue}, \n",
715+
" marginals=True,\n",
716+
" reference_values={\"m\": mtrue, \"c\": ctrue},\n",
716717
" kde_kwargs={\"contourf_kwargs\": {\"alpha\": 0}, \"contour_kwargs\": {\"colors\": \"C0\"}},\n",
717718
" reference_values_kwargs={\"color\": \"k\", \"ms\": 15, \"marker\": \"d\"},\n",
718-
" marginal_kwargs={\"color\": \"C0\"}\n",
719+
" marginal_kwargs={\"color\": \"C0\"},\n",
719720
")\n",
720721
"ax = az.plot_pair(idata_mh, **pair_kwargs)\n",
721722
"pair_kwargs[\"kde_kwargs\"][\"contour_kwargs\"][\"colors\"] = \"C1\"\n",

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_no_cython": "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)