-
Notifications
You must be signed in to change notification settings - Fork 416
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
Proposal to remove "syntactic sugar" that overloads *
and /
for univariate distributions
#1438
Comments
This was added in #1217. Affine transformations were already defined for At first glance, these transformations seem completely fine to me: they return the distribution of the transformed random variable. I guess the main concern here is that the use of |
It might help to consider... When we write In MeasureTheory, we've had some discussion of changing to This is a little more awkward, but it has the advantage of not getting in the way of the current Distributions syntactic sugar. Our usual use for |
Addition is a little trickier, since |
No, it's not, it's much simpler. It is an affine transformation of a random variable X with distribution BTW convolutions can be computed with |
Yes, that's my only concern. I have no objections to the transformations that were added, just the usurping of +, * to represent them. |
Affine transformations are very useful and I think we should definitely support them, make them easy to use, and define more optimized versions whenever possible (e.g. as in #1407). They were added initially for I am not completely convinced yet that the current behaviour of
and (a bit similar to my comment) @simonbyrne said
even though it seems he was a bit reluctant initially:
|
Okay, I understood one thing wrong. + is only overloaded for distr + scalar and not distr + distr. Sorry, I should have checked that more carefully. So it only the scalar product scalar*distr and the distr/scalar cases that I am wondering about. After these further clarifications I better understand the arguments for the status quo in those cases. I guess this is tricky one. |
+
and *
for univariate distributions*
and /
for univariate distributions
I think it's not the same concern though: the comment only mentions a very specific expression. I see that one could expect a mixture distribution for an expression of this form but it requires
Therefore I'm not sure if the examples is actually an argument against the current use of |
@devmotion Thanks for taking my suggestion seriously and for the helpful explanations. I stand by my objection but can see that this boat has sailed. Even MeasureTheory.jl seems resigned to avoiding |
I propose that the "syntactic sugar" added here be removed in the next breaking release.
A probability distribution is just a special case of a measure. The transformations implied by the current implementations of$x$ with a measure $\mu$ we have $(x\mu)(A) = x \mu(A)$ . And these definitions are useful also within probability; for example:
*
,+
,-
and/
so forth do not generalise to arbitrary measures which, moreover, already have well-established meanings for these operations. Eg, for the product of a scalarWhen constructing a mixture of probability distributions, such as a finite average: The average is a prob measure even though the partial sums are just measures. That is, it's frequently convenient to leave the affine subspace of probability measures using the standard definitions of
+
and*
.When one wants to avoid normalising the measure representing a probability measure, because it is not needed (eg for generating samples)
My own use case is in ensemble models where I am averaging the probabilistic predictions of multiple classifiers. Computing averages naively is not working smoothly because the forementioned syntactic sugar conflicts with the "usual" ones, preventing me from just doing
mean(....)
.Thoughts anyone?
@cscherrer
The text was updated successfully, but these errors were encountered: