Skip to content

Commit 68411d9

Browse files
authored
Merge pull request #10 from QuantEcon/update-src-conf.py
update source files from update to conf.py in lecture-python-programming
2 parents 9b18901 + 4346769 commit 68411d9

40 files changed

+12848
-0
lines changed

conf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,3 +478,8 @@
478478

479479
# pdf toc file
480480
jupyter_pdf_book_index = "index_toc"
481+
482+
# tomyst Config
483+
484+
# Set Destination path
485+
tomyst_static_file_path = ['source/rst/_static']
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.. raw:: html
2+
3+
<div id="qe-notebook-header" align="right" style="text-align:right;">
4+
<a href="https://quantecon.org/" title="quantecon.org">
5+
<img style="width:250px;display:inline;" width="250px" src="https://assets.quantecon.org/img/qe-menubar-logo.svg" alt="QuantEcon">
6+
</a>
7+
</div>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.. raw:: html
2+
3+
<div id="qe-notebook-header" style="text-align:right;">
4+
<a href="https://quantecon.org/" title="quantecon.org">
5+
<img style="width:250px;display:inline;" src="https://assets.quantecon.org/img/qe-menubar-logo.svg" alt="QuantEcon">
6+
</a>
7+
</div>
45 KB
Loading
93.7 KB
Loading
43.6 KB
Loading
41 KB
Loading
40.8 KB
Loading
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
import matplotlib.pyplot as plt
3+
import numpy as np
4+
from scipy.stats import norm
5+
from matplotlib import cm
6+
7+
xmin, xmax = -4, 12
8+
x = 10
9+
α = 0.5
10+
11+
m, v = x, 10
12+
13+
xgrid = np.linspace(xmin, xmax, 200)
14+
15+
fig, ax = plt.subplots()
16+
17+
ax.spines['right'].set_color('none')
18+
ax.spines['top'].set_color('none')
19+
ax.spines['left'].set_color('none')
20+
ax.xaxis.set_ticks_position('bottom')
21+
ax.spines['bottom'].set_position(('data', 0))
22+
23+
ax.set_ylim(-0.05, 0.5)
24+
ax.set_xticks((x,))
25+
ax.set_xticklabels((r'$x$', ), fontsize=18)
26+
ax.set_yticks(())
27+
28+
K = 3
29+
for i in range(K):
30+
m = α * m
31+
v = α * α * v + 1
32+
f = norm(loc=m, scale=np.sqrt(v))
33+
k = (i + 0.5) / K
34+
ax.plot(xgrid, f.pdf(xgrid), lw=1, color='black', alpha=0.4)
35+
ax.fill_between(xgrid, 0 * xgrid, f.pdf(xgrid), color=cm.jet(k), alpha=0.4)
36+
37+
38+
ax.annotate(r'$Q(x,\cdot)$', xy=(6.6, 0.2), xycoords='data',
39+
xytext=(20, 90), textcoords='offset points', fontsize=16,
40+
arrowprops=dict(arrowstyle="->", connectionstyle="arc3,rad=-0.2"))
41+
ax.annotate(r'$Q^2(x,\cdot)$', xy=(3.6, 0.24), xycoords='data',
42+
xytext=(20, 90), textcoords='offset points', fontsize=16,
43+
arrowprops=dict(arrowstyle="->", connectionstyle="arc3,rad=-0.2"))
44+
ax.annotate(r'$Q^3(x,\cdot)$', xy=(-0.2, 0.28), xycoords='data',
45+
xytext=(-90, 90), textcoords='offset points', fontsize=16,
46+
arrowprops=dict(arrowstyle="->", connectionstyle="arc3,rad=0.2"))
47+
fig.show()
283 KB
Loading

0 commit comments

Comments
 (0)