Skip to content

Types for constant support values #1998

Description

@cgarling

For distributions with support that contains a constant value (like Pareto), the constant values do not match the partype of the underlying distribution instance. This makes working with types like Pareto{Float32} trickly because maximum(::Pareto{Float32}) returns Inf in Float64.

julia> maximum(Pareto(1.4f0, 0.1f0)) === Inf
true

The context I encountered this was using a truncated Pareto distribution, where the maximum is not Inf --

julia> d = truncated(Pareto(1.4f0, 0.1f0); upper=100.0f0)
julia> minimum(d) isa Float32
true
julia> maximum(d) isa Float64
true

I think it would be convenient if both maximum and minimum returned the same type T for Pareto{T}.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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