You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h3 id="Binomial-distribution">Binomial distribution<a class="anchor-link" href="#Binomial-distribution">¶</a></h3><p>... whose PMF is $p(k|q,n) = {n \choose k} q^k (1-q)^{n-k}$ for $k$ successes. ${n \choose k}$ is the combinatoric "choose" function, $\frac{n!}{k!(n-k)!}$.</p>
14427
+
<h3 id="Binomial-distribution">Binomial distribution<a class="anchor-link" href="#Binomial-distribution">¶</a></h3><p>... whose PMF is $P(k|q,n) = {n \choose k} q^k (1-q)^{n-k}$ for $k$ successes. ${n \choose k}$ is the combinatoric "choose" function, $\frac{n!}{k!(n-k)!}$.</p>
14428
14428
<p>The Binomial distribution is additive, in that the sum of two Binomial random variables with the same $q$, respectively with $n_1$ and $n_2$ trials, also follows the Binomial distribution, with parameters $q$ and $n_1+n_2$.</p>
14429
14429
<p>This distribution might be useful for inferring the fraction of objects belonging to one of two classes ($q$), based on typing of an unbiased but finite number of them ($n$). (The multinomial generalization would work for more than two classes.)</p>
14430
14430
<p>Or, consider the case that each Bernoulli trial is whether a photon hits our detector in a given, tiny time interval. For an integration whose total length is much longer than any such time interval we could plausibly distinguish, we might take the limit where $n$ becomes huge, thus reaching the...</p>
<h3 id="Poisson-distribution">Poisson distribution<a class="anchor-link" href="#Poisson-distribution">¶</a></h3><p>... which describes the number of successes when the number of trials is in principle infinite, but $q$ is correspondingly vanishingly small. It has a single parameter, $\mu$, which corresponds to the product $qn$ when interpretted as a limit of the Binomial distribution. The PMF is</p>
14437
-
<p>$p(k|\mu) = \frac{\mu^k e^{-\mu}}{k!}$.</p>
14437
+
<p>$P(k|\mu) = \frac{\mu^k e^{-\mu}}{k!}$.</p>
14438
14438
<p>Like the Binomial distribution, the Poisson distribution is additive. It also has the following (probably familiar) properties:</p>
14439
14439
<ul>
14440
14440
<li>Expectation value (mean) $\langle k\rangle = \mu$,</li>
<h3 id="Normal-or-Gaussian-distribution">Normal or Gaussian distribution<a class="anchor-link" href="#Normal-or-Gaussian-distribution">¶</a></h3><p>... which is, more generally, defined over the real line as</p>
<p>and has mean $\mu$ and variance $\sigma^2$. With $\mu=0$ and $\sigma=1$, this is known as the standard normal distribution.</p>
14452
14452
<p>Because physicists love Gauss more than normality, you can expect to see "Gaussian" more often in the (astro)physics literature. Statisticians normally say "normal".</p>
14453
-
<p>The limiting relationship between the Poisson and Normal distributions is one example of the <strong>central limit theorem</strong>, which says that, under quite general conditions, the average of a large number of random variables tends towards normal, even if the individual variables are not normally distributed. Whether and how well it applies, and just what "large number means", in any given situation is a practical question more than anything else, at least in this course. But the bottom line is that this distribution shows up quite often, and is normally a reasonable guess in those situations where we have to make a choice and have no better ideas.</p>
14453
+
<p>The limiting relationship between the Poisson and Normal distributions is one example of the <strong>central limit theorem</strong>, which says that, under quite general conditions, the average of a large number of random variables tends towards normal, even if the individual variables are not normally distributed. Whether and how well it applies, and just what "large number" means, in any given situation is a practical question more than anything else, at least in this course. But the bottom line is that this distribution shows up quite often, and is normally a reasonable guess in those situations where we have to make a choice and have no better ideas.</p>
14454
14454
<p>Note that intentionally binning up data, when doing so throws out potentially useful information, in the hopes of satisfying the central limit theorem, is generally frowned upon in this class.</p>
14455
14455
<p>Finally, the sum of squares of $\nu$ standard normal variables follows the...</p>
<li><p>If this bothers you, consider playing <a href="https://en.wikipedia.org/wiki/Frogger">Frogger</a> while blindfolded. The game is executing a fully deterministic program, so in reality there is no uncertainty about whether the frog will be smooshed if it hops into the road at a given time. The player is missing this key information, but can still, in principle, make predictions about how likely the frog is to be smooshed at any given time using probabilistic modeling. With repeated experimentation, they could even refine this model to make it more accurate. As far as the player is concerned, whether there is an obstacle in the road is <em>functionally</em> random, despite the underlying mechanics being non-random.</p>
14464
14464
</li>
14465
-
<li><p>We'll follow the convention of using capital $P$ for the probability of a discrete outcome, e.g. $P(N)$ where $N$ is integer-values, or for a generic argument like "data". Probability <em>densities</em> over real-valued variables will get a lower-case $p$. The distinction between capital-$P$ Probability (aka "probability mass") and probability density doesn't matter too often, but occasionally can lead to confusion, so we'll try to keep them straight. (See <strong>probability notes</strong>.)</p>
14465
+
<li><p>We'll follow the convention of using capital $P$ for the probability of a discrete outcome, e.g. $P(N)$ where $N$ is integer-values, or for a generic argument like "data". Probability <em>densities</em> over real-valued variables will get a lower-case $p$. The distinction between capital-$P$ Probability (aka "probability mass") and probability density doesn't matter too often, but occasionally can lead to confusion, so we'll try to keep them straight. (See the <a href="essential_probability.html">probability notes</a>.)</p>
Copy file name to clipboardExpand all lines: notes/essential_probability.ipynb
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -269,7 +269,7 @@
269
269
"source": [
270
270
"### Binomial distribution\n",
271
271
"\n",
272
-
"... whose PMF is $p(k|q,n) = {n \\choose k} q^k (1-q)^{n-k}$ for $k$ successes. ${n \\choose k}$ is the combinatoric \"choose\" function, $\\frac{n!}{k!(n-k)!}$.\n",
272
+
"... whose PMF is $P(k|q,n) = {n \\choose k} q^k (1-q)^{n-k}$ for $k$ successes. ${n \\choose k}$ is the combinatoric \"choose\" function, $\\frac{n!}{k!(n-k)!}$.\n",
273
273
"\n",
274
274
"The Binomial distribution is additive, in that the sum of two Binomial random variables with the same $q$, respectively with $n_1$ and $n_2$ trials, also follows the Binomial distribution, with parameters $q$ and $n_1+n_2$.\n",
275
275
"\n",
@@ -286,7 +286,7 @@
286
286
"\n",
287
287
"... which describes the number of successes when the number of trials is in principle infinite, but $q$ is correspondingly vanishingly small. It has a single parameter, $\\mu$, which corresponds to the product $qn$ when interpretted as a limit of the Binomial distribution. The PMF is\n",
288
288
"\n",
289
-
"$p(k|\\mu) = \\frac{\\mu^k e^{-\\mu}}{k!}$.\n",
289
+
"$P(k|\\mu) = \\frac{\\mu^k e^{-\\mu}}{k!}$.\n",
290
290
"\n",
291
291
"Like the Binomial distribution, the Poisson distribution is additive. It also has the following (probably familiar) properties:\n",
292
292
"* Expectation value (mean) $\\langle k\\rangle = \\mu$,\n",
@@ -303,13 +303,13 @@
303
303
"\n",
304
304
"... which is, more generally, defined over the real line as\n",
"and has mean $\\mu$ and variance $\\sigma^2$. With $\\mu=0$ and $\\sigma=1$, this is known as the standard normal distribution.\n",
309
309
"\n",
310
310
"Because physicists love Gauss more than normality, you can expect to see \"Gaussian\" more often in the (astro)physics literature. Statisticians normally say \"normal\".\n",
311
311
"\n",
312
-
"The limiting relationship between the Poisson and Normal distributions is one example of the **central limit theorem**, which says that, under quite general conditions, the average of a large number of random variables tends towards normal, even if the individual variables are not normally distributed. Whether and how well it applies, and just what \"large number means\", in any given situation is a practical question more than anything else, at least in this course. But the bottom line is that this distribution shows up quite often, and is normally a reasonable guess in those situations where we have to make a choice and have no better ideas.\n",
312
+
"The limiting relationship between the Poisson and Normal distributions is one example of the **central limit theorem**, which says that, under quite general conditions, the average of a large number of random variables tends towards normal, even if the individual variables are not normally distributed. Whether and how well it applies, and just what \"large number\" means, in any given situation is a practical question more than anything else, at least in this course. But the bottom line is that this distribution shows up quite often, and is normally a reasonable guess in those situations where we have to make a choice and have no better ideas.\n",
313
313
"\n",
314
314
"Note that intentionally binning up data, when doing so throws out potentially useful information, in the hopes of satisfying the central limit theorem, is generally frowned upon in this class.\n",
Copy file name to clipboardExpand all lines: notes/generative_models.ipynb
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
"\n",
9
9
"Containing:\n",
10
10
"* An introduction to probabilistic models, why we need them, and how to work with them\n",
11
-
"* Hopefully, some resolution of the frequently confusing key ideas from the overview: (i) data are random, and (2) data are constants"
11
+
"* Hopefully, some resolution of the frequently confusing key ideas from the overview: (1) data are random, and (2) data are constants"
12
12
]
13
13
},
14
14
{
@@ -261,7 +261,7 @@
261
261
"\n",
262
262
"1. If this bothers you, consider playing [Frogger](https://en.wikipedia.org/wiki/Frogger) while blindfolded. The game is executing a fully deterministic program, so in reality there is no uncertainty about whether the frog will be smooshed if it hops into the road at a given time. The player is missing this key information, but can still, in principle, make predictions about how likely the frog is to be smooshed at any given time using probabilistic modeling. With repeated experimentation, they could even refine this model to make it more accurate. As far as the player is concerned, whether there is an obstacle in the road is _functionally_ random, despite the underlying mechanics being non-random.\n",
263
263
"\n",
264
-
"2. We'll follow the convention of using capital $P$ for the probability of a discrete outcome, e.g. $P(N)$ where $N$ is integer-values, or for a generic argument like \"data\". Probability _densities_ over real-valued variables will get a lower-case $p$. The distinction between capital-$P$ Probability (aka \"probability mass\") and probability density doesn't matter too often, but occasionally can lead to confusion, so we'll try to keep them straight. (See **probability notes**.)"
264
+
"2. We'll follow the convention of using capital $P$ for the probability of a discrete outcome, e.g. $P(N)$ where $N$ is integer-values, or for a generic argument like \"data\". Probability _densities_ over real-valued variables will get a lower-case $p$. The distinction between capital-$P$ Probability (aka \"probability mass\") and probability density doesn't matter too often, but occasionally can lead to confusion, so we'll try to keep them straight. (See the [probability notes](essential_probability.ipynb).)"
Copy file name to clipboardExpand all lines: notes/mcmc_diagnostics.ipynb
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@
51
51
"\n",
52
52
"Convergence does **not** mean\n",
53
53
"* that parameters are \"well constrained\" by the data. If you're not satisfied with the constraints you're getting, that's a function of the data and the model, not necessarily a failing of the MCMC sampler.\n",
54
-
"* that the autocorrelation length is small. A chain can be converged _and_ still highly correlated (though this is not desirable.\n",
54
+
"* that the autocorrelation length is small. A chain can be converged _and_ still highly correlated (though this is not desirable).\n",
55
55
"* that there are not occasional excursions beyond a locus in parameter space. If the PDF has tails, the chain will need to occasionally find its way to them; otherwise it isn't doing its job."
Copy file name to clipboardExpand all lines: tutorials/gaussians.ipynb
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -300,7 +300,7 @@
300
300
"source": [
301
301
"Now, compute the parameters of the posterior for $\\beta$ based on $\\mu_\\beta$ and $\\Sigma_\\beta$ (parameters that appear in the sampling distribution) and the parameters of the conjugate prior. Set the prior parameters to be equivalent to the uniform distribution for the check below (you can put in something different to see how it looks later).\n",
302
302
"\n",
303
-
"Transform `post_mean` to a shape (3,) numpy array for convenience (as opposed to, say, a 3x1 matrix)."
303
+
"Transform `post_mean` to a shape (2,) numpy array for convenience (as opposed to, say, a 2x1 matrix)."
Copy file name to clipboardExpand all lines: tutorials/probability_transformations.ipynb
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@
33
33
"source": [
34
34
"## 1. Solve it\n",
35
35
"\n",
36
-
"Given the PDF of $\\theta$ and the function $b(\\theta)$, what is the PDF of $b$, $p(b)$? Fill in an equation below, and also define it as a function. (As simple as it is, you might want to explciitly write down $p(\\theta)$ first.)"
36
+
"Given the PDF of $\\theta$ and the function $b(\\theta)$, what is the PDF of $b$, $p(b)$? Fill in an equation below, and also define it as a function. (As simple as it is, you might want to explicitly write down $p(\\theta)$ first.)"
0 commit comments