Skip to content

Commit 417fd2a

Browse files
committed
modified by pre-commit run files
1 parent 4a1cf90 commit 417fd2a

14 files changed

+27
-23
lines changed

examples/gaussian_processes/GP-MaunaLoa.myst.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ jupytext:
55
format_name: myst
66
format_version: 0.13
77
kernelspec:
8-
display_name: default
8+
display_name: Python [conda env:base] *
99
language: python
10-
name: python3
10+
name: conda-base-py
1111
myst:
1212
substitutions:
1313
extra_dependencies: bokeh
@@ -41,8 +41,8 @@ Not much was known about how fossil fuel burning influences the climate in the l
4141

4242
The history behind these measurements and their influence on climatology today and other interesting reading:
4343

44-
- http://scrippsco2.ucsd.edu/history_legacy/early_keeling_curve#
45-
- https://scripps.ucsd.edu/programs/keelingcurve/2016/05/23/why-has-a-drop-in-global-co2-emissions-not-caused-co2-levels-in-the-atmosphere-to-stabilize/#more-1412
44+
- [History & Legacy: The Early Keeling Curve](http://scrippsco2.ucsd.edu/history_legacy/early_keeling_curve)
45+
- [Why Has a Drop in Global CO2 Emissions Not Caused CO2 Levels in the Atmosphere to Stabilize?](https://keelingcurve.ucsd.edu/2016/05/23/why-has-a-drop-in-global-co2-emissions-not-caused-co2-levels-in-the-atmosphere-to-stabilize/)
4646

4747
Let's load in the data, tidy it up, and have a look. The [raw data set is located here](http://scrippsco2.ucsd.edu/data/atmospheric_co2/mlo). This notebook uses the [Bokeh package](http://bokeh.pydata.org/en/latest/) for plots that benefit from interactivity.
4848

examples/statistical_rethinking_lectures/02-The_Garden_of_Forking_Data.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@
920920
"plt.bar(ppd_unique, ppd_counts, width=0.2, color=\"C1\", label=\"posterior predictive\")\n",
921921
"plt.xlabel(r\"$\\hat n_W$\")\n",
922922
"plt.ylabel(\"count\")\n",
923-
"plt.title(f\"number of W samples predicted $\\hat n_W$ from {N_draws_for_prediction} globe flips\")\n",
923+
"plt.title(rf\"number of W samples predicted $\\hat n_W$ from {N_draws_for_prediction} globe flips\")\n",
924924
"plt.legend();"
925925
]
926926
},

