Originally posted by LucasLondon
the only thing that comes to my mid is that you have really huge matrices, so a1 and a2 are huge huge ranges, and then i takes the value of zero... so:
Correlation = ((i * Sxy) - (Sx * Sy)) / (((i * Sx2 - Sx ^ 2) ^ 0.5) * ((i * Sy2 - Sy ^ 2) ^ 0.5))
when i = 0 then
Correlation =
-Sx*Sy / (Sx2 * Sy2)
and if you say that Sx2 is not zero and Sy2 is not zero, then i just cant imagine how the division is by zero... only if Sx2 and Sy2 are too small, that their product is smaller than 1x10^-390 (then the number is so small that it'll be taken as a zero)
but... are they that small?, is like the joke (a really bad joke) :
2 + 2 = 5, for very big values of 2.
But it can also be that i takes a huge huge value... then, i dont know what to do
perhaps we need an arbitrary precision algorithm
Anyway, why dont you post the Sx, Sy, Sx1, Sx2 and i values when the error ocurs? so we can find out where the problem is.
Comment