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
Add SD shading to remaining distributions and enhance documentation
- Add mean ± 1 SD shaded region to Bernoulli PMF
- Add mean ± 1 SD shaded region to Hypergeometric PMF
- Add visualization aids bullet to "Reading the PMF" section explaining mean line and SD region
- Add visualization aids bullet to "Reading the CDF" section explaining mean line
- Ensures consistent visualization across all discrete distributions
The PMF shows two bars: P(X=0) = 0.7 for a negative test and P(X=1) = 0.3 for a positive test. The red dashed line marks the mean ($p = 0.3$).
166
+
The PMF shows two bars: P(X=0) = 0.7 for a negative test and P(X=1) = 0.3 for a positive test. The red dashed line marks the mean ($p = 0.3$), and the orange shaded region shows mean ± 1 standard deviation.
163
167
164
168
```{code-cell} ipython3
165
169
:tags: [remove-input, remove-output]
@@ -199,6 +203,7 @@ Note: Here, P(X ≤ 0) = P(X = 0) = 0.7 because X can't take negative values; in
199
203
-**How to read:** Look at the bar height to find P(X = k) for any specific value k
200
204
-**Practical use:** Answer questions like "What's the probability of success?" or "What's the probability of exactly 1 positive test?"
201
205
-**Key property:** All bar heights must sum to 1.0 (total probability)
206
+
-**Visualization aids:** The red dashed line marks the mean (expected value), and the orange shaded region shows mean ± 1 standard deviation (where ~68% of values typically fall)
202
207
203
208
**Reading the CDF**
204
209
@@ -211,6 +216,7 @@ Note: Here, P(X ≤ 0) = P(X = 0) = 0.7 because X can't take negative values; in
211
216
- Find P(X > k) by calculating 1 - P(X ≤ k)
212
217
- Find P(a < X ≤ b) by calculating P(X ≤ b) - P(X ≤ a)
213
218
-**Key property:** The CDF is right-continuous, always increases (or stays flat), and approaches 1.0
219
+
-**Visualization aids:** The red dashed line marks the mean (expected value) as a reference point
214
220
215
221
**Note on CDF visualization:** The charts use `where='post'` in the step plot to create proper right-continuous step functions. This means the CDF jumps up at each value and includes that value in the cumulative probability.
The PMF shows most likely to get 0 Aces (about 0.66 probability), less likely to get 1 or 2. The red dashed line marks the mean.
1793
+
The PMF shows most likely to get 0 Aces (about 0.66 probability), less likely to get 1 or 2. The red dashed line marks the mean, and the orange shaded region shows mean ± 1 standard deviation.
0 commit comments