What is the best algorithm for computing covariance that would be accurate for a large number of values like 100,000 or more?
Remember to vote up questions/answers you find interesting or helpful (requires 15 reputation points)
|
3
|
||||
|
|
3
|
Check out How to calculate correlation accurately. There are two common formulas that are algebraically equivalent but one has much better numerical properties than the other. |
||||||||||
|
You can accept an answer to one of your own questions by clicking the check mark next to it. This awards 15 reputation points to the person who answered and 2 reputation points to you.
|
3
|
The single-pass and parallel versions at Wikipedia may be what you're looking for. The single pass version is more numerically stable, but moves a division into the inner loop, which may hurt performance. |
||
|
|

