-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
@keorn pointed out that in Distributions, * and + behave like this:
julia> 3 * Dists.Normal()
Distributions.LocationScale{Float64, Distributions.Continuous, Distributions.Normal{Float64}}(
μ: 0.0
σ: 3.0
ρ: Distributions.Normal{Float64}(μ=0.0, σ=1.0)
)
julia> 3 + Dists.Normal()
Distributions.LocationScale{Float64, Distributions.Continuous, Distributions.Normal{Float64}}(
μ: 3.0
σ: 1.0
ρ: Distributions.Normal{Float64}(μ=0.0, σ=1.0)
)This is very different from MeasureTheory, where
julia> density(3 * Normal(), 2.4) / density(Normal(), 2.4)
3.0This issue is to consider making some changes to this, to minimize confusion for those coming from Distributions.
We currently allow ⊙ for a "likelihood operating on a measure". We could potentially consider a scalar to work in a similar way, almost like a likelihood that always returns the given value.
Notes / Concerns
Currently for any constant k and measure μ we have
density(k * μ) = k * density(μ)Under this change, this would become
density(k ⊙ μ) = k * density(μ)Despite its common use in Distributions, it's a little strange from a type perspective to expect this to work. It feels a little like having a function f and wanting k * f to return a new function x -> k * f(x).
Metadata
Metadata
Assignees
Labels
No labels