Skip to content

Commit 6d794c9

Browse files
committed
Add chapters 7, 12, 13, 15
1 parent 51ec5b9 commit 6d794c9

24 files changed

+4481
-0
lines changed

chapter07_stats/01_pandas.ipynb

Lines changed: 249 additions & 0 deletions
Large diffs are not rendered by default.

chapter07_stats/02_z_test.ipynb

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Getting started with statistical hypothesis testing — a simple z-test"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": 1,
13+
"metadata": {},
14+
"outputs": [],
15+
"source": [
16+
"import numpy as np\n",
17+
"import scipy.stats as st\n",
18+
"import scipy.special as sp"
19+
]
20+
},
21+
{
22+
"cell_type": "code",
23+
"execution_count": 2,
24+
"metadata": {},
25+
"outputs": [],
26+
"source": [
27+
"n = 100 # number of coin flips\n",
28+
"h = 61 # number of heads\n",
29+
"q = .5 # null-hypothesis of fair coin"
30+
]
31+
},
32+
{
33+
"cell_type": "code",
34+
"execution_count": 3,
35+
"metadata": {},
36+
"outputs": [
37+
{
38+
"data": {
39+
"text/plain": [
40+
" 2.2000"
41+
]
42+
},
43+
"execution_count": 3,
44+
"metadata": {},
45+
"output_type": "execute_result"
46+
}
47+
],
48+
"source": [
49+
"xbar = float(h) / n\n",
50+
"z = (xbar - q) * np.sqrt(n / (q * (1 - q)))\n",
51+
"# We don't want to display more than 4 decimals.\n",
52+
"z"
53+
]
54+
},
55+
{
56+
"cell_type": "code",
57+
"execution_count": 4,
58+
"metadata": {},
59+
"outputs": [
60+
{
61+
"data": {
62+
"text/plain": [
63+
" 0.0278"
64+
]
65+
},
66+
"execution_count": 4,
67+
"metadata": {},
68+
"output_type": "execute_result"
69+
}
70+
],
71+
"source": [
72+
"pval = 2 * (1 - st.norm.cdf(z))\n",
73+
"pval"
74+
]
75+
}
76+
],
77+
"metadata": {},
78+
"nbformat": 4,
79+
"nbformat_minor": 2
80+
}

chapter07_stats/03_bayesian.ipynb

Lines changed: 76 additions & 0 deletions
Large diffs are not rendered by default.

chapter07_stats/04_correlation.ipynb

Lines changed: 220 additions & 0 deletions
Large diffs are not rendered by default.

chapter07_stats/05_mlfit.ipynb

Lines changed: 262 additions & 0 deletions
Large diffs are not rendered by default.

chapter07_stats/06_kde.ipynb

Lines changed: 217 additions & 0 deletions
Large diffs are not rendered by default.

chapter07_stats/07_pymc.ipynb

Lines changed: 205 additions & 0 deletions
Large diffs are not rendered by default.

chapter07_stats/08_r.ipynb

Lines changed: 169 additions & 0 deletions
Large diffs are not rendered by default.

chapter12_deterministic/01_bifurcation.ipynb

Lines changed: 204 additions & 0 deletions
Large diffs are not rendered by default.

chapter12_deterministic/02_cellular.ipynb

Lines changed: 108 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)