Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit!...

32
Least Squares and Data Fitting

Transcript of Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit!...

Page 1: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Least Squares and Data Fitting

Page 2: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

How do we best fit a set of data points?

Data fitting

Page 3: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Given๐‘š data points { ๐‘ก!, ๐‘ฆ! , โ€ฆ , ๐‘ก", ๐‘ฆ" }, we want to find the function ๐‘ฆ = ๐‘ฅ! + ๐‘ฅ" ๐‘ก

that best fit the data (or better, we want to find the coefficients ๐‘ฅ#, ๐‘ฅ!).

Thinking geometrically, we can think โ€œwhat is the line that most nearly passes through all the points?โ€

Linear Least Squares 1) Fitting with a line

Page 4: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Given๐‘š data points { ๐‘ก!, ๐‘ฆ! , โ€ฆ , ๐‘ก", ๐‘ฆ" }, we want to find ๐‘ฅ# and ๐‘ฅ!such that

๐‘ฆ$ = ๐‘ฅ# + ๐‘ฅ! ๐‘ก$ โˆ€๐‘– โˆˆ 1,๐‘š

or in matrix form: Note that this system of linear equations has more equations than unknowns โ€“OVERDETERMINED SYSTEMS๐’Žร—๐’ ๐’ร—๐Ÿ ๐’Žร—๐Ÿ

1 ๐‘ก!โ‹ฎ โ‹ฎ1 ๐‘ก"

๐‘ฅ#๐‘ฅ! =

๐‘ฆ!โ‹ฎ๐‘ฆ"

๐‘จ ๐’™ = ๐’ƒ

We want to find the appropriate linear combination of the columns of ๐‘จthat makes up the vector ๐’ƒ.

If a solution exists that satisfies ๐‘จ ๐’™ = ๐’ƒ then ๐’ƒ โˆˆ ๐‘Ÿ๐‘Ž๐‘›๐‘”๐‘’(๐‘จ)

Page 5: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Linear Least Squaresโ€ข In most cases, ๐’ƒ โˆ‰ ๐‘Ÿ๐‘Ž๐‘›๐‘”๐‘’(๐‘จ) and ๐‘จ ๐’™ = ๐’ƒ does not have an

exact solution!

โ€ข Therefore, an overdetermined system is better expressed as

๐‘จ ๐’™ โ‰… ๐’ƒ

Page 6: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Linear Least Squaresโ€ข Least Squares: find the solution ๐’™ that minimizes the residual

๐’“ = ๐’ƒ โˆ’ ๐‘จ ๐’™

โ€ข Letโ€™s define the function ๐œ™ as the square of the 2-norm of the residual

๐œ™ ๐’™ = ๐’ƒ โˆ’ ๐‘จ ๐’™ %%

Page 7: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Linear Least Squaresโ€ข Least Squares: find the solution ๐’™ that minimizes the residual

๐’“ = ๐’ƒ โˆ’ ๐‘จ ๐’™

โ€ข Letโ€™s define the function ๐œ™ as the square of the 2-norm of the residual

๐œ™ ๐’™ = ๐’ƒ โˆ’ ๐‘จ ๐’™ %%

โ€ข Then the least squares problem becomesmin๐’™๐œ™ (๐’™)

โ€ข Suppose ๐œ™:โ„›" โ†’ โ„› is a smooth function, then ๐œ™ ๐’™ reaches a (local) maximum or minimum at a point ๐’™โˆ— โˆˆ โ„›" only if

โˆ‡๐œ™ ๐’™โˆ— = 0

Page 8: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

How to find the minimizer?โ€ข To minimize the 2-norm of the residual vector

min๐’™๐œ™ ๐’™ = ๐’ƒ โˆ’ ๐‘จ ๐’™ %

%

