Skip to content

🌐 [translation-sync] Split "Observed Distributions" out of prob_dist and develop it - #278

Merged
mmcky merged 6 commits into
mainfrom
translation-sync-2026-08-03T08-03-09-pr-811
Aug 10, 2026
Merged

mmcky merged 6 commits into
mainfrom
translation-sync-2026-08-03T08-03-09-pr-811

Conversation

@mmcky

@mmcky mmcky commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Automated Translation Sync

This PR contains automated translations from QuantEcon/lecture-python-intro.

Source PR

#811 - Split "Observed Distributions" out of prob_dist and develop it

Files Added

  • lectures/observed_distributions.md
  • .translate/state/observed_distributions.md.yml

Files Updated

  • ✏️ lectures/lln_clt.md
  • ✏️ .translate/state/lln_clt.md.yml
  • ✏️ lectures/_toc.yml

Details

  • Source Language: en
  • Target Language: zh-cn
  • Model: claude-sonnet-5

This PR was created automatically by the translation action.

Copilot AI review requested due to automatic review settings August 3, 2026 08:03
@mmcky mmcky added the action-translation PRs created by QuantEcon/action-translation label Aug 3, 2026
Copilot AI review requested due to automatic review settings August 3, 2026 08:03
@mmcky mmcky added the automated Automated sync PR opened by action-translation label Aug 3, 2026
@netlify

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for playful-platypus-17d3bb ready!

Name Link
🔨 Latest commit 6083116
🔍 Latest deploy log https://app.netlify.com/projects/playful-platypus-17d3bb/deploys/6a79529f8053680008c17080
😎 Deploy Preview https://deploy-preview-278--playful-platypus-17d3bb.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

⚠️ Translation Quality Review

Verdict: WARN | Model: claude-sonnet-5 | Date: 2026-08-10
Routing: editor — verdict WARN (auto-merge requires PASS); diff check failed: structurePreserved; diff check failed: headingMapCorrect; 3 major finding(s); 1 minor finding(s) in gating categories (accuracy/terminology/syntax/diff-check/other); accuracy 8 below floor 9; terminology 8 below floor 9; formatting 7 below floor 8
Shadow gate: would NOT auto-merge (recorded only; no action taken)


📝 Translation Quality

Criterion Score
Accuracy 8/10
Fluency 8/10
Terminology 8/10
Formatting 7/10
Overall 7.9/10

Summary: The translation of lln_clt.md and observed_distributions.md (including all newly added sections like 样本矩, 样本分位数, 箱线图, 经验累积分布函数, 独立性的作用) is accurate, fluent, and terminologically consistent with the glossary. However, prob_dist.md's changed sections show significant content loss: the companion-lecture reference sentence in the Outline is missing, and substantial explanatory paragraphs in the Discrete distributions and Continuous distributions sections (covering E[f(X)], moments, skewness, kurtosis, excess kurtosis, quantile function, median/quartiles/interquartile range, and robustness discussion) were dropped compared to the English source. These omissions materially reduce the completeness of the translated document in the changed sections and should be restored. Overall terminology usage is highly consistent with the provided glossary (e.g., 大数定律, 中心极限定理, 独立同分布, 小提琴图, 核密度估计, 经验累积分布函数) The newly added sections in observed_distributions.md (样本矩, 样本分位数, 箱线图, 独立性的作用) are translated fluently and accurately, preserving mathematical notation and code blocks correctly Long narrative passages (e.g., the Bernoulli LLN example, the AR(1) exercise solution) read naturally in academic Chinese and preserve the logical structure of the proofs

