Epanechnikov
public cpp v1 · immutable// calculates linear correlation (similar to r^2 but concerning degree of absolute error rather than squared error)template<class T>T absolute_linear_correlation(const vector<T> &y, const vector<T> &yhat){ T ybar = sum(y) / y.size(); T ts = sum(abs(y - ybar)); T rs = sum(abs(y - yhat)); T rv = ts ? (ts - rs) / ts : (rs ? 1 : 0); return rv;}