๐œ™ ๐’™ = (๐’ƒ โˆ’ ๐‘จ ๐’™)((๐’ƒ โˆ’ ๐‘จ ๐’™)

โˆ‡๐œ™ ๐’™ = 2(๐‘จ( ๐’ƒ โˆ’ ๐‘จ(๐‘จ ๐’™)

First order necessary condition:โˆ‡๐œ™ ๐’™ = 0 โ†’ ๐‘จ( ๐’ƒ โˆ’ ๐‘จ(๐‘จ ๐’™ = ๐ŸŽ โ†’ ๐‘จ(๐‘จ ๐’™ = ๐‘จ( ๐’ƒ

Second order sufficient condition:๐ท%๐œ™ ๐’™ = 2๐‘จ(๐‘จ2๐‘จ(๐‘จ is a positive semi-definite matrix โ†’ the solution is a minimum

Normal Equations โ€“ solve a linear system of equations

Page 9: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Linear Least Squares (another approach)โ€ข Find ๐’š = ๐‘จ ๐’™ which is closest to the vector ๐’ƒโ€ข What is the vector ๐’š = ๐‘จ ๐’™ โˆˆ ๐‘Ÿ๐‘Ž๐‘›๐‘”๐‘’(๐‘จ) that is closest to vector ๐’š in

the Euclidean norm?

When ๐’“ = ๐’ƒ โˆ’ ๐’š = ๐’ƒ โˆ’ ๐‘จ ๐’™ is orthogonal to all columns of ๐‘จ, then ๐’š is closest to ๐’ƒ

๐‘จ๐‘ป๐’“ = ๐‘จ๐‘ป(๐’ƒ โˆ’ ๐‘จ ๐’™)=0 ๐‘จ"๐‘จ ๐’™ = ๐‘จ" ๐’ƒ

Page 10: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Summary:โ€ข ๐‘จ is a ๐‘šร—๐‘› matrix, where ๐‘š > ๐‘›. โ€ข ๐‘š is the number of data pair points. ๐‘› is the number of parameters of the

โ€œbest fitโ€ function.

โ€ข Linear Least Squares problem ๐‘จ ๐’™ โ‰… ๐’ƒ always has solution.

โ€ข The Linear Least Squares solution ๐’™ minimizes the square of the 2-norm of the residual:

min๐’™

๐’ƒ โˆ’ ๐‘จ ๐’™ %%

โ€ข One method to solve the minimization problem is to solve the system of Normal Equations

๐‘จ(๐‘จ ๐’™ = ๐‘จ( ๐’ƒ

โ€ข Letโ€™s see some examples and discuss the limitations of this method.

Page 11: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Example:

Solve: ๐‘จ#๐‘จ ๐’™ = ๐‘จ# ๐’ƒ

Page 12: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

โ€ข Does not need to be a line! For example, here we are fitting the data using a quadratic curve.

Data fitting - not always a line fit!

Linear Least Squares: The problem is linear in its coefficients!

Page 13: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Another examplesWe want to find the coefficients of the quadratic function that best fits the data points:

We would not want our โ€œfitโ€ curve to pass through the data points exactly as we are looking to model the general trend and not capture the noise.

๐‘ฆ = ๐‘ฅ! + ๐‘ฅ" ๐‘ก + ๐‘ฅ# ๐‘ก#

Page 14: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Data fitting

1 ๐‘ก! ๐‘ก!"โ‹ฎ โ‹ฎ โ‹ฎ1 ๐‘ก# ๐‘ก#"

๐‘ฅ$๐‘ฅ!๐‘ฅ"

=๐‘ฆ!โ‹ฎ๐‘ฆ#

(๐‘ก$,๐‘ฆ$)

Solve: ๐‘จ#๐‘จ ๐’™ = ๐‘จ# ๐’ƒ

Page 15: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Which function is not suitable for linear least squares?

A) ๐‘ฆ = ๐‘Ž + ๐‘ ๐‘ฅ + ๐‘ ๐‘ฅ# + ๐‘‘ ๐‘ฅ%B) ๐‘ฆ = ๐‘ฅ ๐‘Ž + ๐‘ ๐‘ฅ + ๐‘ ๐‘ฅ# + ๐‘‘ ๐‘ฅ%C) ๐‘ฆ = ๐‘Ž sin ๐‘ฅ + ๐‘/ cos ๐‘ฅD) ๐‘ฆ = ๐‘Ž sin ๐‘ฅ + ๐‘ฅ/ cos ๐‘๐‘ฅE) ๐‘ฆ = ๐‘Ž ๐‘’&#' + ๐‘ ๐‘’#'

Page 16: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Computational Cost๐‘จ#๐‘จ ๐’™ = ๐‘จ# ๐’ƒ

โ€ข Compute ๐‘จ(๐‘จ: ๐‘‚ ๐‘š๐‘›%

โ€ข Factorize ๐‘จ(๐‘จ: LU โ†’ ๐‘‚ %2๐‘›

2 , Cholesky โ†’๐‘‚ !2๐‘›

2

โ€ข Solve ๐‘‚ ๐‘›%โ€ข Since ๐‘š > ๐‘› the overall cost is ๐‘‚ ๐‘š๐‘›%

Page 17: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Short questionsGiven the data in the table below, which of the plots shows the line of best fit in terms of least squares?

A) B)

C) D)

Page 18: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Short questionsGiven the data in the table below, and the least squares model

๐‘ฆ = ๐‘! + ๐‘% sin ๐‘ก๐œ‹ + ๐‘2 sin ๐‘ก๐œ‹/2 + ๐‘3 sin ๐‘ก๐œ‹/4

written in matrix form as

determine the entry ๐ด%2 of the matrix ๐‘จ. Note that indices start with 1.

A) โˆ’1.0B) 1.0C) โˆ’ 0.7D) 0.7E) 0.0

Page 19: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Solving Linear Least Squares with SVD

Page 20: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

๐‘จ is a ๐‘šร—๐‘› matrix where ๐‘š > ๐‘›(more points to fit than coefficient to be determined)

Normal Equations: ๐‘จ!๐‘จ ๐’™ = ๐‘จ! ๐’ƒ

โ€ข The solution ๐‘จ ๐’™ โ‰… ๐’ƒ is unique if and only if ๐‘Ÿ๐‘Ž๐‘›๐‘˜ ๐€ = ๐‘›(๐‘จ is full column rank)

โ€ข ๐‘Ÿ๐‘Ž๐‘›๐‘˜ ๐€ = ๐‘› โ†’ columns of ๐‘จ are linearly independent โ†’ ๐‘› non-zero singular values โ†’ ๐‘จ! ๐‘จ has only positive eigenvalues โ†’ ๐‘จ!๐‘จ is a symmetricand positive definite matrix โ†’ ๐‘จ!๐‘จ is invertible

๐’™ = ๐‘จ!๐‘จ "๐Ÿ๐‘จ! ๐’ƒ

โ€ข If ๐‘Ÿ๐‘Ž๐‘›๐‘˜ ๐€ < ๐‘›, then ๐‘จ is rank-deficient, and solution of linear least squares problem is not unique.

What we have learned so farโ€ฆ

Page 21: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Condition number for Normal EquationsFinding the least square solution of ๐‘จ ๐’™ โ‰… ๐’ƒ (where ๐‘จ is full rank matrix) using the Normal Equations

๐‘จ(๐‘จ ๐’™ = ๐‘จ( ๐’ƒ

has some advantages, since we are solving a square system of linear equations with a symmetric matrix (and hence it is possible to use decompositions such as Cholesky Factorization)

However, the normal equations tend to worsen the conditioning of the matrix.

๐‘๐‘œ๐‘›๐‘‘ ๐‘จ(๐‘จ = (๐‘๐‘œ๐‘›๐‘‘ ๐‘จ )%

How can we solve the least square problem without squaring the condition of the matrix?

Page 22: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

SVD to solve linear least squares problems

We want to find the least square solution of ๐‘จ ๐’™ โ‰… ๐’ƒ, where ๐‘จ = ๐‘ผ ๐šบ ๐‘ฝ๐‘ป

or better expressed in reduced form: ๐‘จ = ๐‘ผ5 ๐šบ๐‘น ๐‘ฝ๐‘ป

๐‘จ =โ‹ฎ โ€ฆ โ‹ฎ๐’–# โ€ฆ ๐’–$โ‹ฎ โ€ฆ โ‹ฎ

๐œŽ#โ‹ฑ

๐œŽ%0โ‹ฎ0

โ€ฆ ๐ฏ#" โ€ฆโ‹ฎ โ‹ฎ โ‹ฎโ€ฆ ๐ฏ%" โ€ฆ

๐‘จ is a๐‘šร—๐‘› rectangular matrix where ๐‘š > ๐‘›, and hence the SVD decomposition is given by:

Page 23: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Recall Reduced SVD

๐‘จ = ๐‘ผ4 ๐šบ๐‘น ๐‘ฝ๐‘ป

๐‘šร—๐‘› ๐‘šร—๐‘›๐‘›ร—๐‘›

๐‘›ร—๐‘›

๐‘š > ๐‘›

Page 24: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We
Page 25: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

SVD to solve linear least squares problems

We want to find the least square solution of ๐‘จ ๐’™ โ‰… ๐’ƒ, where ๐‘จ = ๐‘ผ$ ๐šบ๐‘น ๐‘ฝ๐‘ป

Normal equations: ๐‘จ"๐‘จ ๐’™ = ๐‘จ" ๐’ƒ โŸถ ๐‘ผ& ๐šบ๐‘น ๐‘ฝ" " ๐‘ผ& ๐šบ๐‘น ๐‘ฝ" ๐’™ = ๐‘ผ& ๐šบ๐‘น ๐‘ฝ" "๐’ƒ

๐‘จ =โ‹ฎ โ€ฆ โ‹ฎ๐’–! โ€ฆ ๐’–Aโ‹ฎ โ€ฆ โ‹ฎ

๐œŽ!โ‹ฑ

๐œŽA

โ€ฆ ๐ฏ!( โ€ฆโ‹ฎ โ‹ฎ โ‹ฎโ€ฆ ๐ฏA( โ€ฆ

๐‘จ = ๐‘ผ4 ๐šบ๐‘น ๐‘ฝ๐‘ป

๐‘ฝ ๐šบ๐‘น๐‘ผ&" ๐‘ผ& ๐šบ๐‘น ๐‘ฝ" ๐’™ = ๐‘ฝ ๐šบ๐‘น๐‘ผ&"๐’ƒ

๐‘ฝ ๐šบ๐‘น ๐šบ๐‘น ๐‘ฝ"๐’™ = ๐‘ฝ ๐šบ๐‘น๐‘ผ&"๐’ƒ

๐šบ๐‘น ( ๐‘ฝ"๐’™ = ๐šบ๐‘น๐‘ผ&"๐’ƒ When can we take the inverse of the singular matrix?

Page 26: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

๐šบ๐‘น " ๐‘ฝ#๐’™ = ๐šบ๐‘น๐‘ผ$#๐’ƒ

1) Full rank matrix (๐œŽ$ โ‰  0 โˆ€๐‘–):

๐‘ฝ#๐’™ = ๐šบ๐‘น %&๐‘ผ$#๐’ƒ๐’™ = ๐‘ฝ ๐šบ๐‘น "'๐‘ผ$! ๐’ƒ

Unique solution:

๐‘›ร—๐‘› ๐‘›ร—๐‘› ๐‘›ร—๐‘š๐‘šร—1๐‘›ร—1

rank ๐‘จ = ๐‘›

2) Rank deficient matrix ( rank ๐‘จ = ๐‘Ÿ < ๐‘› )

Solution is not unique!!

Find solution ๐’™ such thatmin๐’™๐œ™ ๐’™ = ๐’ƒ โˆ’ ๐‘จ ๐’™ "

"

and also

๐šบ๐‘น " ๐‘ฝ#๐’™ = ๐šบ๐‘น๐‘ผ$#๐’ƒ

min๐’™

๐’™ ๐Ÿ

Page 27: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

2) Rank deficient matrix (continue)

Change of variables: Set ๐‘ฝ#๐’™ = ๐’š and then solve ๐šบ๐‘น ๐’š = ๐‘ผ$#๐’ƒ for the variable ๐’š

๐œŽ#โ‹ฑ

๐œŽ)0

โ‹ฑ0

๐‘ฆ#โ‹ฎ๐‘ฆ)๐‘ฆ)*#โ‹ฎ๐‘ฆ%

=

๐’–#"๐’ƒโ‹ฎ

๐’–)"๐’ƒ๐’–)*#" ๐’ƒโ‹ฎ

๐’–%"๐’ƒ

๐‘ฆ+ =๐’–+"๐’ƒ๐œŽ+

๐‘– = 1,2, โ€ฆ , ๐‘Ÿ

What do we do when ๐‘– > ๐‘Ÿ? Which choice of ๐‘ฆ+ will minimize

๐’™ ๐Ÿ = ๐‘ฝ ๐’š ๐Ÿ?

๐‘ฆ+ = 0, ๐‘– = ๐‘Ÿ + 1,โ€ฆ , ๐‘›Set

We want to find the solution ๐’™ that satisfies ๐šบ๐‘น " ๐‘ฝ#๐’™ = ๐šบ๐‘น๐‘ผ$#๐’ƒ and also satisfies min๐’™

๐’™ ๐Ÿ

Evaluate

๐’™ = ๐‘ฝ๐’š =โ‹ฎ โ€ฆ โ‹ฎ๐’—& โ€ฆ ๐’—)โ‹ฎ โ€ฆ โ‹ฎ

๐‘ฆ&๐‘ฆ"โ‹ฎ๐‘ฆ)

๐’™ =9*+&

)

๐‘ฆ* ๐’—๐’Š = 9*+&-!./

)(๐’–*#๐’ƒ)๐œŽ*

๐’—๐’Š

Page 28: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Solving Least Squares Problem with SVD (summary)

โ€ข Find ๐’™ that satisfies min๐’™

๐’ƒ โˆ’ ๐‘จ ๐’™ ))