Suggestions:

  • [major · accuracy] lectures/prob_dist.md — ## Outline: The English source added a sentence referencing a companion lecture: 'A companion lecture, {doc}observed_distributions, treats observed data...' This sentence is missing from the Simplified Chinese translation's Outline section. → 添加:'姐妹讲座 {doc}observed_distributions 讨论观测数据——我们测量或收集的一组数字——以及它与本讲所研究的概率分布之间的联系。'
  • [major · accuracy] lectures/prob_dist.md — ## Discrete distributions (mean/variance/moments section): Substantial content was silently dropped from the translation of the discrete distributions section, including the paragraphs on 'Expectation is also called the first moment...', the general definition of E[f(X)], the paragraph on standard deviation being in the same units as X, the discussion of moments/central moments/standardized moments, skewness, kurtosis, excess kurtosis, and the note about… → Restore the omitted paragraphs on E[f(X)], standard deviation units, moments/central moments, skewness, kurtosis, excess kurtosis, and the scipy.stats.kurtosis fisher note, translated into Chinese.
  • [major · accuracy] lectures/prob_dist.md — ## Continuous distributions: The English source's introductory paragraphs for 'Continuous distributions' include definitions of E[f(X)], variance/moments/skewness/kurtosis (same as discrete case), the CDF, quantile function, median, quartiles, interquartile range, and their robustness to outliers (with a forward reference to heavy_tails). Nearly all of this is missing from the Chinese translation, which jumps directly from t… → Add the missing paragraphs on quantile function, median, quartiles, interquartile range, and robustness, with reference to {doc}heavy_tails, translated into Chinese.
  • [minor · terminology] lectures/prob_dist.md — ### Beta distribution: The gamma function link target was changed from the English Wikipedia URL to a Baidu Baike URL, which is an unnecessary and inconsistent substitution not required by any stated policy. → Keep consistent with other links in the document (e.g., use the Wikipedia link as in the English source) unless there's a project-wide policy on link localization.
  • [minor · formatting] lectures/prob_dist.md — ```{code-cell} ipython3 imports block: The translation's import block for prob_dist.md still references a hardcoded local font path and yfinance-unrelated font setup that differs from the English source's simpler import block; while this may be intentional site-wide styling, it introduces a difference not present in the source and not mentioned in any stated policy, which could be flagged as an unexplained addition. → Confirm this font-loading addition is part of an approved site-wide template; if not required, align with the English source's import block.

🔍 Diff Quality

Check Status
Scope Correct
Position Correct
Structure Preserved
Heading-map Correct
Overall 5/10

Summary: File scope and section positions match the source's reorganization, but prob_dist.md in the target is missing significant new conceptual content (moments, skewness, kurtosis, quantiles) that the source added, making structure not fully preserved.

Issues:

  • prob_dist.md target is missing substantial new content that source added: generalized expectation E[f(X)], standard deviation definition, standardized moments, skewness, kurtosis, excess kurtosis discussion, and quantile function/median/quartile definitions in both discrete and continuous distribution sections
  • Target prob_dist.md lacks the new normal/lognormal distribution additions showing skew/kurtosis stats (u.stats(moments='sk'), ppf median/quartiles) that source added
  • This represents missing translated content rather than just a heading-map issue, since large blocks of new source prose were not synced to the target file

This review was generated automatically by action-translation review mode.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 由 translation-sync 自动生成,目的是将上游英文仓库中从 prob_dist 拆分出来的 “Observed Distributions” 讲义同步到中文仓库,并更新目录与相关讲义中的引用关系。

Changes:

  • 新增中文讲义 lectures/observed_distributions.md(观测分布)
  • 更新 lectures/lln_clt.md,将小提琴图引用改为指向新讲义的内部锚点
  • 更新 lectures/_toc.yml 以在目录中加入新讲义(但当前变更引入了缺失章节引用与本地化不一致问题)

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
lectures/observed_distributions.md 新增“观测分布”讲义(含绘图/示例代码),但存在至少一处会运行报错的示例代码与一处图形含义不一致的问题
lectures/lln_clt.md 将小提琴图链接改为 {ref} 指向新讲义锚点,并清理多余空行
lectures/_toc.yml 目录加入 observed_distributions,但同时新增了当前仓库不存在的章节引用,且多个 caption 从中文变为英文
.translate/state/observed_distributions.md.yml 新增翻译状态记录
.translate/state/lln_clt.md.yml 更新翻译状态记录(source sha / synced-at / tool-version 等)
Suppressed comments (2)

lectures/_toc.yml:52

  • _toc.yml 中新增的章节 msy_fishery 在当前仓库中不存在(lectures/msy_fishery.* 未找到),会导致构建失败。若该讲义尚未同步/翻译,应先从 TOC 中移除或注释掉。
  - file: scalar_dynam
  - file: solow
  - file: msy_fishery
  - file: cobweb

lectures/_toc.yml:92

  • _toc.yml 中新增的章节 bayes_intro 在当前仓库中不存在(lectures/bayes_intro.* 未找到),会导致构建失败。若该讲义尚未同步/翻译,应先从 TOC 中移除或注释掉。
  chapters:
  - file: simple_linear_regression
  - file: mle
  - file: bayes_intro
- caption: Other

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +397 to +401
fig, ax = plt.subplots()
ax.hist(x_amazon, bins=20)
ax.set_xlabel('monthly return (percent change)')
ax.set_ylabel('density')
plt.show()
Comment on lines +610 to +612
fig, ax = plt.subplots()
ax.violinplot([x_amazon['AMZN'], x_costco['COST']])
ax.set_ylabel('monthly return (percent change)')
Comment thread lectures/_toc.yml
Comment on lines 26 to 29
- file: pv
- file: cons_smooth
- file: tax_smooth
- file: equalizing_difference
Comment thread lectures/_toc.yml Outdated
Comment on lines +4 to +8
- caption: Introduction
numbered: true
chapters:
- file: about
- caption: 经济数据
- caption: Economic Data
@mmcky

mmcky commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ Do not merge as-is — this PR reverts 14 localised part captions to English.

lectures/_toc.yml in this diff replaces 导言→Introduction, 经济数据→Economic Data, 基础工具→Foundations, 线性动态:有限视界→"Linear Dynamics: Finite Horizons", 概率与分布→Probability and Distributions, 非线性动态→Nonlinear Dynamics, 货币政策与财政政策的相互作用→Monetary-Fiscal Policy Interactions, 随机动态→Stochastic Dynamics, 优化→Optimization, 高维建模→Modeling in Higher Dimensions, 市场与竞争性均衡→Markets and Competitive Equilibrium, 估计→Estimation, 其它→Other and one more. Merging would put English navigation on the Chinese site.

This is not a one-off. The identical thing already happened on the sibling edition: QuantEcon/lecture-python.zh-cn#202 merged 2026-07-24 and that site served 19 English captions and zero Chinese ones for 17 days before it was caught — repair in QuantEcon/lecture-python.zh-cn#245. The mechanism is that a lecture-adding sync regenerates _toc.yml as a full source mirror, and no stage can see the problem: review mode filters the diff to .md files so it never reads _toc.yml (#202's verdict was PASS 9/9/9/9, zero gating findings), and English captions are valid MyST so the strict build passes.

Filed for the durable fix as QuantEcon/action-translation#254. Until that lands, restore the Chinese captions on this branch before merging — same for #279, which carries the same revert.

Noting for whoever picks it up that this PR has three other issues recorded in the 2026-08-10 review: a missing bib key (decock2011ames, from the source PR's 9-line bib addition that the sync did not carry), ToC danglers for tax_smooth / msy_fishery / bayes_intro, and the prob_dist.md half of upstream lecture-python-intro#811 silently absent from the diff despite being listed in the sync metadata.

mmcky and others added 6 commits August 10, 2026 14:16
The sync for QuantEcon/lecture-python-intro#811 landed only half the split
and clobbered the translated table of contents. Four repairs:

- _toc.yml: the sync overwrote the file with upstream's English version,
  reverting every part caption to English and adding entries for
  tax_smooth, msy_fishery and bayes_intro, none of which are translated
  here. Restored the translated toc and added just the one new entry.

- quant-econ.bib: observed_distributions.md cites decock2011ames, which
  the action does not carry across because it never syncs .bib files.
  Appended the upstream entry.

- prob_dist.md: upstream #811 moved the "observed distributions" material
  into its own lecture, but only the addition was synced, so the content
  would have appeared twice. Removed the migrated sections along with
  their heading-glossary entries.

- prob_dist.md: dropped the now-unused yfinance and seaborn imports and
  the yfinance install cell, which only the migrated sections needed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mmcky

mmcky commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

Review: four defects, remediation prepared

Reviewed this against the upstream source in QuantEcon/lecture-python-intro#811. The preview build failure is the visible symptom of a broader problem — the sync applied only half of the upstream split and overwrote the translated table of contents. Two further defects are not visible in the CI log at all.

# Defect Effect
1 lectures/_toc.yml was overwritten with upstream's English version All 13 part captions reverted from Chinese to English (导言Introduction, 概率与分布Probability and Distributions, …), and entries were added for tax_smooth, msy_fishery and bayes_intro, none of which are translated in this repo. This is the toctree contains reference to nonexisting document build failure.
2 decock2011ames missing from lectures/_static/quant-econ.bib observed_distributions.md cites it, producing could not find bibtex key. The action does not sync .bib files, so the entry never crossed over.
3 The prob_dist.md half of the split was never applied Upstream #811 moved the observed-distributions material into its own lecture. Only the addition synced. prob_dist.md is listed in this PR's own metadata block but carries no diff, so merging as-is would publish the same content twice — the sample-moments, histogram, KDE and violin-plot sections would appear in both lectures. Not caught by CI, since nothing about duplication is a Sphinx warning.
4 Dead imports left in prob_dist.md yfinance (plus its !pip install cell) and seaborn were used only by the migrated sections. After the split yf. and sns. appear zero times.

Fix

Defect 1 is repaired by restoring the translated toc and adding a single entry, - file: observed_distributions, after prob_dist. Defect 2 by appending the upstream bib entry verbatim. Defect 3 by removing the migrated sections from prob_dist.md along with their seven now-orphaned translation.headings glossary entries, leaving the file ending at the gamma CDF cell exactly as upstream does. Defect 4 by trimming the import cell to match upstream's, keeping the matplotlib as mpl import that the Chinese font setup needs.

Net effect on prob_dist.md is 263 deleted lines and no additions.

Verification

Checked before committing: every {cite}, {doc} and {ref} target in the new lecture resolves — including violin_plots, whose anchor moved into observed_distributions.md, and heavy_tail, which is already on main. prob_dist.md defines no MyST anchors of its own and every inbound link to it is a whole-document {doc} reference, so the truncation dangles nothing. Frontmatter parses on all three touched files, their 100 code cells compile, and no _toc.yml target is missing a file. Plot text in the new lecture is entirely English, so the absent Chinese font block causes no missing-glyph boxes.

Status

The branch has been rebased onto current main (which has since taken #284, #285, #286, #288 and #289) with the fix committed on top. The commit is not yet pushed — updating the branch requires a force-push after the rebase, which is pending approval. CI has not yet seen the prob_dist.md truncation, so this should not merge until the preview build goes green on the pushed commit.

Two notes beyond this PR

The toc clobbering and the unsynced .bib are both systemic — they will recur on every sync that adds a lecture or a citation. Worth raising against action-translation.

#283 carries the same dropped-file bug: its metadata lists prob_dist.md — upstream QuantEcon/lecture-python-intro#819 adds a "first of three" paragraph there linking observed_distributions and fitting_distributions — and again no diff was generated. That paragraph will need to be added by hand, after #279 lands fitting_distributions.

@mmcky
mmcky force-pushed the translation-sync-2026-08-03T08-03-09-pr-811 branch from 0dda3dd to 6083116 Compare August 10, 2026 04:25
@github-actions

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request August 10, 2026 04:30 Inactive
@mmcky
mmcky merged commit a6ce8c6 into main Aug 10, 2026
8 checks passed
@mmcky
mmcky deleted the translation-sync-2026-08-03T08-03-09-pr-811 branch August 10, 2026 04:37
mmcky added a commit that referenced this pull request Aug 10, 2026
The sync for QuantEcon/lecture-python-intro#819 declared lectures/prob_dist.md
in its metadata but emitted no diff for it, the same dropped-file fault seen
in #278 and #280. Upstream changed that file +7 -2, rewriting the outline to
introduce the three-lecture sequence.

Added the three sequence paragraphs to prob_dist.md, translated to match the
register this PR already uses for the same cross-links in
observed_distributions.md. Both {doc} targets are on main, so they resolve.

Upstream's edit replaces an earlier "A companion lecture" paragraph, but that
paragraph never reached this repo — it belongs to the wider prob_dist.md gap
from QuantEcon/lecture-python-intro#811, tracked in #290 — so the net change
here is an addition. prob_dist's state file is deliberately left untouched so
that gap stays flagged for resync.

Also rebased onto current main. observed_distributions.md and its state file
conflicted add/add against the copy #278 landed; both resolved in favour of
this branch, whose version is the strict superset — 903 lines against 785,
with 19 figure captions and both fitting_distributions cross-links that
main's older copy lacks.

Verified against upstream at a453cf5: same 2 anchors, 13 headings, 42 code
cells and 19 caption blocks, with no duplicate labels or figure names
repo-wide.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mmcky added a commit that referenced this pull request Aug 10, 2026
* Update translation: lectures/mle.md

* Update translation: .translate/state/mle.md.yml

* Update translation: lectures/observed_distributions.md

* Update translation: .translate/state/observed_distributions.md.yml

* FIX: apply the dropped prob_dist.md half of the sequence linking

The sync for QuantEcon/lecture-python-intro#819 declared lectures/prob_dist.md
in its metadata but emitted no diff for it, the same dropped-file fault seen
in #278 and #280. Upstream changed that file +7 -2, rewriting the outline to
introduce the three-lecture sequence.

Added the three sequence paragraphs to prob_dist.md, translated to match the
register this PR already uses for the same cross-links in
observed_distributions.md. Both {doc} targets are on main, so they resolve.

Upstream's edit replaces an earlier "A companion lecture" paragraph, but that
paragraph never reached this repo — it belongs to the wider prob_dist.md gap
from QuantEcon/lecture-python-intro#811, tracked in #290 — so the net change
here is an addition. prob_dist's state file is deliberately left untouched so
that gap stays flagged for resync.

Also rebased onto current main. observed_distributions.md and its state file
conflicted add/add against the copy #278 landed; both resolved in favour of
this branch, whose version is the strict superset — 903 lines against 785,
with 19 figure captions and both fitting_distributions cross-links that
main's older copy lacks.

Verified against upstream at a453cf5: same 2 anchors, 13 headings, 42 code
cells and 19 caption blocks, with no duplicate labels or figure names
repo-wide.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action-translation PRs created by QuantEcon/action-translation automated Automated sync PR opened by action-translation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants