MeasureTheory.jl icon indicating copy to clipboard operation
MeasureTheory.jl copied to clipboard

Change `bind` to `compound`?

Open cscherrer opened this issue 2 years ago • 2 comments

For push-forwards, we have

pushfwd(f, m)

If the f of a pushforward is noisy, it becomes a kernel, and the pushforward becomes a compound measure: https://en.wikipedia.org/wiki/Compound_probability_distribution

This is currently called bind, because it matches the monadic bind operation from functional programming. But bind is unfamiliar to most users.

Maybe this should instead be

compound(k, m)

where k is a kernel. For functions, we'd have

compound(f::Function, m::AbstractMeasure) = compound(kernel(f), m)

For more discussion, see https://github.com/cscherrer/MeasureTheory.jl/pull/226

cscherrer avatar Aug 22 '22 00:08 cscherrer

I am torn, compound is more familiar to people, but somehow it obscures the compositional nature even more and I wouldn't know how to name the other compositions which are (kf)(x) = ∫ f(y) k(x, dy) and (k₁k₂)(x) = ∫∫ k₁(x,dy) k₂(y, dz)

mschauer avatar Aug 22 '22 12:08 mschauer

Based on the Twitter discussion here we could also consider making kernels callable not just on values, but also on measures. Then composition of kernels would just be $\circ$, as usual.

cscherrer avatar Aug 22 '22 22:08 cscherrer