Open oxinabox opened 8 years ago
So I am debugging some mean code that seems to be sending values right to the exteme ends of the Float32 range.
I kept getting ArgumentError: principal variance cannot exceed total variance on this line
ArgumentError: principal variance cannot exceed total variance
So I enhanced it to be more informative on my local copy:
tpvar <= tvar || isapprox(tpvar,tvar) || throw(ArgumentError("principal variance cannot exceed total variance. $tpvar > $tvar"))
And I found out that both tpvar and tvar ended up at NaN. Now how this happens is unknown to me (right now, but soon I will know, I hope).
tpvar
tvar
But my point here is that this is the wrong error message. I suggest a NaN check should be added.
Showing the values would be helpful. It would great if you could open a PR with your change.
So I am debugging some mean code that seems to be sending values right to the exteme ends of the Float32 range.
I kept getting
ArgumentError: principal variance cannot exceed total variance
on this lineSo I enhanced it to be more informative on my local copy:
And I found out that both
tpvar
andtvar
ended up at NaN. Now how this happens is unknown to me (right now, but soon I will know, I hope).But my point here is that this is the wrong error message. I suggest a NaN check should be added.