calculates polynomial regression function
input: x [m x 1 double]: x-values of input data
y [m x 1 double]: y-values of input data
n [1 x 1 double]: order of polynomial regression line
default is set to 1
output: Y [1 x 1 symfun]: regression line as matlab function
R [1 x 1 double]: squared mean mistake
written by Marko Hecht, Karlsruher Institute of Technology, November 2019
I basically only implemented the content of explanation given on this webpage:
http://polynomialregression.drque.net/math.html
The function is not perfect though because I solve the least squares problem by inverting the weighted parameter matrix to multiply it with the y-values to receive the solution. As some parameters may be close to zero, Matlab issues a warning in the command window. Any suggestions as to how to solve this more elegantly are very welcome.
Important: this function is not meant to extrapolate!
Zitieren als
Marko Hecht (2026). regressionp (https://de.mathworks.com/matlabcentral/fileexchange/73531-regressionp), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Plattform-Kompatibilität
Windows macOS LinuxKategorien
- MATLAB > Mathematics > Elementary Math > Polynomials >
Tags
Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
| Version | Veröffentlicht | Versionshinweise | |
|---|---|---|---|
| 1.0.0 |
