Skip to content
This repository was archived by the owner on Apr 24, 2020. It is now read-only.

Commit cb0a1c4

Browse files
add initial files
1 parent 93db1d6 commit cb0a1c4

File tree

759 files changed

+106690
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

759 files changed

+106690
-0
lines changed

Makefile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = QuantEconlectures
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
#Check for make.lock file. If not equal then set BUILD = True
12+
ifeq ("$(wildcard ./make.lock)","")
13+
BUILD=TRUE
14+
else
15+
BUILD=FALSE
16+
endif
17+
18+
# Put it first so that "make" without argument is like "make help".
19+
help:
20+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21+
22+
.PHONY: help Makefile
23+
24+
check_environment:
25+
ifeq ($(BUILD),FALSE)
26+
@echo "[ERROR] You cannot run make in the source directory"; exit 1
27+
else
28+
@true
29+
endif
30+
31+
setup: check_environment install_dependancies
32+
python build.py
33+
34+
install_dependancies: check_environment
35+
pip install --upgrade sphinxcontrib-tikz
36+
pip install --upgrade sphinxcontrib-bibtex
37+
38+
web: check_environment
39+
make html
40+
41+
# force jupyter to build using jupyter_conversion_mode="all"
42+
jupyter-all: check_environment
43+
sphinx-build -D jupyter_conversion_mode="all" -b jupyter "$(SOURCEDIR)" "$(BUILDDIR)/jupyter"
44+
45+
xelatexpdf: latex
46+
@echo "Running LaTeX files through xelatex to construct PDF with Unicode..."
47+
$(MAKE) PDFLATEX=xelatex -C $(BUILDDIR)/latex all-pdf
48+
$(MAKE) PDFLATEX=xelatex -C $(BUILDDIR)/latex all-pdf
49+
@echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex."
50+
51+
52+
# Catch-all target: route all unknown targets to Sphinx using the new
53+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
54+
%: Makefile check_environment
55+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

_static/banner.png

38.9 KB
Loading

_static/code/about_py/qs.py

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()

0 commit comments

Comments
 (0)