Project the results of the linear regression to the end of the
regression range, so they're more directly comparable to results
going forward
*m_num = sxy;
*m_denom = sxx;
- *xbase = xmin;
- *b = (ybar + ymin) - gst_util_uint64_scale (xbar, *m_num, *m_denom);
+ *b = (ymin + ybar) - gst_util_uint64_scale (xbar, *m_num, *m_denom);
+ /* Report base starting from the most recent observation */
+ *xbase = xmax;
+ *b += gst_util_uint64_scale (xmax - xmin, *m_num, *m_denom);
+
*r_squared = ((double) sxy * (double) sxy) / ((double) sxx * (double) syy);
#ifdef DEBUGGING_ENABLED