Skip to content

Commit fdefb16

Browse files
committed
[prob_dist] update according to editorial suggestions
This commit update according to issue #402 . In particular, it mainly updates the typos, and missing colons.
1 parent 1d67b3e commit fdefb16

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

Diff for: lectures/prob_dist.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Hence the second term takes all $x_i \leq x$ and sums their probabilities.
8686

8787
#### Uniform distribution
8888

89-
One simple example is the **uniform distribution**, where $p(x_i) = 1/n$ for all $n$.
89+
One simple example is the **uniform distribution**, where $p(x_i) = 1/n$ for all $i$.
9090

9191
We can import the uniform distribution on $S = \{1, \ldots, n\}$ from SciPy like so:
9292

@@ -96,7 +96,7 @@ u = scipy.stats.randint(1, n+1)
9696
```
9797

9898

99-
Here's the mean and variance
99+
Here's the mean and variance:
100100

101101
```{code-cell} ipython3
102102
u.mean(), u.var()
@@ -105,7 +105,7 @@ u.mean(), u.var()
105105
The formula for the mean is $(n+1)/2$, and the formula for the variance is $(n^2 - 1)/12$.
106106

107107

108-
Now let's evaluate the PMF
108+
Now let's evaluate the PMF:
109109

110110
```{code-cell} ipython3
111111
u.pmf(1)
@@ -140,7 +140,7 @@ plt.show()
140140
```
141141

142142

143-
The CDF jumps up by $p(x_i)$ and $x_i$.
143+
The CDF jumps up by $p(x_i)$ at $x_i$.
144144

145145

146146
```{exercise}
@@ -194,19 +194,19 @@ u.pmf(1)
194194

195195
#### Binomial distribution
196196

197-
Another useful (and more interesting) distribution is the **binomial distribution** on $S=\{0, \ldots, n\}$, which has PMF
197+
Another useful (and more interesting) distribution is the **binomial distribution** on $S=\{0, \ldots, n\}$, which has PMF:
198198

199199
$$
200200
p(i) = \binom{n}{i} \theta^i (1-\theta)^{n-i}
201201
$$
202202

203203
Here $\theta \in [0,1]$ is a parameter.
204204

205-
The interpretation of $p(i)$ is: the number of successes in $n$ independent trials with success probability $\theta$.
205+
The interpretation of $p(i)$ is: the probability of $i$ successes in $n$ independent trials with success probability $\theta$.
206206

207-
(If $\theta=0.5$, p(i) can be "how many heads in $n$ flips of a fair coin")
207+
(If $\theta=0.5$, p(i) can be the probability of $i$ heads in $n$ flips of a fair coin.)
208208

209-
The mean and variance are
209+
The mean and variance are:
210210

211211
```{code-cell} ipython3
212212
n = 10
@@ -220,7 +220,7 @@ u.mean(), u.var()
220220

221221
The formula for the mean is $n \theta$ and the formula for the variance is $n \theta (1-\theta)$.
222222

223-
Here's the PDF
223+
Here's the PMF:
224224

225225
```{code-cell} ipython3
226226
u.pmf(1)
@@ -236,7 +236,7 @@ plt.show()
236236
```
237237

238238

239-
Here's the CDF
239+
Here's the CDF:
240240

241241
```{code-cell} ipython3
242242
fig, ax = plt.subplots()
@@ -258,7 +258,7 @@ Using `u.pmf`, check that our definition of the CDF given above calculates the s
258258
:class: dropdown
259259
```
260260

261-
Here is one solution
261+
Here is one solution:
262262

263263
```{code-cell} ipython3
264264
fig, ax = plt.subplots()
@@ -283,9 +283,9 @@ $$
283283
p(i) = \frac{\lambda^i}{i!} e^{-\lambda}
284284
$$
285285

286-
The interpretation of $p(i)$ is: the number of events in a fixed time interval, where the events occur at a constant rate $\lambda$ and independently of each other.
286+
The interpretation of $p(i)$ is: the probability of $i$ events in a fixed time interval, where the events occur at a constant rate $\lambda$ and independently of each other.
287287

288-
The mean and variance are
288+
The mean and variance are:
289289
```{code-cell} ipython3
290290
λ = 2
291291
u = scipy.stats.poisson(λ)
@@ -297,7 +297,7 @@ u.mean(), u.var()
297297

298298
The the expectation of Poisson distribution is $\lambda$ and the variance is also $\lambda$.
299299

300-
Here's the PMF
300+
Here's the PMF:
301301

302302
```{code-cell} ipython3
303303
λ = 2
@@ -321,7 +321,7 @@ plt.show()
321321
### Continuous distributions
322322

323323

324-
Continuous distributions are represented by a **density function**, which is a function $p$ over $\mathbb R$ (the set of all numbers) such that $p(x) \geq 0$ for all $x$ and
324+
Continuous distributions are represented by a **probability density function**, which is a function $p$ over $\mathbb R$ (the set of all real numbers) such that $p(x) \geq 0$ for all $x$ and
325325

326326
$$ \int_{-\infty}^\infty p(x) dx = 1 $$
327327

@@ -424,7 +424,7 @@ It has a nice interpretation: if $X$ is lognormally distributed, then $\log X$ i
424424

425425
It is often used to model variables that are "multiplicative" in nature, such as income or asset prices.
426426

427-
We can obtain the moments, PDF, and CDF of the normal density as follows:
427+
We can obtain the moments, PDF, and CDF of the lognormal density as follows:
428428

429429
```{code-cell} ipython3
430430
μ, σ = 0.0, 1.0
@@ -479,7 +479,7 @@ It is related to the Poisson distribution as it describes the distribution of th
479479

480480
It can be shown that, for this distribution, the mean is $1/\lambda$ and the variance is $1/\lambda^2$.
481481

482-
We can obtain the moments, PDF, and CDF of the normal density as follows:
482+
We can obtain the moments, PDF, and CDF of the exponential density as follows:
483483

484484
```{code-cell} ipython3
485485
λ = 1.0
@@ -535,7 +535,7 @@ This distribution has two parameters, $\alpha > 0$ and $\beta > 0$.
535535
It can be shown that, for this distribution, the mean is $\alpha / (\alpha + \beta)$ and
536536
the variance is $\alpha \beta / (\alpha + \beta)^2 (\alpha + \beta + 1)$.
537537

538-
We can obtain the moments, PDF, and CDF of the normal density as follows:
538+
We can obtain the moments, PDF, and CDF of the Beta density as follows:
539539

540540
```{code-cell} ipython3
541541
α, β = 3.0, 1.0
@@ -592,7 +592,7 @@ One interpretation is that if $X$ is gamma distributed and $\alpha$ is an
592592
integer, then $X$ is the sum of $\alpha$ independent exponentially distributed
593593
random variables with mean $1/\beta$.
594594

595-
We can obtain the moments, PDF, and CDF of the normal density as follows:
595+
We can obtain the moments, PDF, and CDF of the Gamma density as follows:
596596

597597
```{code-cell} ipython3
598598
α, β = 3.0, 2.0

0 commit comments

Comments
 (0)