diff --git a/doc/pub/week36/html/week36-bs.html b/doc/pub/week36/html/week36-bs.html index d7cdc9232..a1cd812e4 100644 --- a/doc/pub/week36/html/week36-bs.html +++ b/doc/pub/week36/html/week36-bs.html @@ -129,6 +129,9 @@ Automatically generated HTML file from DocOnce source 2, None, 'more-basic-statistics-and-bayes-theorem'), + ('Marginal Probability', 2, None, 'marginal-probability'), + ('Conditional Probability', 2, None, 'conditional-probability'), + ("Bayes' Theorem", 2, None, 'bayes-theorem'), ('Frliday September 10', 2, None, 'frliday-september-10'), ('Why resampling methods', 2, None, 'why-resampling-methods'), ('Resampling methods', 2, None, 'resampling-methods'), @@ -287,34 +290,37 @@ MathJax.Hub.Config({
$$
-p(X \cup Y)= p(X,y)= p(X\vert Y)p(Y)=p(Y\vert X)p(x),
+p(X \cup Y)= p(X,Y)= p(X\vert Y)p(Y)=p(Y\vert X)p(x),
$$
where we read \( p(X\vert Y) \) as the likelihood of obtaining \( X \) given \( Y \).
+If we have independent events then \( p(X,Y)=p(X)p(Y) \).
+
+
+
+
+The marginal probability is defined in terms of only of the set of variables \( X,Y \). For a discrete probability we have
+
+The conditional probability, if \( p(Y) > 0 \), is
+
+If we combine the conditional probability with the marginal probability and the standard product rule, we have
+ Marginal Probability
+
+
+$$
+p(X)=\sum_{i=0}^{n-1}p(X,Y=y_i)=\sum_{i=0}^{n-1}p(X\vert Y=y_i)p(Y=y_i)=\sum_{i=0}^{n-1}p(X\vert y_i)p(y_i).
+$$
+
+Conditional Probability
+
+
+$$
+p(X\vert Y)= \frac{p(X,Y)}{p(Y)}=\frac{p(X,Y)}{\sum_{i=0}^{n-1}p(Y\vert X=x_i)p(x_i)}.
+$$
+
+Bayes' Theorem
+
+
+$$
+p(X\vert Y)= \frac{p(X,Y)}{p(Y)},
+$$
+
+
+we can rewrite this as
+
+
+$$
+p(X\vert Y)= \frac{p(X,Y)}{\sum_{i=0}^{n-1}p(Y\vert X=x_i)p(x_i)}=\frac{p(Y\vert X)p(X)}{\sum_{i=0}^{n-1}p(Y\vert X=x_i)p(x_i)},
+$$
+
+
+Which is Bayes' theorem. More text to be added here by Friday September 10.
$$ -p(X \cup Y)= p(X,y)= p(X\vert Y)p(Y)=p(Y\vert X)p(x), +p(X \cup Y)= p(X,Y)= p(X\vert Y)p(Y)=p(Y\vert X)p(x), $$ where we read \( p(X\vert Y) \) as the likelihood of obtaining \( X \) given \( Y \).
+If we have independent events then \( p(X,Y)=p(X)p(Y) \). + +
+
+
+
+The marginal probability is defined in terms of only of the set of variables \( X,Y \). For a discrete probability we have +
+$$ +p(X)=\sum_{i=0}^{n-1}p(X,Y=y_i)=\sum_{i=0}^{n-1}p(X\vert Y=y_i)p(Y=y_i)=\sum_{i=0}^{n-1}p(X\vert y_i)p(y_i). +$$ +
+
+
+
+The conditional probability, if \( p(Y) > 0 \), is +
+$$ +p(X\vert Y)= \frac{p(X,Y)}{p(Y)}=\frac{p(X,Y)}{\sum_{i=0}^{n-1}p(Y\vert X=x_i)p(x_i)}. +$$ +
+
+
+
+If we combine the conditional probability with the marginal probability and the standard product rule, we have +$$ +p(X\vert Y)= \frac{p(X,Y)}{p(Y)}, +$$ + +we can rewrite this as + +$$ +p(X\vert Y)= \frac{p(X,Y)}{\sum_{i=0}^{n-1}p(Y\vert X=x_i)p(x_i)}=\frac{p(Y\vert X)p(X)}{\sum_{i=0}^{n-1}p(Y\vert X=x_i)p(x_i)}, +$$ + +Which is Bayes' theorem. More text to be added here by Friday September 10. +
diff --git a/doc/pub/week36/html/week36.html b/doc/pub/week36/html/week36.html
index d44b27577..18219fc4a 100644
--- a/doc/pub/week36/html/week36.html
+++ b/doc/pub/week36/html/week36.html
@@ -154,6 +154,9 @@ div { text-align: justify; text-justify: inter-word; }
2,
None,
'more-basic-statistics-and-bayes-theorem'),
+ ('Marginal Probability', 2, None, 'marginal-probability'),
+ ('Conditional Probability', 2, None, 'conditional-probability'),
+ ("Bayes' Theorem", 2, None, 'bayes-theorem'),
('Frliday September 10', 2, None, 'frliday-september-10'),
('Why resampling methods', 2, None, 'why-resampling-methods'),
('Resampling methods', 2, None, 'resampling-methods'),
@@ -1193,16 +1196,70 @@ $$
$$ -p(X \cup Y)= p(X,y)= p(X\vert Y)p(Y)=p(Y\vert X)p(x), +p(X \cup Y)= p(X,Y)= p(X\vert Y)p(Y)=p(Y\vert X)p(x), $$ where we read \( p(X\vert Y) \) as the likelihood of obtaining \( X \) given \( Y \).
+If we have independent events then \( p(X,Y)=p(X)p(Y) \). + +
+
+
+
+The marginal probability is defined in terms of only of the set of variables \( X,Y \). For a discrete probability we have +
+$$ +p(X)=\sum_{i=0}^{n-1}p(X,Y=y_i)=\sum_{i=0}^{n-1}p(X\vert Y=y_i)p(Y=y_i)=\sum_{i=0}^{n-1}p(X\vert y_i)p(y_i). +$$ +
+
+
+
+The conditional probability, if \( p(Y) > 0 \), is +
+$$ +p(X\vert Y)= \frac{p(X,Y)}{p(Y)}=\frac{p(X,Y)}{\sum_{i=0}^{n-1}p(Y\vert X=x_i)p(x_i)}. +$$ +
+
+
+
+If we combine the conditional probability with the marginal probability and the standard product rule, we have +$$ +p(X\vert Y)= \frac{p(X,Y)}{p(Y)}, +$$ + +we can rewrite this as + +$$ +p(X\vert Y)= \frac{p(X,Y)}{\sum_{i=0}^{n-1}p(Y\vert X=x_i)p(x_i)}=\frac{p(Y\vert X)p(X)}{\sum_{i=0}^{n-1}p(Y\vert X=x_i)p(x_i)}, +$$ + +Which is Bayes' theorem. More text to be added here by Friday September 10. +
diff --git a/doc/pub/week36/ipynb/ipynb-week36-src.tar.gz b/doc/pub/week36/ipynb/ipynb-week36-src.tar.gz
index 89a5af289..d05ae0b2c 100644
Binary files a/doc/pub/week36/ipynb/ipynb-week36-src.tar.gz and b/doc/pub/week36/ipynb/ipynb-week36-src.tar.gz differ
diff --git a/doc/pub/week36/ipynb/week36.ipynb b/doc/pub/week36/ipynb/week36.ipynb
index bdb0e54f0..41f8d94e4 100644
--- a/doc/pub/week36/ipynb/week36.ipynb
+++ b/doc/pub/week36/ipynb/week36.ipynb
@@ -1547,7 +1547,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "**The product rule is given by.**"
+ "**The product rule (aka joint probability) is given by.**"
]
},
{
@@ -1555,7 +1555,7 @@
"metadata": {},
"source": [
"$$\n",
- "p(X \\cup Y)= p(X,y)= p(X\\vert Y)p(Y)=p(Y\\vert X)p(x),\n",
+ "p(X \\cup Y)= p(X,Y)= p(X\\vert Y)p(Y)=p(Y\\vert X)p(x),\n",
"$$"
]
},
@@ -1567,6 +1567,81 @@
"\n",
"\n",
"\n",
+ "If we have independent events then $p(X,Y)=p(X)p(Y)$.\n",
+ "\n",
+ "\n",
+ "## Marginal Probability\n",
+ "\n",
+ "The marginal probability is defined in terms of only of the set of variables $X,Y$. For a discrete probability we have\n",
+ "**Discrete Probability.**"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "$$\n",
+ "p(X)=\\sum_{i=0}^{n-1}p(X,Y=y_i)=\\sum_{i=0}^{n-1}p(X\\vert Y=y_i)p(Y=y_i)=\\sum_{i=0}^{n-1}p(X\\vert y_i)p(y_i).\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Conditional Probability\n",
+ "\n",
+ "The conditional probability, if $p(Y) > 0$, is"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "$$\n",
+ "p(X\\vert Y)= \\frac{p(X,Y)}{p(Y)}=\\frac{p(X,Y)}{\\sum_{i=0}^{n-1}p(Y\\vert X=x_i)p(x_i)}.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Bayes' Theorem\n",
+ "\n",
+ "If we combine the conditional probability with the marginal probability and the standard product rule, we have"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "$$\n",
+ "p(X\\vert Y)= \\frac{p(X,Y)}{p(Y)},\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "we can rewrite this as"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "$$\n",
+ "p(X\\vert Y)= \\frac{p(X,Y)}{\\sum_{i=0}^{n-1}p(Y\\vert X=x_i)p(x_i)}=\\frac{p(Y\\vert X)p(X)}{\\sum_{i=0}^{n-1}p(Y\\vert X=x_i)p(x_i)},\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Which is Bayes' theorem. More text to be added here by Friday September 10.\n",
"\n",
"\n",
"## Frliday September 10\n",
diff --git a/doc/src/week36/week36.do.txt b/doc/src/week36/week36.do.txt
index d5a3d8dc7..a3e874169 100644
--- a/doc/src/week36/week36.do.txt
+++ b/doc/src/week36/week36.do.txt
@@ -883,15 +883,61 @@ p(X \cup Y)= p(X)+p(Y)-p(X \cap Y).
!eblock
-!bblock The product rule is given by
+!bblock The product rule (aka joint probability) is given by
!bt
\[
-p(X \cup Y)= p(X,y)= p(X\vert Y)p(Y)=p(Y\vert X)p(x),
+p(X \cup Y)= p(X,Y)= p(X\vert Y)p(Y)=p(Y\vert X)p(x),
\]
!et
where we read $p(X\vert Y)$ as the likelihood of obtaining $X$ given $Y$.
!eblock
+If we have independent events then $p(X,Y)=p(X)p(Y)$.
+
+
+!split
+===== Marginal Probability =====
+
+The marginal probability is defined in terms of only of the set of variables $X,Y$. For a discrete probability we have
+!bblock Discrete Probability
+!bt
+\[
+p(X)=\sum_{i=0}^{n-1}p(X,Y=y_i)=\sum_{i=0}^{n-1}p(X\vert Y=y_i)p(Y=y_i)=\sum_{i=0}^{n-1}p(X\vert y_i)p(y_i).
+\]
+!et
+!eblock
+
+
+!split
+===== Conditional Probability =====
+
+The conditional probability, if $p(Y) > 0$, is
+!bblock
+!bt
+\[
+p(X\vert Y)= \frac{p(X,Y)}{p(Y)}=\frac{p(X,Y)}{\sum_{i=0}^{n-1}p(Y\vert X=x_i)p(x_i)}.
+\]
+!et
+!eblock
+
+
+!split
+===== Bayes' Theorem =====
+
+If we combine the conditional probability with the marginal probability and the standard product rule, we have
+!bt
+\[
+p(X\vert Y)= \frac{p(X,Y)}{p(Y)},
+\]
+!et
+we can rewrite this as
+
+!bt
+\[
+p(X\vert Y)= \frac{p(X,Y)}{\sum_{i=0}^{n-1}p(Y\vert X=x_i)p(x_i)}=\frac{p(Y\vert X)p(X)}{\sum_{i=0}^{n-1}p(Y\vert X=x_i)p(x_i)},
+\]
+!et
+Which is Bayes' theorem. More text to be added here by Friday September 10.
!split