ALGORITHM FOR THE GENERATION OF THE SYSTEM OF EQUATIONS USED IN THE LEAST SQUARES METHOD FOR POLYNOMIALS OF DEGREE 2 AND 4
When fitting functions to a set of experimental data the least squares method (LSM) is used, considering that it will have the minimum error. This method is used to fit the function to a linear or not necessarily linear curve. This curve is associated with a polynomial of degree 𝑛, where the objective is to find each of the coefficients of the polynomial. The application of the CMM leads to a system of linear equations of the form Aβ = b, where finding the values of the column vector β = A-1 b is the specific objective of the problem. The laboriousness of this problem does not lie in solving the system of linear equations but in generating it.
In this work an algorithm is proposed which generates the equations that integrate the system of linear equations to obtain the coefficients of a polynomial of degree 𝑛, without using the formal method. To illustrate the use of this algorithm two examples are presented, the free fall of an object and the solar irradiance. The CMM for the generation of the equations that form the system of linear equations for obtaining the coefficients of the proposed polynomials is presented in detail. Then the proposed algorithm is presented. After that, the proposed algorithm is used to generate the equations of the system of linear equations. Finally, the systems of linear equations obtained by using the formal method and the proposed algorithm are compared. The results show the ease with which the system of linear equations is generated by using the proposed algorithm compared to the formal CMM.
ALGORITHM FOR THE GENERATION OF THE SYSTEM OF EQUATIONS USED IN THE LEAST SQUARES METHOD FOR POLYNOMIALS OF DEGREE 2 AND 4
-
DOI: https://doi.org/10.22533/at.ed.3174292419122
-
Palavras-chave: algorithm, coefficients of a polynomial, least squares method, linear regression, system of linear equations.
-
Keywords: algorithm, coefficients of a polynomial, least squares method, linear regression, system of linear equations.
-
Abstract:
When fitting functions to a set of experimental data the least squares method (LSM) is used, considering that it will have the minimum error. This method is used to fit the function to a linear or not necessarily linear curve. This curve is associated with a polynomial of degree 𝑛, where the objective is to find each of the coefficients of the polynomial. The application of the CMM leads to a system of linear equations of the form Aβ = b, where finding the values of the column vector β = A-1 b is the specific objective of the problem. The laboriousness of this problem does not lie in solving the system of linear equations but in generating it.
In this work an algorithm is proposed which generates the equations that integrate the system of linear equations to obtain the coefficients of a polynomial of degree 𝑛, without using the formal method. To illustrate the use of this algorithm two examples are presented, the free fall of an object and the solar irradiance. The CMM for the generation of the equations that form the system of linear equations for obtaining the coefficients of the proposed polynomials is presented in detail. Then the proposed algorithm is presented. After that, the proposed algorithm is used to generate the equations of the system of linear equations. Finally, the systems of linear equations obtained by using the formal method and the proposed algorithm are compared. The results show the ease with which the system of linear equations is generated by using the proposed algorithm compared to the formal CMM.
- Oscar Leopoldo Pérez Castañeda
- Jesús Daniel Pérez Castañeda
- José Enrique Salinas Carrillo
- Javier Trucíos Alonso
- María Fernanda Tovany Salvador