Problem 45854. Least Absolute Deviations (L1-norm) line fit - degree n

This is a generalization of Problem 45851 for degree n
- - - -
You are given two vectors X and Y (coordinates of observations on a plane), and a degree d of the underlying model. Return a row vector P with the d+1 coefficients of the best-fit polynomial, in the L1-norm sense. I.e., find P of degree d that minimizes sum( abs( Y - polyval(P,X) ) ) .
(compare your results with polyfit on the test suite!)

Solution Stats

45.45% Correct | 54.55% Incorrect
Last Solution submitted on Apr 17, 2021

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers2

Suggested Problems

More from this Author10

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!