Skip to content

🌐 [translation-sync] [likelihood_bayes] Update lecture according to the style guide (recovery of #240) - #255

Merged
mmcky merged 14 commits into
mainfrom
translation-sync-2026-08-05T10-08-37-pr-651
Aug 19, 2026
Merged

🌐 [translation-sync] [likelihood_bayes] Update lecture according to the style guide (recovery of #240)#255
mmcky merged 14 commits into
mainfrom
translation-sync-2026-08-05T10-08-37-pr-651

Conversation

@mmcky

@mmcky mmcky commented Aug 19, 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.


Recovery note: this PR recovers #240, auto-closed by the rebase force-push race on 2026-08-18 23:22:43Z (see the correction comment there). Same branch; body restored verbatim from #240 so review mode can locate the Source PR reference.

Copilot AI lite review requested due to automatic review settings August 19, 2026 00:39
@netlify

netlify Bot commented Aug 19, 2026

Copy link
Copy Markdown

Deploy Preview for astonishing-narwhal-a8fc64 ready!

Name Link
🔨 Latest commit 863642b
🔍 Latest deploy log https://app.netlify.com/projects/astonishing-narwhal-a8fc64/deploys/6a853933ff88760008ca5102
😎 Deploy Preview https://deploy-preview-255--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.

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 PR reintroduces the translation-sync updates from #240, aligning the zh-cn lecture content and translation state files with the upstream style-guide changes for the likelihood/Bayes lectures.

Changes:

  • Update lectures/likelihood_bayes.md formatting and MyST conventions (heading keys, references, math notation, figure metadata).
  • Apply small consistency/format tweaks in lectures/likelihood_ratio_process.md and lectures/likelihood_ratio_process_2.md.
  • Refresh .translate/state/*.yml metadata to reflect the new source SHA, sync date, mode, and tool version.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lectures/likelihood_ratio_process.md Minor formatting/indent alignment in prose.
lectures/likelihood_ratio_process_2.md Small prose cleanup; updates a code-cell helper signature and RNG usage.
lectures/likelihood_bayes.md Main style-guide alignment: headings, refs, math notation, plotting metadata/formatting.
.translate/state/likelihood_ratio_process.md.yml Update translation-sync state metadata (sha/date/tool-version).
.translate/state/likelihood_ratio_process_2.md.yml Update translation-sync state metadata and mode.
.translate/state/likelihood_bayes.md.yml Update translation-sync state metadata and mode.
Suppressed comments (1)

lectures/likelihood_ratio_process_2.md:166

  • simulate 中使用 rng.beta(...) 依赖调用者传入 rng,但本讲座未展示 rng 的创建/传递,且其余随机数生成仍使用 np.random。为保持一致性并避免读者按当前代码调用时失败,建议继续使用 np.random.beta(...)(或在全讲座统一引入并传递 rng)。
    for i in range(N):
        for j in range(T):
            w = rng.beta(a, b)
            l_arr[i, j] = f(w) / g(w)

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

```{code-cell} ipython3
@jit
def simulate(a, b, T=50, N=500):
def simulate(a, b, rng, T=50, N=500):
@mmcky mmcky added action-translation PRs created by QuantEcon/action-translation automated Automated sync PR opened by action-translation and removed action-translation PRs created by QuantEcon/action-translation labels Aug 19, 2026
mmcky added a commit that referenced this pull request Aug 19, 2026
…in likelihood_ratio_process_2 and the branch's newer sync state (2026-08-18 v0.26.0 regeneration)
@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown

✅ Translation Quality Review

Verdict: PASS | Model: claude-sonnet-5 | Date: 2026-08-19
Routing: editor — 2 minor finding(s) in gating categories (accuracy/terminology/syntax/diff-check/other); accuracy 8 below floor 9; terminology 8 below floor 9
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 8/10
Overall 8/10

Summary: This is a high-quality, technically rigorous translation of three closely related and lengthy lectures on likelihood ratio processes and Bayesian learning. Mathematical content, MyST formatting, and code blocks are faithfully preserved, and terminology is largely consistent with the provided glossary and standard Chinese econometrics/probability usage. Minor issues include a small terminology inconsistency ('本质' vs '自然' for 'Nature' in one Markov chain plot title), a divergence in the random-seeding code pattern in likelihood_bayes.md relative to the English source, and a slightly awkward sentence structure in the Bayesian updating section. No blocking or major issues were found, and no markdown/MyST syntax errors were detected. Mathematical notation, LaTeX equations, and equation labels are preserved accurately across all three files, including complex derivations of Bayes' law recursions and KL divergence formulas. Technical terminology such as '似然比过程', '贝叶斯定律', '后验概率', 'KL散度', '鞅收敛定理' is used consistently and matches standard Chinese academic usage. Code blocks, MyST directives ({doc}, {ref}, {eq}, {cite}), and cross-references are correctly preserved and functional throughout the long, complex documents. The translation of dense conceptual passages (e.g., martingale convergence discussion, likelihood ratio recursion derivations) maintains logical flow and mathematical rigor in fluent Chinese.

Suggestions:

  • [minor · accuracy] lectures/likelihood_bayes.md — ## Overview / code-cell importing modules: The English source imports from numba import vectorize, jit, prange and from scipy.integrate import quad along with import pandas as pd and sets a seed with a jitted set_seed() function using np.random.seed(142857). The Simplified Chinese translation replaces this with rng = np.random.default_rng(142857) and adds font-loading code not present in the source, and drops prange. This ch… → If code changes are intentional to match repo-wide conventions, this is acceptable, but consider noting they diverge from the English source's global-seed approach for future maintenance parity.
  • [minor · terminology] lectures/likelihood_ratio_process.md — ## Markov chains::Simulations: In the translated analyze_markov_chains docstring/plot title, '马尔可夫链似然比(本质 = f)' uses '本质' (essence/nature-as-concept) instead of '自然' (Nature, the entity used throughout the rest of the document, e.g., '自然从链f中采样'). This is inconsistent with the established translation of 'Nature' elsewhere in the same section. → Change to '马尔可夫链似然比(自然 = f)' for consistency with the rest of the document.
  • [minor · fluency] lectures/likelihood_bayes.md — ### Mechanical details again: The sentence '在绘制$w_0$后,工人使用贝叶斯定理推导出后验概率$\pi_0 = {\rm Prob}({a = f | w_0})$(即密度为$f(w)$的概率)为:' reads slightly awkwardly with the parenthetical inserted mid-sentence; the English original places 'that the density is f(w)' after the whole clause. This is a minor readability issue, not a meaning error. → Consider: '在抽取$w_0$后,工人使用贝叶斯定律推导出密度为$f(w)$的后验概率$\pi_0 = {\rm Prob}({a = f | w_0})$为:'
  • [nit · terminology] lectures/likelihood_ratio_process_2.md — ## Blume and Easley's setting: 'Blume和Easley的设定' mixes English author names with Chinese; this is consistent with glossary guidance to keep proper names, but the reader might expect Chinese transliteration given other economist names in the glossary are transliterated (e.g., Milton Friedman → 米尔顿·弗里德曼). Since Blume and Easley are not in the provided glossary, retaining English names is a reasonable and defensible choice, but f… → No change required; note only for glossary completeness in future.

🔍 Diff Quality

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

Summary: The translation sync correctly updated all three files with matching content changes, preserved document structure and anchor renames, and appropriately updated translation heading-maps to reflect the revised English headings.

Issues:

  • The source's likelihood_bayes.md changed the anchor label from (likelihood_ratio_process) to (likelihood_bayes), but the target file's translation frontmatter and content correctly reflect this rename, along with cross-reference updates from {doc}this lecture <...> to bare {doc}... references - this was correctly propagated.
  • Minor: source added new mystnb figure directives with captions/names (fig-posterior-lratio-f, fig-posterior-lratio-g, fig-posterior-mixture) which were correctly mirrored in the target with translated captions.

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

@mmcky
mmcky force-pushed the translation-sync-2026-08-05T10-08-37-pr-651 branch from d4bfe8c to 252c21c Compare August 19, 2026 04:59
@mmcky

mmcky commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

♻️ Automatically rebased after #248 was merged.

Overlapping files: lectures/likelihood_bayes.md

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

mmcky and others added 2 commits August 19, 2026 15:01
Reconciles the style-guide regeneration of likelihood_bayes with the RNG
refactor that landed via #248:

- code cells take main's Generator API and match the English source
  (rng threading, range not prange, single-line np.unique)
- the Monte Carlo comment keeps its Chinese translation rather than
  reverting to the source's English
- likelihood_bayes state takes main's source-sha 06c784f: it is a
  descendant of the branch's 07975d5, so it is the newest source commit
  now reflected in the content
- likelihood_ratio_process_2 state keeps the branch's 07975d5, which is
  the descendant of main's acc5fa2
- likelihood_ratio_process_2 keeps main's CJK-spaced eq reference

The branch's four review-flagged fixes are preserved: the three mystnb
figure caption blocks, KL rather than Jensen-Shannon in the docstring,
the {eq} cross-reference in place of a hardcoded number, and \ell
notation in eq_recur1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The rebase automation force-pushed this branch mid-reconcile and its
resolution of the likelihood_bayes conflict partially reverted the RNG
refactor that landed via #248. This merge keeps the hand resolution and
adopts the automation's prose improvements.

Kept from the hand resolution:
- create_table is called with rng; the automation's call omitted the
  now-required positional argument and would raise TypeError at build
- rng = np.random.default_rng(142857) rather than the old @jit set_seed
- prange dropped from the numba import, matching the source
- the Monte Carlo comment stays translated
- CJK spacing before {doc} and {eq} roles

Adopted from the automation:
- the mixture caption reads 混合模型下的后验, closer to the source
- a stray 在 dropped from the mixture-timing paragraph
- full-width parentheses in likelihood_ratio_process_2

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request August 19, 2026 06:35 Inactive
@mmcky
mmcky merged commit 6340ebd into main Aug 19, 2026
7 of 8 checks passed
@mmcky
mmcky deleted the translation-sync-2026-08-05T10-08-37-pr-651 branch August 19, 2026 06:40
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