Clarify that sampling statements vs. target += may not always preserve sampling behavior
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- tex
調査の方向性
Stan リファレンスマニュアルの Section 7.4 から始め、issue で説明されている 2 つのコード例を比較してください。リンクされている Discourse の議論を読み、parameter-dependent conditionals に関する注意点を理解してください。サンプリング文と target の加算がサンプリングの挙動を維持しない場合をドキュメントが正確に説明できていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Section 7.4 of the Stan reference manual says that using the sampling statement y ~ normal(mu, sigma) and incrementing the target probability directly with target += normal_lpdf(y | mu,sigma) will “both lead to the same sampling behavior” but the sampling statement drops constant terms from the log probability function when adding to the target.
But I believe that it is not necessarily true that you get the same sampling behavior if the sampling statement's execution is conditional on parameter values. E.g. consider the snippet
if(b) {
y ~ normal(mu, sigma)
}
else {
target += normal_lpdf(y | mu,sigma)
}
if b depends upon parameter values, then this does not give the same sampling behavior as
target += normal_lpdf(y | mu,sigma)
because in the first snippet we drop the extra additive constant terms only on the subsets of parameter values which cause b to evaluate to true.
Of course, if b depends upon parameter values, there are likely other practical issues with inference for such a model. Nevertheless, it might be good to add a caveat or re-word this statement in the documentation.
(See also discussion here: https://discourse.mc-stan.org/t/target-vs-sampling-does-dropping-constants-preserve-sampling-behavior/29118/)
- 主要言語
- TeX
- スター
- 43
- フォーク
- 133
- 平均マージ
- 8時間 2分
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
stan-dev/docs のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
bug
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
似ている issue
-
skills.mdx: ReadResourceDirectoryRequest does not type-check against the 2026-07-28 base schemaオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
modelcontextprotocol/ext-skills#156 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
open-telemetry/opentelemetry-go-compile-instrumentation#1445 ·
メンテナーはふだん 2 日以内に返信
-
docs
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
CopilotKit/OpenDots#55 ·
メンテナーはふだん 1 日以内に返信