jOOQ / jOOL

jOOλ - The Missing Parts in Java 8 jOOλ improves the JDK libraries in areas where the Expert Group's focus was elsewhere. It adds tuple support, function support, and a lot of additional functionality around sequential Streams. The JDK 8's main efforts (default methods, lambdas, and the Stream API) were focused around maintaining backwards compatibility and implementing a functional API for parallelism.
http://www.jooq.org/products
Apache License 2.0
2.08k stars 167 forks source link

Add Agg.covarianceDouble #389

Closed lukaseder closed 3 years ago

lukaseder commented 3 years ago

A useful SQL statistical function is COVAR_POP(x, y) which is E[(x - E(x)) * (y - E(y))]. It can also be simplified to E[xy] - E[x]E[y] but that simplification is susceptible to catastrophic cancellation, so let's stick with the original formula.


See also: https://github.com/jOOQ/jOOQ/issues/11547

lukaseder commented 3 years ago

Done. This will be useful for some linear regression functions: https://github.com/jOOQ/jOOL/issues/151