Polynomial regression
Part of a series on |
Regression analysis |
---|
Models |
Estimation |
|
Background |
|
In
The explanatory (independent) variables resulting from the polynomial expansion of the "baseline" variables are known as higher-degree terms. Such variables are also used in classification settings.[1]
History
Polynomial regression models are usually fit using the method of
Definition and example
The goal of regression analysis is to model the expected value of a dependent variable y in terms of the value of an independent variable (or vector of independent variables) x. In simple linear regression, the model
is used, where ε is an unobserved random error with mean zero conditioned on a scalar variable x. In this model, for each unit increase in the value of x, the conditional expectation of y increases by β1 units.
In many settings, such a linear relationship may not hold. For example, if we are modeling the yield of a chemical synthesis in terms of the temperature at which the synthesis takes place, we may find that the yield improves by increasing amounts for each unit increase in temperature. In this case, we might propose a quadratic model of the form
In this model, when the temperature is increased from x to x + 1 units, the expected yield changes by (This can be seen by replacing x in this equation with x+1 and subtracting the equation in x from the equation in x+1.) For infinitesimal changes in x, the effect on y is given by the total derivative with respect to x: The fact that the change in yield depends on x is what makes the relationship between x and y nonlinear even though the model is linear in the parameters to be estimated.
In general, we can model the expected value of y as an nth degree polynomial, yielding the general polynomial regression model
Conveniently, these models are all linear from the point of view of estimation, since the regression function is linear in terms of the unknown parameters β0, β1, .... Therefore, for least squares analysis, the computational and inferential problems of polynomial regression can be completely addressed using the techniques of multiple regression. This is done by treating x, x2, ... as being distinct independent variables in a multiple regression model.
Matrix form and calculation of estimates
The polynomial regression model
can be expressed in matrix form in terms of a design matrix , a response vector , a parameter vector , and a vector of random errors. The i-th row of and will contain the x and y value for the i-th data sample. Then the model can be written as a system of linear equations:
which when using pure matrix notation is written as
The vector of estimated polynomial regression coefficients (using ordinary least squares estimation) is
assuming m < n which is required for the matrix to be invertible; then since is a Vandermonde matrix, the invertibility condition is guaranteed to hold if all the values are distinct. This is the unique least-squares solution.
Expanded formulas
The above matrix equations explain the behavior of polynomial regression well. However, to physically implement polynomial regression for a set of xy point pairs, more detail is useful. The below matrix equations for polynomial coefficients are expanded from regression theory without derivation and easily implemented.[5][6][7]
After solving the above system of linear equations for , the regression polynomial may be constructed as follows:
Interpretation
Although polynomial regression is technically a special case of multiple linear regression, the interpretation of a fitted polynomial regression model requires a somewhat different perspective. It is often difficult to interpret the individual coefficients in a polynomial regression fit, since the underlying monomials can be highly correlated. For example, x and x2 have correlation around 0.97 when x is
Alternative approaches
Polynomial regression is one example of regression analysis using
The goal of polynomial regression is to model a non-linear relationship between the independent and dependent variables (technically, between the independent variable and the conditional mean of the dependent variable). This is similar to the goal of nonparametric regression, which aims to capture non-linear regression relationships. Therefore, non-parametric regression approaches such as smoothing can be useful alternatives to polynomial regression. Some of these methods make use of a localized form of classical polynomial regression.[9] An advantage of traditional polynomial regression is that the inferential framework of multiple regression can be used (this also holds when using other families of basis functions such as splines).
A final alternative is to use
If
See also
- Curve fitting
- Line regression
- Local polynomial regression
- Polynomial and rational function modeling
- Polynomial interpolation
- Response surface methodology
- Smoothing spline
Notes
- Microsoft Excel makes use of polynomial regression when fitting a trendline to data points on an X Y scatter plot.[11]
References
- ^ Yin-Wen Chang; Cho-Jui Hsieh; Kai-Wei Chang; Michael Ringgaard; Chih-Jen Lin (2010). "Training and testing low-degree polynomial data mappings via linear SVM". Journal of Machine Learning Research. 11: 1471–1490.
- .
- .
- JSTOR 2331929.
- ^ Muthukrishnan, Gowri (17 Jun 2018). "Maths behind Polynomial regression, Muthukrishnan". Maths behind Polynomial regression. Retrieved 30 Jan 2024.
- ^ "Mathematics of Polynomial Regression". Polynomial Regression, A PHP regression class.
- ISBN 0-534-24264-2.
- ^
Such "non-local" behavior is a property of analytic functions that are not constant (everywhere). Such "non-local" behavior has been widely discussed in statistics:
- Magee, Lonnie (1998). "Nonlocal Behavior in Polynomial Regressions". The American Statistician. 52 (1): 20–22. JSTOR 2685560.
- Magee, Lonnie (1998). "Nonlocal Behavior in Polynomial Regressions". The American Statistician. 52 (1): 20–22.
- ISBN 978-0-412-98321-4.
- ISBN 978-1-61197-520-8. Retrieved 2020-08-28.
- ^ Stevenson, Christopher. "Tutorial: Polynomial Regression in Excel". facultystaff.richmond.edu. Retrieved 22 January 2017.
External links
- Curve Fitting, PhETInteractive simulations, University of Colorado at Boulder