-
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
Overload LinearAlgebra.cross for ProductMeasure #15
Comments
Could we use the classical |
We should probably use whatever the standard notation is for product measures (I don't know what that is). I also feel strongly that unicode symbols as operators should only be convenient aliases of functions with descriptive names (among other things, having non-unicode function names makes it easier for other languages with less unicode support to interop with the package). |
Thanks for catching this, @sethaxen .
This is |
I am against using As for the notation, I prefer |
× and * can easily be confused with products of random variables, that is one reason |
@phipsgabler As I understand, the only reason @sethaxen metioned overloading I've also been using |
Hmm... I may have jumped the gun on this - I'm seeing a fair number of texts using \times, for example @mschauer do you see a particular context where \otimes is more common? There's no rush on this, but we'll need to nail down the notation at some point. |
I think majority of the literature uses ⊗ but × is of course also reasonable. The reason for ⊗ is that the cartesian product of sigma fields 𝔉 × 𝔅 is not a sigma field yes and one defines 𝔉 ⊗ 𝔅 = σ(𝔉 × 𝔅) as the completion. And then it is very natural to also call the product measure by ⊗, because it also doesn't only measure the elements of 𝔉 × 𝔅 but all of 𝔉 ⊗ 𝔅. |
I would suggest implementing |
Thanks @devmotion . Between × and ⊗, I think issues are ×The semantics here are fundamentally different than ⊗This seems pretty good, and I mostly like the idea of extending a lightweight package. In addition to pairs, we'll often store the data for a ⊗(μ::ProductMeasure, ν::ProductMeasure) = ProductMeasure(μ.data ⊗ ν.data) But this makes me think we could benefit from a more efficient implementation, for example |
OTOH this is wrong; the notation here gets very tricky The product of two univariate measure is bivariate, so the dimensions add. So the operation on the support is a (standard) product, not a Kronecker product. But it is bilinear, if we consider weighted measure as scalar multiplication and superposition as addition. |
I am more used to the notation ⊗ than × and agree with the explanation given by @mschauer above, therefore personally I would rather implement Apart from that, I don't understand why the implementation should be problematic in any of these cases. There is nothing wrong with LinearAlgebra defining |
There is something like "name piracy". If |
This package defines
×(μ::AbstractMeasure{X}, ν::AbstractMeasure{Y})
. This will collide withLinearAlgebra.cross
, which is aliased to×
, which is exported. The solution we used in Manifolds.jl was to overloadLinearAlgebra.cross
and then re-export×
.The text was updated successfully, but these errors were encountered: