Skip to content

🌐 [translation-sync] bayes_nonconj: declare the truncated log-normal prior's (0, 1] support (numpyro 0.22) - #288

Merged
mmcky merged 2 commits into
mainfrom
translation-sync-2026-10-05T01-55-56-pr-1065
Oct 6, 2026
Merged

mmcky merged 2 commits into
mainfrom
translation-sync-2026-10-05T01-55-56-pr-1065

Conversation

@mmcky

@mmcky mmcky commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Automated Translation Sync

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

Source PR

[#1065 - bayes_nonconj: declare the truncated log-normal prior's (0, 1] support (numpyro 0.22)](QuantEcon/lecture-python.myst#1065)

Files Updated

  • ✏️ lectures/bayes_nonconj.md
  • ✏️ .translate/state/bayes_nonconj.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 balanced review requested due to automatic review settings October 5, 2026 01:56
@mmcky mmcky added action-translation PRs created by QuantEcon/action-translation automated Automated sync PR opened by action-translation labels Oct 5, 2026
@netlify

netlify Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for astonishing-narwhal-a8fc64 ready!

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

Copy link
Copy Markdown

✅ Translation Quality Review

Verdict: PASS | Model: claude-sonnet-5 | Date: 2026-10-05
Routing: editor — 1 minor finding(s) in gating categories (accuracy/terminology/syntax/diff-check/other)
Shadow gate: would NOT auto-merge (recorded only; no action taken)


📝 Translation Quality

Criterion Score
Accuracy 9/10
Fluency 9/10
Terminology 9/10
Formatting 8/10
Overall 8.9/10

Summary: The changed sections (frontmatter/preamble and the truncated log-normal prior subsection) are translated accurately and fluently, preserving all mathematical notation, code blocks, and MyST directive syntax correctly. Terminology aligns well with the glossary and established conventions. Minor stylistic nitpicks exist (slight repetition in a code comment translation) but do not impede comprehension. The addition of font-configuration code in the import cell is a deviation worth flagging for awareness, though it appears to be a standard practice for CJK rendering support rather than a translation error. The translated 'A truncated log-normal prior' section accurately preserves the mathematical description of the truncated log-normal construction (Z ~ N(μ,σ) truncated to Z ≤ 0, θ = e^Z) and the NumPyro-specific implementation details. Code comments are faithfully translated while preserving code block structure and syntax. The YAML frontmatter translation metadata block is correctly added and does not interfere with document structure, matching expected conventions. Technical terminology (截断对数正态, 支撑范围, 采样器) is consistent and correctly reflects standard statistical translation conventions.

Suggestions:

  • [minor · formatting] lectures/bayes_nonconj.md — preamble/frontmatter - imports code cell: The translation adds extra code lines (matplotlib font configuration: import matplotlib as mpl, FONTPATH = ..., mpl.font_manager.fontManager.addfont(FONTPATH), plt.rcParams['font.family'] = ['Source Han Serif SC']) that are not present in the English source's import code-cell. This is a code addition beyond the text translation task, which may be intentional for CJK font rendering in plot… → If this is a standard practice for all translated lectures to ensure CJK characters render in matplotlib figures, no change needed; otherwise confirm this addition is sanctioned.
  • [minor · accuracy] lectures/bayes_nonconj.md — ### 截断对数正态先验 - code comment: The English comment says 'Declare the (0, 1] support: ExpTransform alone advertises (0, ∞), which would let the sampler propose θ > 1.' The Chinese translation renders this as '声明(0, 1]这个支撑范围:单独使用ExpTransform会声明支撑为(0, ∞),这会让采样器提议出θ > 1的取值' which is accurate, though 'advertises' is translated as '声明' twice in the same sentence for two different English verbs ('Declare' and 'advertises'), which is … → Optional: vary wording, e.g., '单独使用ExpTransform会将支撑范围标示为(0, ∞)' to avoid repeating '声明'.
  • [nit · fluency] lectures/bayes_nonconj.md — ### 截断对数正态先验: '尽可能靠近先验所允许的数据方向' slightly awkward rendering of 'as close to the data as the prior permits' appears in the uniform prior section, not truncated log-normal; disregard if out of scope. (Kept for completeness but this sentence is in the unchanged 'A uniform prior' section per the diff, so not to be flagged under PR scope.)

🔍 Diff Quality

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

Summary: The translation correctly mirrors the source's code change (adding explicit support declaration to truncated_lognormal) in the same location with no structural or scope issues.


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.

Copilot review overview

🟢 Approval recommended

The code change matches the upstream source verbatim, the translated comment is accurate, and the state metadata is consistent.

Review effort: Balanced
Findings: None

What changed in this PR

This is an automated translation-sync PR that propagates upstream changes from the English lecture repository (QuantEcon/lecture-python.myst#1065) into the Simplified Chinese lecture lectures/bayes_nonconj.md. The upstream fix declares the truncated log-normal prior's (0, 1] support explicitly (for numpyro 0.22) so the sampler no longer proposes θ > 1. This keeps the zh-cn lectures faithful to the upstream English source.

Changes:

  • Wraps the truncated log-normal in a _UnitLogNormal(TransformedDistribution) subclass declaring support = dist.constraints.interval(0.0, 1.0), with a translated explanatory comment.
  • Bumps the jupytext_version in the notebook front matter from 1.16.4 to 1.17.2.
  • Updates the translation state file (source-sha, synced-at, mode, tool-version).
File Description
lectures/​bayes_nonconj.md Adds the _UnitLogNormal support declaration (verbatim from source) with an accurately translated comment, and updates the jupytext version.
.translate/​state/​bayes_nonconj.md.yml Updates translation sync metadata (source SHA, sync date, mode, tool version) to reflect this sync.

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

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

@mmcky
mmcky merged commit e1cf60f into main Oct 6, 2026
10 of 12 checks passed
@mmcky
mmcky deleted the translation-sync-2026-10-05T01-55-56-pr-1065 branch October 6, 2026 00:21

This branch was successfully deployed

1 active deployment
pull request — 6f627a5f Deployed Oct 5, 2026 by github-actions[bot]
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