Skip to content

LogitNormal does not support zero variance #2001

@devmotion

Description

@devmotion

Currently, LogitNormal does not allow for zero variance:

julia> LogitNormal(1.0, 0.0)
ERROR: DomainError with 0.0:
LogitNormal: the condition σ > zero(σ) is not satisfied.
Stacktrace:
 [1] #390
   @ ~/.julia/packages/Distributions/YQSrn/src/univariate/continuous/logitnormal.jl:62 [inlined]
 [2] check_args
   @ ~/.julia/packages/Distributions/YQSrn/src/utils.jl:89 [inlined]
 [3] #LogitNormal#389
   @ ~/.julia/packages/Distributions/YQSrn/src/univariate/continuous/logitnormal.jl:62 [inlined]
 [4] LogitNormal::Float64, σ::Float64)
   @ Distributions ~/.julia/packages/Distributions/YQSrn/src/univariate/continuous/logitnormal.jl:61
 [5] top-level scope
   @ REPL[17]:1

whereas Normal and LogNormal do:

julia> Normal(1.0, 0.0)
Normal{Float64}=1.0, σ=0.0)

julia> LogNormal(1.0, 0.0)
LogNormal{Float64}=1.0, σ=0.0)

For transformed Gaussians, it should be easy to avoid issues such as #1880 since Normal already officially supports the zero variance case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions