You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -467,7 +468,7 @@ As in the {doc}`optimal growth lecture <optgrowth>`, to approximate a continuous
467
468
468
469
We define the operator function `Q` below.
469
470
470
-
```{code-cell}python3
471
+
```{code-cell}ipython3
471
472
@jit(nopython=True, parallel=True)
472
473
def Q(h, wf):
473
474
@@ -502,7 +503,7 @@ def Q(h, wf):
502
503
503
504
To solve the model, we will iterate using `Q` to find the fixed point
504
505
505
-
```{code-cell}python3
506
+
```{code-cell}ipython3
506
507
@jit(nopython=True)
507
508
def solve_model(wf, tol=1e-4, max_iter=1000):
508
509
"""
@@ -534,7 +535,7 @@ Let's inspect outcomes.
534
535
535
536
We will be using the default parameterization with distributions like so
536
537
537
-
```{code-cell}python3
538
+
```{code-cell}ipython3
538
539
wf = WaldFriedman()
539
540
540
541
fig, ax = plt.subplots(figsize=(10, 6))
@@ -550,14 +551,14 @@ plt.show()
550
551
551
552
To solve the model, we will call our `solve_model` function
552
553
553
-
```{code-cell}python3
554
+
```{code-cell}ipython3
554
555
h_star = solve_model(wf) # Solve the model
555
556
```
556
557
557
558
We will also set up a function to compute the cutoffs $\alpha$ and $\beta$
558
559
and plot these on our value function plot
559
560
560
-
```{code-cell}python3
561
+
```{code-cell}ipython3
561
562
@jit(nopython=True)
562
563
def find_cutoff_rule(wf, h):
563
564
@@ -637,7 +638,7 @@ On the right is the fraction of correct decisions at the stopping time.
637
638
638
639
In this case, the decision-maker is correct 80% of the time
639
640
640
-
```{code-cell}python3
641
+
```{code-cell}ipython3
641
642
def simulate(wf, true_dist, h_star, π_0=0.5):
642
643
643
644
"""
@@ -741,7 +742,7 @@ Before you look, think about what will happen:
741
742
- Will the decision-maker be correct more or less often?
742
743
- Will he make decisions sooner or later?
743
744
744
-
```{code-cell}python3
745
+
```{code-cell}ipython3
745
746
wf = WaldFriedman(c=2.5)
746
747
simulation_plot(wf)
747
748
```
@@ -940,4 +941,4 @@ We'll dig deeper into some of the ideas used here in the following lectures:
940
941
* {doc}`this lecture <likelihood_ratio_process>` describes **likelihood ratio processes** and their role in frequentist and Bayesian statistical theories
941
942
* {doc}`this lecture <likelihood_bayes>` discusses the role of likelihood ratio processes in **Bayesian learning**
942
943
* {doc}`this lecture <navy_captain>` returns to the subject of this lecture and studies whether the Captain's hunch that the (frequentist) decision rule
943
-
that the Navy had ordered him to use can be expected to be better or worse than the rule sequential rule that Abraham Wald designed
944
+
that the Navy had ordered him to use can be expected to be better or worse than the rule sequential rule that Abraham Wald designed
0 commit comments