Skip to content

Inconsistency in product_distribution argument #1706

@dmetivie

Description

@dmetivie

Following the discussion on discourse, it seems that the product_distribution does different things based on the argument being a vector or not. Does it call the old Product interface.

Which of the following is the correct way to define a product? The first option returns the most satisfying and detailed type.

# v0.25.65 and above
julia> typeof(product_distribution([Gamma(),Normal()]...))
Distributions.ProductDistribution{1, 0, Tuple{Gamma{Float64}, Normal{Float64}}, Continuous, Float64}

julia> typeof(product_distribution([Gamma(),Normal()]))
Product{Continuous, Distribution{Univariate, Continuous}, Vector{Distribution{Univariate, Continuous}}}
# -> use the old (depreacated) Product interface?

The doc suggests an array should be used (hence the second option, where type is not fully returned).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions