MeasureBase.jl
MeasureBase.jl copied to clipboard
This doesn't work: ```julia julia> using ChainRules, MeasureBase, InverseFunctions julia> f(x) = 3x + 1 f (generic function with 1 method) julia> finv(y) = (y - 1) / 3 finv...
In Julia 1.10 beta (at least) we get this warning a lot: ``` │ WARNING: Wrapping `Vararg` directly in UnionAll is deprecated (wrap the tuple instead). │ You may need...
This PR is collects changes and improvements that will become MeasureBase v0.15, hopfully early next week (there are some deadlines I need to meet). They go through individual PR's and...
In a recent Zulip discussion (https://julialang.zulipchat.com/#narrow/stream/137791-general/topic/Static.20code.20blocks/near/289768224), @Seelengrab reminded me of the `Random.Sampler` interface, with this example: ```julia struct BoundedFloat64 min::Float64 max::Float64 end Base.eltype(::Type{BoundedFloat64}) = Float64 Base.rand(_::AbstractRNG, b::Random.SamplerTrivial{BoundedFloat64}) = b[].min +...
It's currently awkward to define methods for `AbstractProductMeasure`s, because that abstract type doesn't know anything about the underlying structure. This PR explores one possibility for fixing that. The idea is...
MeasureTheory has these tests: ```julia @testset "Density measures and Radon-Nikodym" begin x = randn() let d = ∫(𝒹(Cauchy(), Normal()), Normal()) @test logdensity_rel(d, Cauchy(), x) ≈ 0 atol = 1e-12 end...
The "transport origin" of a `WeightedMeasure` needs to be weighted. I had thought this might be easy: ```julia transport_origin(ν::WeightedMeasure) = weightedmeasure(ν.logweight, transport_origin(ν.base)) to_origin(w::WeightedMeasure, y) = to_origin(w.base, y) from_origin(w::WeightedMeasure, x) =...
Say we have spaces $A$ and $B$, a function $f:A \to B$, and a measure $\mu \in \mathcal{M}(A)$. Choose a point $x ∈ A$, and $y = f(x) ∈ B$....
I've been exploring our pushforward basics in MeasureBase.jl... Say we have a uniform measure on $(-\pi/2, \pi/2)$ and want to push that through `asin`. So we do ```julia # We'll...
Currently we have ```julia transport_origin(ν::WeightedMeasure) = ν.base to_origin(::WeightedMeasure, y) = y from_origin(::WeightedMeasure, x) = x ``` Should this be ```julia transport_origin(ν::WeightedMeasure) = transport_origin(ν.base) to_origin(v::WeightedMeasure, y) = to_origin(v.base, y) from_origin(v::WeightedMeasure, x)...