Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

User's Guide: Beta count-parameter prior does not match the cited BDA prior

Offen Anfängerfreundlich
#980 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
72/100
Issue-Typ
Dokumentation
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
markdown
Bereich
documentation

Rechercherichtung

Lies den Abschnitt „Beta and Dirichlet priors“ in src/stan-users-guide/reparameterization.qmd und vergleiche die dortige Aussage zum Prior und den Code mit dem zitierten Abschnitt 5.3 von BDA3. Entscheide, welche der beiden vorgeschlagenen Korrekturen den mathematischen Zusammenhang im Leitfaden wahrt, und aktualisiere bei Bedarf Text und Code. Fertig ist die Arbeit, wenn der Prior mit der Erklärung übereinstimmt und der BDA-Verweis korrekt ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

In src/stan-users-guide/reparameterization.qmd, section "Beta and Dirichlet priors", the text says: "Following @[GelmanEtAl:2013, Chapter 5] the mean gets a uniform prior and the count parameter a Pareto prior with $p(\lambda) \propto \lambda^{-2.5}$." The code has lambda ~ pareto(0.1, 1.5);, which gives this density for $\lambda > 0.1$.

This is not the BDA prior. BDA3 Section 5.3 uses $p(\alpha, \beta) \propto (\alpha + \beta)^{-5/2}$. This density is on $(\alpha, \beta)$, not on $\lambda$. BDA3 gets it from a uniform prior on $(\alpha / (\alpha + \beta), (\alpha + \beta)^{-1/2})$.

The Jacobian of $(\phi, \lambda) \mapsto (\alpha, \beta) = (\lambda \phi, \lambda (1 - \phi))$ is $\lambda$. Thus:

  • The BDA prior on $(\phi, \lambda)$ is $p(\phi, \lambda) \propto \lambda \cdot \lambda^{-5/2} = \lambda^{-3/2}$.
  • The User's Guide prior on $(\alpha, \beta)$ is $p(\alpha, \beta) \propto \lambda^{-5/2} / \lambda = (\alpha + \beta)^{-7/2}$.

The exponent $-5/2$ of the $(\alpha, \beta)$ density seems to have been used for $\lambda$ without the Jacobian.

The difference changes the behavior of the prior. Let $u = \lambda^{-1/2}$. For large $\lambda$, $u$ is approximately $\mathrm{sd}(\theta) / \sqrt{\phi (1 - \phi)}$, and $u = 0$ means no variation between groups. The BDA prior is uniform on $u$. The User's Guide prior has density $\propto u^2$ on $u$, which is zero at $u = 0$.

Suggested fix (one of):

  1. Change the code to lambda ~ pareto(0.1, 0.5); and the text to $p(\lambda) \propto \lambda^{-3/2}$. Also say that the lower bound 0.1 makes the improper BDA prior proper.
  2. Keep the code and remove the statement that the prior follows BDA.

A proper alternative with the same $\lambda^{-3/2}$ tail is an exponential prior with rate $r$ on $\lambda^{-1/2}$, that is lambda ~ frechet(0.5, square(r)). It approximates a penalized complexity prior with the base model $\lambda = \infty$. Context: https://discourse.mc-stan.org/t/how-to-choose-a-prior-for-the-count-parameter/41653

Vorherrschende Sprache
TeX
Sterne
43
Forks
132
Ø Merge
1 Std. 34 Min.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

  • Kein Dockerfile und keine Docker-Compose-Datei
  • Hat eine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus stan-dev/docs

Alle Issues in stan-dev/docs

Ähnliche Issues

Weitere Issues zu Documentation

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.