Chad Scherrer

Results 185 issues of Chad Scherrer

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...

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...

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 +...