examples/statistical_rethinking_lectures/02-The_Garden_of_Forking_Data.myst.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ plt.bar(
471471
plt.bar(ppd_unique, ppd_counts, width=0.2, color="C1", label="posterior predictive")
472472
plt.xlabel(r"$\hat n_W$")
473473
plt.ylabel("count")
474-
plt.title(f"number of W samples predicted $\hat n_W$ from {N_draws_for_prediction} globe flips")
474+
plt.title(rf"number of W samples predicted $\hat n_W$ from {N_draws_for_prediction} globe flips")
475475
plt.legend();
476476
```
477477

examples/statistical_rethinking_lectures/04-Categories_&_Curves.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3119,7 +3119,7 @@
31193119
" fill_kwargs=dict(alpha=1),\n",
31203120
" )\n",
31213121
" terms = \"+\".join([f\"\\\\beta_{o} H_i^{o}\" for o in range(1, order + 1)])\n",
3122-
" plt.title(f\"$\\mu_i = \\\\alpha + {terms}$\")\n",
3122+
" plt.title(f\"$\\\\mu_i = \\\\alpha + {terms}$\")\n",
31233123
"\n",
31243124
"\n",
31253125
"for order in [2, 4, 6]:\n",

examples/statistical_rethinking_lectures/04-Categories_&_Curves.myst.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ def plot_polynomial_model_posterior_predictive(model, inference, data, order):
904904
fill_kwargs=dict(alpha=1),
905905
)
906906
terms = "+".join([f"\\beta_{o} H_i^{o}" for o in range(1, order + 1)])
907-
plt.title(f"$\mu_i = \\alpha + {terms}$")
907+
plt.title(f"$\\mu_i = \\alpha + {terms}$")
908908
909909
910910
for order in [2, 4, 6]:

examples/statistical_rethinking_lectures/05-Elemental_Confounds.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@
19541954
"plt.title(\n",
19551955
" \"Causal effect of increasing Marriage Rate\\n\"\n",
19561956
" f\"by {n_std_increase} standard deviations on Divorce Rate\\n\"\n",
1957-
" f\"$p(\\delta < 0) = {prob_lt_zero:1.2}$\"\n",
1957+
" rf\"$p(\\delta < 0) = {prob_lt_zero:1.2}$\"\n",
19581958
");"
19591959
]
19601960
},

examples/statistical_rethinking_lectures/05-Elemental_Confounds.myst.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ plt.axvline(0, color="k", linestyle="--")
674674
plt.title(
675675
"Causal effect of increasing Marriage Rate\n"
676676
f"by {n_std_increase} standard deviations on Divorce Rate\n"
677-
f"$p(\delta < 0) = {prob_lt_zero:1.2}$"
677+
rf"$p(\delta < 0) = {prob_lt_zero:1.2}$"
678678
);
679679
```
680680

examples/statistical_rethinking_lectures/09-Modeling_Events.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@
13051305
" az.plot_dist(ps, color=\"C0\")\n",
13061306
" plt.xlim([0, 1])\n",
13071307
" plt.ylabel(\"density\")\n",
1308-
" plt.title(f\"$\\\\alpha \\sim \\mathcal{{N}}(0, {std})$\")\n",
1308+
" plt.title(f\"$\\\\alpha \\\\sim \\\\mathcal{{N}}(0, {std})$\")\n",
13091309
" if ii == 2:\n",
13101310
" plt.xlabel(\"p(event)\")"
13111311
]

examples/statistical_rethinking_lectures/09-Modeling_Events.myst.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ for ii, std in enumerate([10, 1.5, 1]):
493493
az.plot_dist(ps, color="C0")
494494
plt.xlim([0, 1])
495495
plt.ylabel("density")
496-
plt.title(f"$\\alpha \sim \mathcal{{N}}(0, {std})$")
496+
plt.title(f"$\\alpha \\sim \\mathcal{{N}}(0, {std})$")
497497
if ii == 2:
498498
plt.xlabel("p(event)")
499499
```

examples/statistical_rethinking_lectures/10-Counts_&_Hidden_Confounds.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2511,7 +2511,7 @@
25112511
" # since log(lambda) = alpha, if\n",
25122512
" # alpha is Normally distributed, therefore lambda is log-normal\n",
25132513
" lambda_prior_dist = stats.lognorm(s=prior_sigma, scale=np.exp(prior_mu))\n",
2514-
" label = f\"$\\\\alpha \\sim \\mathcal{{N}}{prior_mu, prior_sigma}$\"\n",
2514+
" label = f\"$\\\\alpha \\\\sim \\\\mathcal{{N}}{prior_mu, prior_sigma}$\"\n",
25152515
" pdf = lambda_prior_dist.pdf(num_tools)\n",
25162516
" plt.plot(num_tools, pdf, label=label, linewidth=3)\n",
25172517
"\n",
@@ -2534,7 +2534,9 @@
25342534
" for sample_idx, lambda_ in enumerate(lambdas):\n",
25352535
" pmf = stats.poisson(lambda_).pmf(num_tools)\n",
25362536
"\n",
2537-
" label = f\"$\\\\alpha \\sim \\mathcal{{N}}{prior_mu, prior_sigma}$\" if sample_idx == 1 else None\n",
2537+
" label = (\n",
2538+
" f\"$\\\\alpha \\\\sim \\\\mathcal{{N}}{prior_mu, prior_sigma}$\" if sample_idx == 1 else None\n",
2539+
" )\n",
25382540
" color = f\"C{ii}\"\n",
25392541
" plt.plot(num_tools, pmf, color=color, label=label, alpha=0.1)\n",
25402542
"\n",

0 commit comments

Comments
 (0)