Skip to content

Pushforward problems #125

Open
Open
@cscherrer

Description

Say we have

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> @btime logdensityof($μ  ^ 100, $x)
  60.594 ns (0 allocations: 0 bytes)
-222.1504504107993

julia> @btime logdensityof($ν ^ 100, $x)
  12.734 μs (12 allocations: 192 bytes)
-222.15045041079918

I'm also confused by the basemeasure sequence here:

julia> basemeasure_sequence(ν) .|> println;
PushforwardMeasure(MulAdd{Float64, Float64}(2.0, 3.0), StdNormal())
PushforwardMeasure(MulAdd{Float64, Float64}(2.0, 3.0), 0.3989 * MeasureBase.LebesgueBase())
PushforwardMeasure(MulAdd{Float64, Float64}(2.0, 3.0), MeasureBase.LebesgueBase())

I'd think there are always a couple of laws in place around these things:

logdensity_def(μ, x) == logdensity_rel(μ, basemeasure(μ), x)

logdensity_rel(pushfwd(f, μ), pushfwd(f, ν), x) == logdensity_rel(μ, ν, inverse(f)(x))

But then we'd expect logdensityof(ν, x) == logdensityof(StdNormal(), x), which is not the case.

@oschulz any idea what's going on here?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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