Skip to content

🌐 [translation-sync] [likelihood_bayes] Update lecture according to the style guide - #240

Closed
mmcky wants to merge 0 commit into
mainfrom
translation-sync-2026-08-05T10-08-37-pr-651
Closed

🌐 [translation-sync] [likelihood_bayes] Update lecture according to the style guide#240
mmcky wants to merge 0 commit into
mainfrom
translation-sync-2026-08-05T10-08-37-pr-651

Conversation

@mmcky

@mmcky mmcky commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Automated Translation Sync

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

Source PR

#651 - [likelihood_bayes] Update lecture according to the style guide

Files Updated

  • ✏️ lectures/likelihood_bayes.md
  • ✏️ .translate/state/likelihood_bayes.md.yml
  • ✏️ lectures/likelihood_ratio_process.md
  • ✏️ .translate/state/likelihood_ratio_process.md.yml
  • ✏️ lectures/likelihood_ratio_process_2.md
  • ✏️ .translate/state/likelihood_ratio_process_2.md.yml

Details

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

This PR was created automatically by the translation action.

Copilot AI lite review requested due to automatic review settings August 5, 2026 10:08
@mmcky mmcky added action-translation PRs created by QuantEcon/action-translation automated Automated sync PR opened by action-translation lecture review labels Aug 5, 2026
@netlify

netlify Bot commented Aug 5, 2026

Copy link
Copy Markdown

Deploy Preview for astonishing-narwhal-a8fc64 ready!

Name Link
🔨 Latest commit cd74b31
🔍 Latest deploy log https://app.netlify.com/projects/astonishing-narwhal-a8fc64/deploys/6a84e945dc494b0009adb270
😎 Deploy Preview https://deploy-preview-240--astonishing-narwhal-a8fc64.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 5, 2026

Copy link
Copy Markdown

✅ Translation Quality Review

Verdict: PASS | Model: claude-sonnet-5 | Date: 2026-08-05
Routing: editor — 1 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: translation整体准确、术语规范,格式基本保持完整,但在代码示例中存在与英文原文不一致的randomness API使用问题(缺少rng对象定义),这可能导致读者运行代码时产生错误,属于格式/技术准确性问题,建议修正。语言流畅度总体良好,仅有少量表达可进一步优化。 数学公式、LaTeX表达式与代码块基本完整保留,未破坏原始格式 专业术语(如“似然比过程”“贝叶斯定律”“KL散度”等)翻译准确且与术语表高度一致 长难句的拆分和结构调整基本符合中文学术写作习惯,整体可读性较好

Suggestions:

  • [major · formatting] lectures/likelihood_ratio_process.md — Nature permanently draws from density g (代码单元): 翻译版本中的代码调用与英文源不一致:英文源使用 simulate_sequences('g', f, g, rng, (F_a, F_b), (G_a, G_b))(包含rng参数),但翻译中的代码去掉了rng参数(如 simulate_sequences('g', f, g, (F_a, F_b), (G_a, G_b))),且函数定义中也缺少rng相关内容,与Overview部分声明使用rng = np.random.default_rng()的设置不符,导致代码示例前后矛盾。 → 保持与英文源代码一致,包含rng参数,或者统一在整篇文档中使用np.random模块(不使用rng),避免前后矛盾。
  • [minor · terminology] lectures/likelihood_bayes.md — ## 背景设置: "IID"在英文原文中通常保留大写缩写形式,但翻译中多处译为“独立同分布”,虽然意思正确,但与其他部分(如保留"IID"缩写)不完全一致,建议统一处理方式(either全部展开为“独立同分布”或保留英文缩写并加注释)。 → 统一使用“独立同分布(IID)”的形式,首次出现时给出全称并保留英文缩写,之后可直接使用“IID”或“独立同分布”。
  • [minor · fluency] lectures/likelihood_ratio_process_2.md — ## Blume和Easley的设定: “作为第二种情况,让让我们假设”这句翻译中虽无重复错误,但部分句子如“作为第一种情况,让我们假设”系列表达稍显生硬,不如原文的英文简洁自然,可以适当调整语序以提升流畅度。 → 可改写为“首先,考虑第一种情形:...”,“其次,考虑第二种情形:...”等更符合中文表达习惯的方式。
  • [minor · formatting] lectures/likelihood_ratio_process.md — ### Simulations 附近代码块: 英文原文中函数调用包含rng参数(如np.random.beta替换为rng.beta),但翻译文档的代码示例中直接使用了np.random.beta而没有定义rng对象,与文档开头声明的rng = np.random.default_rng()不一致,可能导致读者在实际运行代码时出现变量未定义的错误。 → 确保代码示例中定义并使用了与文档开头一致的随机数生成器对象(如rng),或统一改为使用np.random模块。

🔍 Diff Quality

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

