Skip to content

Commit

Permalink
Merge pull request #249 from CliMA/glw/normal-transformation
Browse files Browse the repository at this point in the history
Subtract variance when transforming Normally-distributed parameters
  • Loading branch information
glwagner committed Apr 24, 2022
2 parents eb40a71 + 5686a6f commit c48487c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ and the inverse trasnform is the natural logarithm ``f^{-1} ≡ \\log``,
\\log(Y) = X ∼ 𝒩(μ, σ).
```
"""
transform_to_unconstrained::Normal, Y) = Y / abs.μ)
transform_to_unconstrained::Normal, Y) = (Y - Π.σ) / abs.μ)
transform_to_unconstrained::LogNormal, Y) = log(Y^(1 / abs.μ))) # log(Y) / abs(Π.μ)

transform_to_unconstrained::ScaledLogitNormal, Y) =
Expand All @@ -226,7 +226,7 @@ Transform an "unconstrained", normally-distributed variate `X`
to "constrained" (physical) space via the map associated with
the distribution `Π` of `Y`.
"""
transform_to_constrained::Normal, X) = X * abs.μ)
transform_to_constrained::Normal, X) = (X * abs.μ)) + Π.σ
transform_to_constrained::LogNormal, X) = exp(X * abs.μ))

transform_to_constrained::ScaledLogitNormal, X) =
Expand Down

0 comments on commit c48487c

Please sign in to comment.