Skip to content

Commit 196526d

Browse files
Merge pull request #291 from pieteradejong/master
[MRG] ch1: add desc Expected Value; ch2: adds titles to some plots
2 parents d3912ad + f3dadd0 commit 196526d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Chapter1_Introduction/Chapter1.ipynb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,9 @@
394394
"\n",
395395
"- **$Z$ is mixed**: Mixed random variables assign probabilities to both discrete and continuous random variables, i.e. it is a combination of the above two categories. \n",
396396
"\n",
397+
"#### Expected Value\n",
398+
"Expected value (EV) is one of the most important concepts in probability. The EV for a given probability distribution can be described as \"the mean value in the long run for many repeated samples from that distribution.\" To borrow a metaphor from physics, a distribution's EV as like its \"center of mass.\" Imagine repeating the same experiment many times over, and taking the average over each outcome. The more you repeat the experiment, the closer this average will become to the distributions EV. (side note: as the number of repeated experiments goes to infinity, the difference between the average outcome and the EV becomes arbitrarily small.)\n",
399+
"\n",
397400
"### Discrete Case\n",
398401
"If $Z$ is discrete, then its distribution is called a *probability mass function*, which measures the probability $Z$ takes on the value $k$, denoted $P(Z=k)$. Note that the probability mass function completely describes the random variable $Z$, that is, if we know the mass function, we know how $Z$ should behave. There are popular probability mass functions that consistently appear: we will introduce them as needed, but let's introduce the first very useful probability mass function. We say $Z$ is *Poisson*-distributed if:\n",
399402
"\n",

Chapter2_MorePyMC/Chapter2.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@
639639
" plt.xlim(0, 80)\n",
640640
"\n",
641641
"figsize(12.5, 5)\n",
642-
"plt.title(\"More example of artificial datasets\")\n",
642+
"plt.suptitle(\"More examples of artificial datasets\", fontsize=14)\n",
643643
"for i in range(1, 5):\n",
644644
" plt.subplot(4, 1, i)\n",
645645
" plot_artificial_sms_dataset()"
@@ -1672,6 +1672,7 @@
16721672
"plt.plot(x, logistic(x, 1), label=r\"$\\beta = 1$\")\n",
16731673
"plt.plot(x, logistic(x, 3), label=r\"$\\beta = 3$\")\n",
16741674
"plt.plot(x, logistic(x, -5), label=r\"$\\beta = -5$\")\n",
1675+
"plt.title(\"Logistic functon plotted for several value of $\\\\beta$ parameter\", fontsize=14)\n",
16751676
"plt.legend();"
16761677
]
16771678
},
@@ -1721,6 +1722,7 @@
17211722
"plt.plot(x, logistic(x, -5, 7), label=r\"$\\beta = -5, \\alpha = 7$\",\n",
17221723
" color=\"#7A68A6\")\n",
17231724
"\n",
1725+
"plt.title(\"Logistic functon with bias, plotted for several value of $\\\\alpha$ bias parameter\", fontsize=14)\n",
17241726
"plt.legend(loc=\"lower left\");"
17251727
]
17261728
},

0 commit comments

Comments
 (0)