Summary: The translation sync correctly modified the same three files as the English source, preserved section order and structure, and updated the translation heading-maps to reflect renamed/re-cased headings and titles.

Issues:

  • In likelihood_bayes.md, the anchor tag was changed from (likelihood_ratio_process)= to (likelihood_bayes)= — this matches the English source's change and is correctly mirrored, but worth noting as a structural anchor change that was correctly propagated.
  • Heading map key 'The Setting' was correctly updated to 'The setting' (lowercase 's') matching the English source's heading case change.
  • Heading map keys for likelihood_bayes.md correctly reflect renamed headings (e.g., 'Likelihood Ratio Processes and Bayes' Law' -> 'Likelihood ratio processes and Bayes' law', 'Behavior of Posterior Probability...' -> 'Behavior of posterior probability...', etc.), consistent with English source title-case-to-sentence-case changes.
  • Minor: in likelihood_ratio_process.md and likelihood_ratio_process_2.md, the translation replaced 'rng' parameter usage with 'np.random' calls directly (removing rng from function signatures), which is a deviation from the English source's refactor to use rng consistently — however this appears to be a pre-existing difference in the target's before-state, not introduced by this sync, and does not affect scope/position/structure verification of the sync itself.

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

This automated translation-sync PR updates the Chinese lecture content for the likelihood/Bayes materials to match upstream style-guide changes from QuantEcon/lecture-python.myst (PR #651), including code-cell style and RNG handling in simulations.

Changes:

  • Adjusts lecture prose/formatting and MyST/JupyterBook markup (figure metadata, equation labels, spacing).
  • Refactors likelihood-ratio simulation helpers to use an injected RNG (rng) instead of global np.random in the likelihood ratio process lectures.
  • Updates translation-sync state metadata (source SHA, sync date, mode, tool version).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lectures/likelihood_ratio_process.md Style/format updates and RNG-injection refactor in likelihood-ratio simulation helpers.
lectures/likelihood_ratio_process_2.md Style/format updates and RNG-injection refactor for the simulate helper.
lectures/likelihood_bayes.md Style-guide alignment: headings normalization, MyST figure metadata, equation labeling, and formatting tweaks.
.translate/state/likelihood_ratio_process.md.yml Updates translation-sync state (source SHA/date/mode/tool version).
.translate/state/likelihood_ratio_process_2.md.yml Updates translation-sync state (source SHA/date/mode/tool version).
.translate/state/likelihood_bayes.md.yml Updates translation-sync state (source SHA/date/mode/tool version).
Suppressed comments (1)

lectures/likelihood_ratio_process.md:181

  • simulate_sequences now takes rng as the 4th positional argument, but the examples later in this lecture still call it as simulate_sequences('g', f, g, (F_a, F_b), (G_a, G_b), ...). With the current signature, the (F_a, F_b) tuple is bound to rng, leading to an AttributeError when simulate_likelihood_ratios executes rng.beta(...). To keep existing calls working while still supporting an injected RNG, move rng to the end (optional) and initialize a default generator when it’s not provided.
def simulate_sequences(distribution, f_func, g_func, rng,
        F_params=(1, 1), G_params=(3, 1.2), T=50, N=500):
    """
    Generate N sequences of T observations from specified distribution.
    """

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

@mmcky mmcky closed this Aug 18, 2026
@mmcky
mmcky force-pushed the translation-sync-2026-08-05T10-08-37-pr-651 branch from 434b0c7 to cd74b31 Compare August 18, 2026 23:22
@mmcky

mmcky commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

♻️ Automatically rebased after #228 was merged.

Overlapping files: lectures/likelihood_ratio_process.md

The translation content is preserved; only unchanged sections were updated to match the current main branch. Please re-review if needed.

@mmcky

mmcky commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Correction to my closing comment above — this PR was not subsumed. The event log shows head_ref_force_pushed and closed in the same second (2026-08-18 23:22:43Z): the Rebase Translation PRs automation force-pushed this branch during the merge burst, GitHub momentarily evaluated it as empty against main, and auto-closed the PR. The branch actually carries 6 files (likelihood_bayes, likelihood_ratio_process, likelihood_ratio_process_2 + their state entries). The same race closed #247 at 23:27:11Z. Both need reopening; the empty-diff appearance at close time was an artifact of the race, not delivered content.

mmcky added a commit that referenced this pull request Aug 19, 2026
…he style guide (recovery of #240) (#255)

* Update translation: lectures/likelihood_bayes.md

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

* Update translation: lectures/likelihood_ratio_process.md

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

* Update translation: lectures/likelihood_ratio_process_2.md

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

* Update translation: lectures/likelihood_bayes.md

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

* Update translation: lectures/likelihood_ratio_process.md

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

* Update translation: lectures/likelihood_ratio_process_2.md

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

---------

Co-authored-by: Claude Fable 5 <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 lecture review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants