@@ -287,11 +287,6 @@ pz.maxent(dist, lower=0.1, upper=20, mass=0.95);
287
287
px.histogram(x=dist.rvs(1000), nbins=20, title="Gamma Distribution Samples")
288
288
```
289
289
290
- ``` {code-cell} ipython3
291
- gamma_samples = pm.draw(pm.Gamma.dist(alpha=2, beta=0.2), 1000)
292
- px.histogram(x=gamma_samples, nbins=20, title="Gamma Distribution Samples")
293
- ```
294
-
295
290
``` {code-cell} ipython3
296
291
t = df_country.select("days_since_100").to_numpy().flatten()
297
292
confirmed = df_country.select("confirmed").to_numpy().flatten()
@@ -338,7 +333,7 @@ fig.update_layout(
338
333
yaxis=dict(range=[-100, 1000]),
339
334
xaxis=dict(range=[0, 10]),
340
335
template="plotly_white",
341
- )
336
+ );
342
337
```
343
338
344
339
:::{admonition} Progress!
@@ -451,15 +446,15 @@ Before trusting our results, we must verify that the sampler has converged prope
451
446
:::
452
447
453
448
``` {code-cell} ipython3
454
- az.plot_trace(trace_exp3, var_names=["a", "b", "alpha"])
449
+ az.plot_trace(trace_exp3, var_names=["a", "b", "alpha"]);
455
450
```
456
451
457
452
``` {code-cell} ipython3
458
453
az.summary(trace_exp3, var_names=["a", "b", "alpha"])
459
454
```
460
455
461
456
``` {code-cell} ipython3
462
- az.plot_energy(trace_exp3)
457
+ az.plot_energy(trace_exp3);
463
458
```
464
459
465
460
:::{admonition} Convergence Checklist
@@ -558,7 +553,7 @@ for i, (name, trace) in enumerate(results.items()):
558
553
ax.set_xlabel("Growth rate (b)")
559
554
ax.set_ylabel("Density")
560
555
ax.set_title("Sensitivity to Prior Choice")
561
- ax.legend()
556
+ ax.legend();
562
557
```
563
558
564
559
:::{admonition} Sensitivity Analysis Results
@@ -870,7 +865,7 @@ with logistic_model:
870
865
```
871
866
872
867
``` {code-cell} ipython3
873
- az.plot_trace(trace_logistic)
868
+ az.plot_trace(trace_logistic);
874
869
```
875
870
876
871
``` {code-cell} ipython3
@@ -967,7 +962,7 @@ with model_exp4:
967
962
with logistic_model:
968
963
pm.compute_log_likelihood(trace_logistic)
969
964
970
- az.plot_compare(az.compare({"exp4": trace_exp4_full, "logistic": trace_logistic}))
965
+ az.plot_compare(az.compare({"exp4": trace_exp4_full, "logistic": trace_logistic}));
971
966
```
972
967
973
968
As you can see, the logistic model provides a much better fit to the data.
@@ -1031,7 +1026,7 @@ with logistic_model_us:
1031
1026
```
1032
1027
1033
1028
``` {code-cell} ipython3
1034
- az.plot_trace(trace_logistic_us)
1029
+ az.plot_trace(trace_logistic_us);
1035
1030
```
1036
1031
1037
1032
``` {code-cell} ipython3
0 commit comments