MeasureBase.jl
MeasureBase.jl copied to clipboard
In `product_transport.jl`, I see a lot of methods with arguments like ```julia μ::StdPowerMeasure{MU,1} ``` This complicates dispatch, and I don't see why it's necessary. @oschulz Why do we need to...
In this measure ```julia julia> d = productmeasure(fill(Lebesgue(), 5)) ProductMeasure([Lebesgue(ℝ), Lebesgue(ℝ), Lebesgue(ℝ), Lebesgue(ℝ), Lebesgue(ℝ)]) ``` we have ```julia julia> Base.issingletontype(eltype(marginals(d))) true ``` But this guarantees we could instead have written...
In #120, there's currently a lot of cases where some `foo` function dispatches to `_generic_foo_impl`. This seems very wordy, which IMO makes the code a little cluttery and hard to...
Say we have ```julia using MeasureTheory, MeasureBase, BenchmarkTools, AffineMaps μ = Normal(3.0, 2.0) ν = pushfwd(MulAdd(2.0, 3.0), StdNormal()) x = rand(Normal(3.0, 2.0) ^ 100); ``` Then benchmarking gives ```julia julia>...
Currently (v0.14.7) we have ```julia massof(m::AbstractMeasure) = UnknownMass(m) ``` But there's no such method: ```julia julia> methods(MeasureBase.UnknownMass) # 4 methods for type constructor: [1] MeasureBase.UnknownMass() @ ~/git/MeasureBase.jl/src/mass-interface.jl:19 [2] (::Type{T})(x::AbstractChar) where...
We've factored out the internal `FixedRNG` into a registered package [ConstantRNGs.jl](https://github.com/cscherrer/ConstantRNGs.jl_). Let's drop the FixedRNG code in favor of a ConstantRNGs dependency.
These tests from MeasureTheory.jl are currently failing: ```julia @testset "Density measures and Radon-Nikodym" begin x = randn() let d = ∫(𝒹(Cauchy(), Normal()), Normal()) @test logdensityof(𝒹(d, Cauchy()), x) ≈ 0 atol...
As of v0.14.7, we have ```julia testvalue(::Type{T}, d::Counting) where {T} = testvalue(T, d.support) ``` But then we get ```julia julia> testvalue(Counting(Float64)) ERROR: MethodError: no method matching rand(::FixedRNG, ::Type{Float64}, ::Counting{Type{Float64}}) Closest...
This PR adds two invariants: - `logdensity_def(μ, x) ≈ logdensity_rel(μ, β, x)` (in `test_interface`) - `logdensity_rel(pushfwd(f, μ), pushfwd(f, ν), x) == logdensity_rel(μ, ν, inverse(f)(x))` (in `test_pushfwd`) Currently some tests are...