Linear loss function for multi-member interpolation



  • How can a multimember of one variable at a given Python point using the loss function not as squares but simply distances from points to the polynomial(s)?



  • Interesting question. There are some ideas on this account, but first we'll see how the classic version of this task works - f(x) = a_0 + a_1 x + ... + a_n x^n the data represent a set of points - a pair of coordinates: (x_0, y_0), (x_1, y_1), ..., (x_k, y_k)

    Explanation of expression S - sum of squares of deviations (there will be modules, but later) of a set of points from a multi-member (dependent on the set of unknown coefficients) a_i later the values of the ratios at which the sum is minimal are calculated. This is achieved at a point where all private derivatives \partial S \over \partial a_i 0. So...

    S = \sum_{j=0}^{k} (f(x_j) - y_j)^2

    \frac{\partial S}{\partial a_i}=\frac{\partial S}{\partial f}\cdot\frac{\partial f}{\partial a_i} = \sum_{j=0}^{k}2\cdot(f(x_j) - y_j)\cdot x_j^i = 0

    These expressions form the system n linear equations relative to unknown coefficients a_i They're here, for example with help. numpy.linalg.solve

    In our case, S Instead of a square, the module is:

    S = \sum_{j=0}^{k} |f(x_j) - y_j|

    So,

    \frac{\partial S}{\partial a_i} = \sum_{j=0}^{k}sgn(f(x_j) - y_j)\cdot x_j^i = 0

    Where? sgn(x) Formal production module: -1 for x RE 0 and 1 at x grad 0. Now it's a system. n I don't understand any equations a_i ♪ I'm sure these coefficients can be found by some kind of iterative method, but I don't know how yet.

    I hope my remarks were useful. Can anyone else tell us how to proceed?


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2