Skip to content

Commit 059c3c3

Browse files
authored
STYLE: quantecon execise/solution style (#144)
* STY: quantecon execise/solution style * update environment * FIX: Upgrade sphinx-exercise to 1.2.0 to fix LaTeX build error * TEST: Install sphinx-exercise from PR #82 to test std-ref fix * FIX: Correct sphinx-exercise repository URL to executablebooks * Update to sphinx-exercise==1.2.1 release
1 parent f0d3c6d commit 059c3c3

File tree

9 files changed

+337
-356
lines changed

9 files changed

+337
-356
lines changed

environment.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ dependencies:
77
- pip
88
- pip:
99
- jupyter-book==1.0.4post1
10-
- quantecon-book-theme==0.8.3
10+
- quantecon-book-theme==0.10.0
1111
- sphinx-tojupyter==0.4.0
12-
- sphinx-proof==0.2.1
12+
- sphinx-proof==0.3.0
1313
- sphinxext-rediraffe==0.2.7
14-
- sphinx-exercise==1.0.1
14+
- sphinx-exercise==1.2.1
1515
- sphinxcontrib-youtube==1.4.1
1616
- sphinx-togglebutton==0.3.2
1717

lectures/ergodicity.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,12 @@ Let $(P_t)$ be a Markov semigroup. True or false:
638638
for this semigroup, every state $x$ is accessible from itself.
639639
```
640640
641+
```{solution} ergodicity-ex-1
642+
:class: dropdown
643+
644+
The statement is true. With $t=0$ we have $P_t(x,x) = I(x,x) = 1 > 0$.
645+
```
646+
641647
```{exercise}
642648
:label: ergodicity-ex-2
643649
Let $(\lambda_k)$ be a bounded non-increasing sequence in $(0, \infty)$.
@@ -658,41 +664,30 @@ Show that $(P_t)$, the corresponding Markov semigroup, has no stationary
658664
distribution.
659665
```
660666
661-
662-
```{exercise}
663-
:label: ergodicity-ex-3
664-
Confirm that {prf:ref}`sdrift` implies {prf:ref}`sfinite`.
665-
```
666-
667-
## Solutions
668-
669-
```{solution} ergodicity-ex-1
670-
The statement is true. With $t=0$ we have $P_t(x,x) = I(x,x) = 1 > 0$.
671-
```
672-
673-
674667
```{solution} ergodicity-ex-2
668+
:class: dropdown
669+
675670
Suppose to the contrary that $\phi \in \dD$ and $\phi Q = 0$.
676671
677672
Then, for any $j \geq 1$,
678673
679674
$$
680-
(\phi Q)(j)
681-
= \sum_{i \geq 0} \phi(i) Q(i, j)
682-
= - \lambda_j \phi(j) + \lambda_{j-1} \phi(j-1)
683-
= 0
675+
(\phi Q)(j)
676+
= \sum_{i \geq 0} \phi(i) Q(i, j)
677+
= - \lambda_j \phi(j) + \lambda_{j-1} \phi(j-1)
678+
= 0
684679
$$
685680
686681
Since $(\lambda_k)$ is non-increasing, it follows that
687682
688683
$$
689-
\frac{\phi(j)}{\phi(j-1)} = \frac{\lambda_{j-1}}{\lambda_j} \geq 1
684+
\frac{\phi(j)}{\phi(j-1)} = \frac{\lambda_{j-1}}{\lambda_j} \geq 1
690685
$$
691686
692687
Therefore, for any $j\geq 1$, it must be:
693688
694689
$$
695-
\phi(j) \geq \phi(j-1)
690+
\phi(j) \geq \phi(j-1)
696691
$$
697692
698693
It follows that $\phi$ is non-decreasing on $\ZZ_+$.
@@ -704,17 +699,24 @@ Contradiction.
704699
```
705700
706701
702+
```{exercise}
703+
:label: ergodicity-ex-3
704+
Confirm that {prf:ref}`sdrift` implies {prf:ref}`sfinite`.
705+
```
706+
707707
```{solution} ergodicity-ex-3
708+
:class: dropdown
709+
708710
Let $(P_t)$ be an irreducible UC Markov semigroup and let $S$ be finite.
709711
710712
Pick any positive constants $M, \epsilon$ and set $v = M$ and $F = S$.
711713
712714
We then have
713715
714716
$$
715-
\sum_y Q(x, y) v(y)
716-
= M \sum_y Q(x, y)
717-
= 0
717+
\sum_y Q(x, y) v(y)
718+
= M \sum_y Q(x, y)
719+
= 0
718720
$$
719721
720722
Hence the drift condition in {prf:ref}`sdrift` holds and $(P_t)$ is

lectures/generators.md

Lines changed: 50 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -432,14 +432,33 @@ example, Chapter 7 of {cite}`bobrowski2005functional`.
432432
Prove that {eq}`expdiffer` holds for all $A \in \linop$.
433433
```
434434
435+
```{solution} ergodicity-ex-1
436+
:class: dropdown
437+
438+
To show the first equality, fix $t \in \RR_+$, take $h > 0$ and observe that
439+
440+
$$
441+
e^{(t+h)A} - e^{tA} - e^{tA} A
442+
= e^{tA} (e^{hA} - I - A)
443+
$$
444+
445+
Since the norm on $\linop$ is submultiplicative, it suffices to show that
446+
$\| e^{hA} - I - A \| = o(h)$ as $h \to 0$.
447+
448+
Using the definition of the exponential, this is easily verified,
449+
completing the proof of the first equality in {eq}`expdiffer`.
450+
451+
The proof of the second equality is similar.
452+
```
453+
435454
```{exercise}
436455
:label: generators-ex-2
437456
438457
In many texts, a $C_0$ semigroup is defined as an evolution semigroup $(U_t)$
439458
such that
440459
441460
$$
442-
U_t g \to g \text{ as } t \to 0 \text{ for any } g \in \BB
461+
U_t g \to g \text{ as } t \to 0 \text{ for any } g \in \BB
443462
$$ (czsg2)
444463
445464
Our aim is to show that {eq}`czsg2` implies continuity at every point $t$, as
@@ -448,54 +467,16 @@ in the definition we used above.
448467
The [Banach--Steinhaus Theorem](https://en.wikipedia.org/wiki/Uniform_boundedness_principle) can be used to show that, for an evolution semigroup $(U_t)$ satisfying {eq}`czsg2`, there exist finite constants $\omega$ and $M$ such that
449468
450469
$$
451-
\| U_t \| \leq e^{t\omega} M
452-
\quad \text{for all } \; t \geq 0
470+
\| U_t \| \leq e^{t\omega} M
471+
\quad \text{for all } \; t \geq 0
453472
$$ (sgbound)
454473
455474
Using this and {eq}`czsg2`, show that, for any $g \in \BB$, the map $t \mapsto
456475
U_t g$ is continuous at all $t$.
457476
```
458477
459-
```{exercise}
460-
:label: generators-ex-3
461-
462-
Following on from the previous exercise,
463-
a UC semigroup is often defined as an evolution semigroup $(U_t)$
464-
such that
465-
466-
$$
467-
\| U_t - I \| \to 0 \text{ as } t \to 0
468-
$$ (czsg3)
469-
470-
Show that {eq}`czsg3` implies norm continuity at every point $t$, as
471-
in the definition we used above.
472-
473-
In particular, show that, for any $t_n \to t$, we have
474-
$\| U_{t_n} - U_t \| \to 0$ as $n \to \infty$.
475-
```
476-
477-
478-
## Solutions
479-
480-
```{solution} ergodicity-ex-1
481-
482-
To show the first equality, fix $t \in \RR_+$, take $h > 0$ and observe that
483-
484-
$$
485-
e^{(t+h)A} - e^{tA} - e^{tA} A
486-
= e^{tA} (e^{hA} - I - A)
487-
$$
488-
489-
Since the norm on $\linop$ is submultiplicative, it suffices to show that
490-
$\| e^{hA} - I - A \| = o(h)$ as $h \to 0$.
491-
492-
Using the definition of the exponential, this is easily verified,
493-
completing the proof of the first equality in {eq}`expdiffer`.
494-
495-
The proof of the second equality is similar.
496-
```
497-
498478
```{solution} ergodicity-ex-2
479+
:class: dropdown
499480
500481
Let $(U_t)$ be an evolution semigroup satisfying {eq}`czsg2` and let
501482
$\omega$ and $M$ be as in {eq}`sgbound`.
@@ -507,16 +488,36 @@ On one hand, $U_{t+ h_n} g = U_{h_n} U_t g \to U_t g$ by {eq}`czsg2`.
507488
On the other hand, from {eq}`sgbound` and the definition of the operator norm,
508489
509490
$$
510-
\| U_{t-h_n} g - U_t g\|
511-
= \| U_{t-h_n} ( g - U_{h_n} g) \|
512-
\leq e^{(t-h_n)\omega} M \| g - U_{h_n} g\|
513-
\to 0
491+
\| U_{t-h_n} g - U_t g\|
492+
= \| U_{t-h_n} ( g - U_{h_n} g) \|
493+
\leq e^{(t-h_n)\omega} M \| g - U_{h_n} g\|
494+
\to 0
514495
$$
515496
516497
as $n \to \infty$. This completes the proof.
517498
```
518499
500+
501+
```{exercise}
502+
:label: generators-ex-3
503+
504+
Following on from the previous exercise,
505+
a UC semigroup is often defined as an evolution semigroup $(U_t)$
506+
such that
507+
508+
$$
509+
\| U_t - I \| \to 0 \text{ as } t \to 0
510+
$$ (czsg3)
511+
512+
Show that {eq}`czsg3` implies norm continuity at every point $t$, as
513+
in the definition we used above.
514+
515+
In particular, show that, for any $t_n \to t$, we have
516+
$\| U_{t_n} - U_t \| \to 0$ as $n \to \infty$.
517+
```
518+
519519
```{solution} ergodicity-ex-3
520+
:class: dropdown
520521
521522
The solution is similar to that of the previous exercise.
522523
@@ -529,9 +530,9 @@ On the other hand, from the submultiplicative property of the operator norm
529530
and {eq}`sgbound`,
530531
531532
$$
532-
\| U_{t-h_n} - U_t \|
533-
= \| U_{t-h_n} ( I - U_{h_n}) \|
534-
\leq e^{(t-h_n)\omega} M \| I - U_{h_n} \|
533+
\| U_{t-h_n} - U_t \|
534+
= \| U_{t-h_n} ( I - U_{h_n}) \|
535+
\leq e^{(t-h_n)\omega} M \| I - U_{h_n} \|
535536
$$
536537
537538
This converges to 0 as $n \to \infty$, completing our proof.

0 commit comments

Comments
 (0)