Skip to content

Commit b9c4c0d

Browse files
Merge pull request CamDavidsonPilon#116 from elpres/patch-1
Wrong choice of quantiles for CI?
2 parents c8556da + 16c6a77 commit b9c4c0d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Chapter2_MorePyMC/MorePyMC.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@
709709
"source": [
710710
"Had we had stronger beliefs, we could have expressed them in the prior above.\n",
711711
"\n",
712-
"For this example, consider $p_A = 0.05$, and $N = 1500$ users shown site A, and we will simulate whether the user made a purchase or not. To simulate this from $N$ trials, we will use a *Bernoulli* distribution: if $ X\\ \\sim \\text{Ber}(p)$, then $X$ is 1 with probability $p$ and 0 with probability $1-p$. Of course, in practice we do not know $p_A$, but we will use it here to simulate the data."
712+
"For this example, consider $p_A = 0.05$, and $N = 1500$ users shown site A, and we will simulate whether the user made a purchase or not. To simulate this from $N$ trials, we will use a *Bernoulli* distribution: if $ X\\ \\sim \\text{Ber}(p)$, then $X$ is 1 with probability $p$ and 0 with probability $1$. Of course, in practice we do not know $p_A$, but we will use it here to simulate the data."
713713
]
714714
},
715715
{
@@ -1819,7 +1819,7 @@
18191819
"cell_type": "markdown",
18201820
"metadata": {},
18211821
"source": [
1822-
"A Normal random variable can take on any real value, but the variable is very likely to be relatively close to $\\mu$. In fact, the expected value of a Normal is equal to its $\\mu$ parameter:\n",
1822+
"A Normal random variable can be take on any real number, but the variable is very likely to be relatively close to $\\mu$. In fact, the expected value of a Normal is equal to its $\\mu$ parameter:\n",
18231823
"\n",
18241824
"$$ E[ X | \\mu, \\tau] = \\mu$$\n",
18251825
"\n",
@@ -2048,8 +2048,8 @@
20482048
"input": [
20492049
"from scipy.stats.mstats import mquantiles\n",
20502050
"\n",
2051-
"# vectorized bottom and top 5% quantiles for \"confidence interval\"\n",
2052-
"qs = mquantiles(p_t, [0.05, 0.95], axis=0)\n",
2051+
"# vectorized bottom and top 2.5% quantiles for \"confidence interval\"\n",
2052+
"qs = mquantiles(p_t, [0.025, 0.975], axis=0)\n",
20532053
"plt.fill_between(t[:, 0], *qs, alpha=0.7,\n",
20542054
" color=\"#7A68A6\")\n",
20552055
"\n",

0 commit comments

Comments
 (0)