prob_meaning.md: assorted corrections
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 20/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- documentation
Hướng nghiên cứu
Bắt đầu với lectures/prob_meaning.md và rà soát checklist đối chiếu với issue #878, issue này cho biết đã xử lý tất cả các mục. Kiểm tra các bài tập, ô mã, công thức, cách đặt tên, tham chiếu chéo và các biểu đồ bị ảnh hưởng; được xem là hoàn tất khi các sửa đổi được ghi chép đã có mặt và bài giảng vẫn nhất quán, dễ đọc.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
A collection of small issues found in lectures/prob_meaning.md.
- Exercise pm_ex2 part (a): The question asks for the likelihood function for a sample of length $n$, but the solution provides the likelihood for a single flip ($n=1$). Either the question or the solution should be revised so they match.
- Exercise pm_ex2 solution, before part (c): The sentence "Now pretend that the true value of $\theta = .4$..." appears twice — once as a standalone line before part (c) and again as the opening of part (c) itself. The first occurrence should be removed.
- Bayesian section, missing setup before exercise pm_ex2: Bayes' Law, likelihood functions, and posterior distributions are not mentioned in the lecture text before the exercise — they only appear inside the solution. These concepts are already introduced in Probability with Matrices (
prob_matrix), so a back-reference (e.g., "Recall the posterior distribution derived using Bayes' Law in {doc}Probability with Matrices <prob_matrix>") before the exercise would bridge the gap without duplicating material. - $n$-step posterior formula is used before it's derived: The solution code in part (c) uses $\text{Beta}(\alpha + k, \beta + n - k)$ via
form_single_posterior, and all subsequent plots and coverage interval calculations depend on it. But the formal derivation doesn't appear until much later, in the "It is natural to extend the one-step Bayesian update..." section after the exercise. Moving the derivation earlier means that later section also needs to be revised or removed to avoid duplication. - Line length throughout code cells: Comments, docstrings, and code lines frequently exceed 80 characters, making them hard to read on the website. Sentences in comments should also start with a capital letter. Affected areas include the
Bayesianclass docstrings and various plotting cells (e.g., lines 506, 509, 551, 555, 682). - Variable naming: Several names are unclear or misleading:
iiis used both as a loop index and as a posterior distribution in list comprehensions (e.g.,ii.cdf(...),ii.mean()). Useifor indices andpostorposteriorfor distributions.num/num_list→n_obs/n_obs_list(it's the number of observations, not a generic number)step_num→n_obs(it's not a "step")kk→k(no reason for the doubled name)npt,nn,nI→ more descriptive names liken_thetas,n_ns,n_IsK→head_counts(capitalKlooks like a constant)comp→table
- PEP 8 naming conventions:
Bay_statshould bebay_statorbayes— instance names should besnake_case, notPascalCase.frequentistclass should beFrequentist— class names should bePascalCase. (TheBayesianclass already follows this convention.)
- Plot label formatting: Line 590 uses
'n=%d thousand' % (num/1000), which produces awkward labels like "n=5 thousand". Use f-string formatting with comma separators instead, e.g.,f'Posterior with n={n_obs:,}'→ "n=5,000". - Typos and spelling:
- "probabilties" → "probabilities" (line 76)
- "to to help" → "to help" (line 36, doubled word)
- "probabililty" → "probability" (lines 381, 546, 555, 564, 568, 572 — same misspelling repeated 6 times)
- "statististian" → "statistician" (line 690)
- Notation inconsistency: Line 331 refers to "the average of $P_{k,i}$" but the variable was defined as $\rho_{k,i}$ on line 325.
- Subject-verb agreement (line 602): "posterior means converges" → "posterior mean converges"; "posterior standard deviations converges" → "posterior standard deviation converges".
- LaTeX equations use
*for multiplication (lines 638, 642, 646): Should use\cdotor juxtaposition instead. - Spiky posterior density plots:
θ_values = np.linspace(0.01, 1, 100)only provides 100 grid points. The part (h) plot is zoomed to [0.3, 0.5], leaving ~20 points to render highly concentrated posteriors. Increase the grid resolution (e.g., 1000 points). - Cross-references say "this quantecon lecture" (lines 719–722): These render poorly in PDF where there's no hyperlink context. Replace with actual lecture titles: Non-Conjugate Priors, Posterior Distributions for AR(1) Parameters, and Forecasting an AR(1) Process.
- Variance formula is wrong (lines 327–329): The variance of $\rho_{k,i}$ is given as $n \cdot \text{Prob}(X=k|\theta) \cdot (1 - \text{Prob}(X=k|\theta))$, but $\rho_{k,i}$ is a Bernoulli indicator, so its variance is $\text{Prob}(X=k|\theta) \cdot (1 - \text{Prob}(X=k|\theta))$ — no factor of $n$.
- Upper and lower bounds swapped in part (e) (lines 521–522):
ppf(0.05)(the 5th percentile) is assigned toupper_boundandppf(0.95)(the 95th percentile) tolower_bound. Lines 672–673 do it correctly. -
compare()skips $k=0$ (line 192):range(n)withi+1starts at $k=1$, but $k=0$ is a valid binomial outcome. - Exercise pm_ex1 part 3 is vague: "With the Law of Large numbers in mind, use your code to say something" — say something about what?
- Text says $\log(I)$ varies from 2 to 7 (line 286) but code has
I_log_high = 6(line 289). - Line 321 is imprecise: Says the observed fraction approximates $\theta$, but $f_k^I$ approximates $\text{Prob}(X=k|\theta)$, not $\theta$ itself.
- Inconsistent bool-to-int conversion: The
frequentistclass uses* 1(line 171) whileBayesianuses.astype(int)(line 455). Should be consistent —.astype(int)is clearer.
All items addressed in #878.
- Ngôn ngữ chính
- TeX
- Star
- 123
- Fork
- 57
- Merge trung bình
- 3 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 11
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của QuantEcon/lecture-python.myst
-
Link Checker Report Đang mởautomated issue linkchecker report
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
QuantEcon/lecture-python.myst#1062 ·
-
bug content
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
QuantEcon/lecture-python.myst#1021 ·
-
[organization_capital] posterior-mean figure does not show the convergence the text describes Đang mởmedium-priority new-lecture
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
QuantEcon/lecture-python.myst#1015 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
QuantEcon/lecture-python.myst#990 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
QuantEcon/lecture-python.myst#986 ·
Tất cả issue của QuantEcon/lecture-python.myst
Issue tương tự
-
agent-ready documentation needs-triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
-
untriaged
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
dotnet/dotnet-api-docs#13095 ·
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100