โ€ข Find ๐’š that satisfiesmin๐’š

๐šบ๐‘น ๐’š โˆ’ ๐‘ผ$#๐’ƒ ""

โ€ข Propose ๐’š that is solution of ๐šบ๐‘น ๐’š = ๐‘ผ5(๐’ƒ

โ€ข Evaluate: ๐’› = ๐‘ผ5(๐’ƒ

โ€ข Set: ๐‘ฆ$ = hO"P", if ๐œŽ$ โ‰  0

0, otherwise๐‘– = 1,โ€ฆ , ๐‘›

โ€ข Then compute ๐’™ = ๐‘ฝ ๐’š

Cost:

๐‘š ๐‘›

๐‘›

๐‘›#

Cost of SVD:๐‘‚(๐‘š ๐‘›#)

Page 29: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

โ€ข If ๐œŽ$โ‰  0 for โˆ€๐‘– = 1,โ€ฆ , ๐‘›, then the solution ๐’š = ๐‘ฝ ๐šบ๐‘น Q!๐‘ผ5( ๐’ƒ is unique (and not a โ€œchoiceโ€).

โ€ข If at least one of the singular values is zero, then the proposed solution ๐’š is the one with the smallest 2-norm ( ๐’š % is minimal ) that minimizes the 2-norm of the residual ๐šบ๐‘น ๐’š โˆ’ ๐‘ผ5(๐’ƒ %

โ€ข Since ๐’™ % = ๐‘ฝ ๐’š %= ๐’š %, then the solution ๐’™ is also the one with the smallest 2-norm ( ๐’™ % is minimal ) for all possible ๐’™ for which ๐‘จ๐’™ โˆ’ ๐’ƒ % is minimal.

Solving Least Squares Problem with SVD (summary)

Page 30: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Solve ๐‘จ ๐’™ โ‰… ๐’ƒ or ๐‘ผ> ๐šบ๐‘น๐‘ฝ๐‘ป๐’™ โ‰… ๐’ƒ

๐’™ โ‰… ๐‘ฝ ๐šบ๐‘น A ๐‘ผ>B ๐’ƒ

Solving Least Squares Problem with SVD (summary)

Page 31: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

Consider solving the least squares problem ๐‘จ ๐’™ โ‰… ๐’ƒ, where the singular value decomposition of the matrix ๐‘จ = ๐‘ผ ๐šบ ๐‘ฝ๐‘ป๐’™ is:

Determine ๐’ƒ โˆ’ ๐‘จ ๐’™ (

Example:

Page 32: Least Squares and Data Fitting - University Of Illinoisย ยท Data fitting -not always a line fit! LinearLeast Squares: The problem is linear in its coefficients! Another examples We

ExampleSuppose you have ๐‘จ = ๐‘ผ ๐šบ ๐‘ฝ๐‘ป๐’™ calculated. What is the cost of solving

min๐’™

๐’ƒ โˆ’ ๐‘จ ๐’™ %% ?

A) ๐‘‚(๐‘›)B) ๐‘‚( ๐‘›%)C) ๐‘‚(๐‘š๐‘›)D) ๐‘‚ ๐‘šE) ๐‘‚( ๐‘š%)