Open Datseris opened 3 years ago
Just want to emphasize there is no passmissing
solution for this since we call dot
recursively. So I think #40769 is the only way forward absent some sort of number-like iteration for missing
.
I think that's a bug in StatsBase, which should only use dot
for element types known to give the expected result. Actually we already have an almost finished PR to fix this: https://github.com/JuliaStats/StatsBase.jl/pull/658.
Does that also fix people's need for a missing
-norm
? I'm fine with closing my PRs.
I don't have a strong opinion about that.
Isn't the fact that this issue was inspired by StatsBase a bit irrelevant here? Shouldn't dot([1, 2, missing], [1, 2, 3])
return missing
? Not sure why we keep arguing about StatsBase
instead of addressing the main point. I've updated the original post to not use StatsBase
at all, as it is not necessary to reproduce the issue.
Sorry to bring this up again, but is there some way to come to a decision on this? Does it get added to triage?
https://github.com/JuliaLang/julia/pull/40769 is marked for linalg triage.
It would be nice to have this fixed. I am still pirating the dot definition to make it work in applications with missing values.
For some reason https://github.com/JuliaLang/julia/pull/40769 hasn't been discussed by linalg triage despite the label. I'm not even sure what "linalg triage" is. :-)
Below is the workaround (relies on piracy) we've been using since this issue was opened:
import LinearAlgebra: ⋅
⋅(::Missing, ::Missing) = missing
I am a card-carrying certified Missing Propagations Hater and I sincerely hope that method is never added to LinearAlgebra
MWE:
I would have assumed that the
dot
should yieldmissing
.For reference, I came across this using
StatsBase.mean(x, weights(w))
.