Documentation

Polynomial regression#

Use Polynomial when the relationship is smooth and curved, but a single polynomial is a useful description over the chosen range. GraphX supports orders 2–6. For order nn, the familiar expanded form is

y=anxn+an−1xn−1+⋯+a1x+a0.y=a_nx^n+a_{n-1}x^{n-1}+\cdots+a_1x+a_0.

In the GraphX editor, the displayed coefficients are named in descending-power order as a, b, c, and so on. For example, an order-two equation is shown as y=ax2+bx+cy=ax^2+bx+c.

Choose an order carefully#

Higher orders can follow more curvature, but they also make a model more sensitive to measurement noise and can introduce oscillation between or beyond data points. There is no universally best order. Prefer the lowest order that adequately represents the relationship for the purpose of the analysis, and consider the intended display or prediction range.

An order-nn fit needs at least n+1n+1 selected data points. GraphX rejects an order outside 2–6, an under-specified fit, or a singular configuration instead of silently lowering the order.

How GraphX fits a polynomial#

GraphX does not form and invert naïve normal equations in raw X values. Before fitting, it centres and scales X:

t=x−cs,t=\frac{x-c}{s},

where cc is the mean of the selected X values and ss is their maximum distance from that centre. It then solves the least-squares problem in powers of tt using modified Gram–Schmidt QR factorisation.

This is the same polynomial model expressed in a numerically friendlier coordinate. It improves conditioning when X values are large, when the useful X span is small compared with their absolute magnitude, or when using a higher polynomial order. Those are situations where raw powers such as x6x^6 can make arithmetic unnecessarily fragile.

Expanded and centred/scaled equations#

GraphX normally converts the stable fit back to an expanded equation in xx, because that is the most familiar form. It checks whether that expansion still reproduces the stable fitted model across representative X values.

For some high-order or large-offset data, expanding the coefficients in original X can lose enough precision to misrepresent the curve. In that case, GraphX shows:

Centred/scaled form shown for numerical stability.

The general form then defines t=(x−x0)/st=(x-x_0)/s and presents the polynomial in tt. This does not mean a different curve was fitted. It is a more reliable representation of the same fitted model, chosen so the displayed and copied equation does not imply inaccurate original-X coefficients. The PDF report uses the same representation when needed.

Fix Y-intercept#

Fix Y-intercept is available for polynomial fits. If you set y0y_0, GraphX includes that constraint in the least-squares basis rather than fitting normally and replacing the constant afterwards. Its constrained stable form is equivalent to

y=y0+xsP(t),y=y_0+\frac{x}{s}P(t),

where P(t)P(t) is the fitted polynomial in centred/scaled X. Every fitted basis term is zero at x=0x=0, so the resulting model guarantees f(0)=y0f(0)=y_0.

This constraint can be useful where the intercept is independently known. It is not a general remedy for an uncertain or noisy fit: forcing the wrong intercept changes the entire polynomial.

R² and ranges#

R² is calculated from predictions in original Y-space. It measures agreement for the points selected by the fit range, not automatically for every point in the dataset. Use Fit and display ranges to control that selection and Understanding R² to interpret the statistic. Be especially cautious when extending a high-order polynomial beyond the fitted interval; its shape outside the supporting data can be unintuitive.