functionLeastSquares

Least squares problem

Information

Hypothesis and equations

Given a cloud of N points (xi, yi), the best degree polynomial q which minimizes .

Finding the polynomial P means finding the vector which minimizes the norm avec and y the vector {yi}i=1,N.

Bibliography

none

Instructions for use

Example with Excel : we seek a polynomial trend curve of degree 3 with the following cloud of points :

Known limits / Use precautions

none

Validations

Validated function - Hassan Bouia, Sila Filfli 02/2011

--------------------------------------------------------------
Licensed by EDF under a 3-clause BSD-license
Copyright © EDF 2009 - 2023
BuildSysPro version 3.6.0
Author : Hassan BOUIA, Sila FILFLI, EDF (2011)
--------------------------------------------------------------

Inputs

TypeNameDefaultDescription
IntegerN6Number of points
Integerq3Degree of the sought polynomial
Real[N]x{1., 2, 3, 4, 5, 7}X-axis
Real[N]y{1, 2, 3.2, 4, 4.5, 7.2}Y-axis

Outputs

TypeNameDefaultDescription
Real[q + 1]cCoefficients of the sought polynomial

Revisions

Benoît Charrier 01/2016 : Adaptation pour compatibilité avec OpenModelica