mean(xy) - mean(x) mean(y), cross-checked against the deviation form.
Arguments
- x, y
equal-length data vectors, n >= 2.
References
Morin, D. J. (2016). Probability: For the Enthusiastic
Beginner. Createspace. Eq (6.14).
Examples
CovShort(c(2, 3, 3, 5, 7), c(1, 1, 3, 4, 6))$cov
#> [1] 3.2