Regression mathematics#
Trendline overview is the practical starting point. This page summarises the shared numerical methods behind the available models.
Least squares#
GraphX fits selected calibrated graph points by minimising residual error, where
Linear regression#
Linear regression fits by least squares. For Linear models, an optional fixed Y intercept constrains the fit to the supplied value rather than estimating . See Linear regression.
Polynomial regression#
Polynomial models use orders 2–6. Direct powers of a large or offset X value can be poorly conditioned, so GraphX centres and scales X with , then constructs a polynomial design matrix. It solves the least-squares problem with modified Gram–Schmidt QR decomposition:
A fixed intercept uses a constrained basis. GraphX evaluates the stable centred/scaled basis; when expanding it into original-X coefficients would lose meaningful precision, it displays the centred/scaled representation instead. See Polynomial regression.
Transformed models#
- Logarithmic regression uses and fits ; is required.
- Exponential regression fits by fitting ; is required.
- Power-law regression fits by fitting ; both and are required.
R²#
GraphX reports original-Y-space from
Exponential and power models additionally report transformed-space for their transformed least-squares calculation. The two answer different questions; see Understanding R². Fit and display domains remain separate as described in Fit and display ranges.

