From 566701fef8db14a9f7ba546e08b724955617687f Mon Sep 17 00:00:00 2001 From: Natasha Date: Tue, 5 Jul 2022 10:44:10 -0400 Subject: [PATCH 1/3] Fix typos and latex errors in prob_matrix.md * I also changed Jupiter notebook settings to only show up to the 3 decimal places --- lectures/prob_matrix.md | 43 ++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/lectures/prob_matrix.md b/lectures/prob_matrix.md index 649f9fb42..464b59973 100644 --- a/lectures/prob_matrix.md +++ b/lectures/prob_matrix.md @@ -48,6 +48,9 @@ from mpl_toolkits.mplot3d import Axes3D from IPython.display import set_matplotlib_formats set_matplotlib_formats('retina') %matplotlib inline + +# Display up to decimal places +pd.set_option('precision', 3) ``` @@ -224,7 +227,7 @@ for which $f_{i} \in [0,1]$ for each $i$ and $\sum_{i=0}^{I-1}f_i=1$. This vector defines a **probability mass function**. The distribution {eq}`eq:discretedist` -has **parameters** $\{f_{i}\}_{i=0,1,...,I-2}$ since $f_{I-1} = 1-\sum_{i=0}^{I-2}f_{i}$. +has **parameters** $\{f_{i}\}_{i=0,1, \cdots ,I-2}$ since $f_{I-1} = 1-\sum_{i=0}^{I-2}f_{i}$. These parameters pin down the shape of the distribution. @@ -660,7 +663,7 @@ plt.show() ## Some Discrete Probability Distributions -Let's write some Python code to compute means and variances of soem univariate random variables. +Let's write some Python code to compute means and variances of some univariate random variables. We'll use our code to @@ -715,7 +718,7 @@ $$ \textrm{Prob}\{X=d\}=\log _{10}(d+1)-\log _{10}(d)=\log _{10}\left(1+\frac{1}{d}\right) $$ -where $d\in\{1,2,...,9\}$ can be thought of as a **first digit** in a sequence of digits. +where $d\in\{1,2,\cdots,9\}$ can be thought of as a **first digit** in a sequence of digits. This is a well defined discrete distribution since we can verify that probabilities are nonnegative and sum to $1$. @@ -1531,8 +1534,8 @@ Start with a joint distribution $$ \begin{aligned} f_{ij} & =\textrm{Prob}\{X=i,Y=j\}\\ -i& =0,……,I-1\\ -j& =0,……,J-1\\ +i& =0, \cdots,I-1\\ +j& =0, \cdots e ,J-1\\ & \text{stacked to an }I×J\text{ matrix}\\ & e.g. \quad I=1, J=1 \end{aligned} @@ -1561,8 +1564,8 @@ Let's start with marginal distributions $$ \begin{aligned} -\textrm{\textrm{Prob}}\{X=i\} &= \sum_{j}f_{ij}=\mu_{i}, i=0,……,I-1\\ -\textrm{\textrm{Prob}}\{Y=j\}&= \sum_{j}f_{ij}=\nu_{j}, j=0,……,J-1 +\text{Prob} \{X=i\} &= \sum_{j}f_{ij}=\mu_{i}, i=0, \cdots, I-1\\ +\text{Prob} \{Y=j\}&= \sum_{j}f_{ij}=\nu_{j}, j=0, \cdots, J-1 \end{aligned} $$ @@ -1574,11 +1577,11 @@ Consider the following bivariate example. $$ \begin{aligned} -{\textrm{Prob}}\{X=0\}= & 1-q =\mu_{0}\\ -{\textrm{Prob}}\{X=1\}=& q =\mu_{1}\\ -{\textrm{Prob}}\{Y=0\}=& 1-r =\nu_{0}\\ -{\textrm{Prob}}\{Y=1\}= & r =\nu_{1}\\ -\textrm{where }0≤q Date: Tue, 5 Jul 2022 10:45:46 -0400 Subject: [PATCH 2/3] Fix code --- lectures/prob_matrix.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lectures/prob_matrix.md b/lectures/prob_matrix.md index 464b59973..04a6cfd39 100644 --- a/lectures/prob_matrix.md +++ b/lectures/prob_matrix.md @@ -1535,7 +1535,7 @@ $$ \begin{aligned} f_{ij} & =\textrm{Prob}\{X=i,Y=j\}\\ i& =0, \cdots,I-1\\ -j& =0, \cdots e ,J-1\\ +j& =0, \cdots,J-1\\ & \text{stacked to an }I×J\text{ matrix}\\ & e.g. \quad I=1, J=1 \end{aligned} From 801f19c46e89cb81bd02a5b1f78c602773b953aa Mon Sep 17 00:00:00 2001 From: Natasha Date: Tue, 5 Jul 2022 17:05:08 -0400 Subject: [PATCH 3/3] remove decimal place option --- lectures/prob_matrix.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/lectures/prob_matrix.md b/lectures/prob_matrix.md index 04a6cfd39..026813474 100644 --- a/lectures/prob_matrix.md +++ b/lectures/prob_matrix.md @@ -48,9 +48,6 @@ from mpl_toolkits.mplot3d import Axes3D from IPython.display import set_matplotlib_formats set_matplotlib_formats('retina') %matplotlib inline - -# Display up to decimal places -pd.set_option('precision', 3) ```