The discretized signal y (xn) = yn; (n = 0; N-1) are given by the values ​​in the table: x = 0; 0.2; 0.4; 0.6; 0.8; one; 1.2; 1.4; 1.6; 1.8; y = -0.8; -0.6; 0.2; 0.7; 0.9; 1.4; 0.8; 0.4; 0.1; -0.2;

It is necessary to smooth the data (approximation) using the polynomial Pi (x) = a0 + a1x;

Actually the problem is solved. But in the solution the logic of the solution is invisible ... enter image description here

There is a Minimize function (s, a0, a1), it needs to be replaced with the "open" full solution. With this and need your help.

ps in theory, there should be a system of equations and it needs to be solved.

  • You can’t write the least squares method yourself, or you just don’t understand how to get the system of equations? - Duck Learns to Take Cover
  • The logic from the matt point of view is quite simple. We took the expression by which we estimate the deviation, it is s (a0, a1). The minimize function simply looks for the lower extremum. To do without it, in our simple case it is enough for us to take the partial derivative s (a0, a1) first by a0 (the first parameter) and equate it to zero, then also by the second parameter. From here we get the system of equations and solve it. I am too lazy to implement this in the matkad, and in general I am not very sure that there is such a good soul, so the question is on the verge of a foul. - Duck Learns to Take Cover
  • The promise is to get into this: cleverstudents.ru/articles/mnk.html - Duck Learns to Take Cover
  • @ru_volt thanks. - Andrey

0