-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use ⊙
instead of *
for creating weighted measures?
#170
Comments
I would say that an additional argument against using |
Yep, I agree. In general, I just want to be sure to think through the semantics and any potential implications. If we think of "lifting" the constants, we can treat them as constant (log-)likelihoods. So density(k ⊙ μ) = k * density(μ)
logdensity(k ⊙ μ) = log(k) + logdensity(μ) Then I think the natural next question is, what if Also, between two measures |
Yeah, other usages of Also I do not think there is a natural extension to arrays - array currently does not have measure theoretic semantics besides just being a possible support. |
I think we do not want to conflate |
I've considered this. I think product measure and superposition are the category-theoretic product and coproduct, in which case |
The use for the Kronecker seems unproblematic given that both uses can be thought of as instances of a tensor product. |
@mschauer what do you think of transitioning to use |
I'm not yet too familiar with this package but I feel that I agree Probably I misunderstand, but I would have thought the coproduct of two measure spaces is their disjoint union, which would make the coproduct of two measures different from their sum in the sense just mentioned. For the coproduct measure on a disjoint union, |
When I started this package, it was to address some aspects of the Distributions design that were making things difficult for my work in Soss. So certainly there's no inherent requirement to follow that design in any way. When Distributions uses a::Real + d::Distribution = (a + x for x in d) This kind of silent conversion is very non-Julian, but unfortunately I think that ship has sailed. I've suggested this should really be written as broadcasting, but there seem to be at least implicit assumptions that broadcasting is over a finite set of values. Anyway, I haven't had much luck influencing the design of Distributions, so I try not to spend much time on it. At the same time, we want people to use the package, and most new users will already be familiar with Distributions. And certainly any conflicts with Distributions should have good reasons behind them. It can be very difficult to strike the right balance. In some cases, a compromise can be in the best interest of the package and its future users. I think this has been the case for DensityInterface.jl. Here, the challenge has been to allow an in-road for users without measure-theoretic experience who use "density" in a much looser sense. This leads to some complications in our design that aren't really ideal, but are almost certainly better than "going it alone". As a result of this, there's some potential for MeasureBase to become a dependency for Distributions. That's very much a WIP, but it seems it could help with tying the ecosystem together more cleanly. Ok I'm rambling now. Sorry, I'll get back to the points you made.
Yes, that's right.
Great point. I agree it would make sense for |
Thanks for the response, @cscherrer. Yes, striking this balance is difficult. I would say you are in a much better position than I to do this. I just wanted to give you another point on the graph. |
@keorn pointed out that in Distributions,
*
and+
behave like this:This is very different from MeasureTheory, where
This issue is to consider making some changes to this, to minimize confusion for those coming from Distributions.
We currently allow
⊙
for a "likelihood operating on a measure". We could potentially consider a scalar to work in a similar way, almost like a likelihood that always returns the given value.Notes / Concerns
Currently for any constant
k
and measureμ
we haveUnder this change, this would become
Despite its common use in Distributions, it's a little strange from a type perspective to expect this to work. It feels a little like having a function
f
and wantingk * f
to return a new functionx -> k * f(x)
.The text was updated successfully, but these errors were encountered: