Skip to content

[LogitNormal] Corrected the formula in the comments.#2076

Merged
andreasnoack merged 4 commits into
JuliaStats:masterfrom
yeruouo:master
Jun 30, 2026
Merged

[LogitNormal] Corrected the formula in the comments.#2076
andreasnoack merged 4 commits into
JuliaStats:masterfrom
yeruouo:master

Conversation

@yeruouo

@yeruouo yeruouo commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

#2075
Corrected the formula in the comments of LogitNormal:
before:

$$ f(x; \mu, \sigma) = \dfrac{1}{x\sqrt{2\pi\sigma^2}} \exp\left(-\dfrac{\left(\text{logit}(x) - \mu\right)^2}{2\sigma^2}\right) $$

after:

$$ f(x; \mu, \sigma) = \dfrac{1}{x(1-x)} \dfrac{1}{\sqrt{2\pi\sigma^2}} \exp\left(-\dfrac{\left(\text{logit}(x) - \mu\right)^2}{2\sigma^2}\right) $$

Some reference materials:

Logit-normal Log-normal
Normal variable $X \sim \mathcal{N}(\mu, \sigma^2)$ $X \sim \mathcal{N}(\mu, \sigma^2)$
Transformation $Y = \dfrac{1}{1+e^{-X}}$ $Y = e^X$
Inverse transformation $X = \ln\dfrac{Y}{1-Y}$ $X = \ln Y$
Support $(0, 1)$ $(0, +\infty)$
Jacobian $\dfrac{1}{y(1-y)}$ $\dfrac{1}{y}$
PDF $\dfrac{1}{y(1-y)} \cdot \dfrac{1}{\sqrt{2\pi\sigma^2}} \exp\left(-\dfrac{\left(\ln\frac{y}{1-y} - \mu\right)^2}{2\sigma^2}\right)$ $\dfrac{1}{y} \cdot \dfrac{1}{\sqrt{2\pi\sigma^2}} \exp\left(-\dfrac{(\ln y - \mu)^2}{2\sigma^2}\right)$

@devmotion

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.74%. Comparing base (87b0f88) to head (254aa81).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2076   +/-   ##
=======================================
  Coverage   86.74%   86.74%           
=======================================
  Files         149      149           
  Lines        8883     8883           
=======================================
  Hits         7706     7706           
  Misses       1177     1177           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/univariate/continuous/logitnormal.jl Outdated
Comment thread src/univariate/continuous/logitnormal.jl Outdated
Comment thread src/univariate/continuous/logitnormal.jl Outdated
Co-authored-by: Andreas Noack <andreas@noack.dk>
@andreasnoack andreasnoack enabled auto-merge (squash) June 30, 2026 08:27
@andreasnoack andreasnoack disabled auto-merge June 30, 2026 08:27
yeruouo

This comment was marked as outdated.

@yeruouo yeruouo requested a review from andreasnoack June 30, 2026 09:58
@andreasnoack andreasnoack merged commit 2697768 into JuliaStats:master Jun 30, 2026
13 checks passed
@andreasnoack

Copy link
Copy Markdown
Member

Thanks for fixing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants