SlideShare a Scribd company logo
Normal equations for linear regression?
No! Please no!
Hamed Zakerzadeh
Hamed Zakerzadeh Normal equations 1 / 3
Linear regression
Find the best parameters β describing the linear relation
between n variables x1, ⋯, xn (columns of X ∈ Rm×n
) and y,
having m data points, that is, to minimize ε:
y = Xβ + ε
How to solve minβ ∥Xβ − y∥?
using normal equation
Apply first-order optimality condition:
(Xt
X) β = Xt
y
solve n × n full symmetric system
using Cholesky factorization
using QR decomposition
X = Q R the product of orthogonal Q ∈ Rm×m
and upper-triangular R ∈ Rm×n
min
β
∥Xβ − y∥ = min
β
∥R β − Qt
y∥
solve simple n × n upper-triangular
system using backward substitution
If m ≫ n Ô⇒ NE method is 2x faster (flops: O(n3
+ mn2
) vs O(2mn2
) for QR)
Hamed Zakerzadeh Normal equations 2 / 3
Achilles heel: numerical stability
Information may be lost forming Xt
X: [
1 1
 0
] Ô⇒ [
1 + 2
1
1 1
]
Condition number being denoted by κ, forward error bound is proportional to
κ(X)2
for NE method while it was only κ(X) for the original least squares problem.
QR method is always backward stable while NE method is guaranteed to be
backward stable only if X is well-conditioned.
The last word
NE method is simple for teaching machine learning and, sometimes, useful in practice.
But be aware of its disadvantages!
“Although numerical analysts almost invariably
solve the full rank LS problem by QR factor-
ization, statisticians frequently use the normal
equations (though perhaps less frequently than
they used to, thanks to the influence of numer-
ical analysts).”
Hamed Zakerzadeh Normal equations 3 / 3

More Related Content

What's hot

Proofs nearest rank
Proofs nearest rankProofs nearest rank
Proofs nearest rank
fithisux
 
Friedrichs1958
Friedrichs1958Friedrichs1958
Friedrichs1958
staros11
 
Theorem-proving Verification of Multi-clock Synchronous Circuits on Multimoda...
Theorem-proving Verification of Multi-clock Synchronous Circuits on Multimoda...Theorem-proving Verification of Multi-clock Synchronous Circuits on Multimoda...
Theorem-proving Verification of Multi-clock Synchronous Circuits on Multimoda...
Shunji Nishimura
 
Basic terminology description in convex optimization
Basic terminology description in convex optimizationBasic terminology description in convex optimization
Basic terminology description in convex optimization
VARUN KUMAR
 
Composition Of Functions & Difference Quotient
Composition Of Functions & Difference QuotientComposition Of Functions & Difference Quotient
Composition Of Functions & Difference Quotient
cpirie0607
 
Fixedpoint
FixedpointFixedpoint
Fixedpoint
uis
 
Cycloidal pendulum
Cycloidal pendulumCycloidal pendulum
Cycloidal pendulum
eli priyatna laidan
 
Zero. Probabilystic Foundation of Theoretyical Physics
Zero. Probabilystic Foundation of Theoretyical PhysicsZero. Probabilystic Foundation of Theoretyical Physics
Zero. Probabilystic Foundation of Theoretyical Physics
Gunn Quznetsov
 
Tensor analysis
Tensor analysisTensor analysis
Tensor analysis
University of Education
 
Newton Raphson Method
Newton Raphson MethodNewton Raphson Method
Newton Raphson Method
Tayyaba Abbas
 
Help, we have no more time for testing! (gotoCon Berlin 2013)
Help, we have no more time for testing! (gotoCon Berlin 2013)Help, we have no more time for testing! (gotoCon Berlin 2013)
Help, we have no more time for testing! (gotoCon Berlin 2013)
Dr. Alexander Schwartz
 
L4 one sided limits limits at infinity
L4 one sided limits limits at infinityL4 one sided limits limits at infinity
L4 one sided limits limits at infinity
James Tagara
 
Line integrals
Line integralsLine integrals
Line integrals
Tarun Gehlot
 
Application of integral calculus
Application of integral calculusApplication of integral calculus
Application of integral calculus
Habibur Rahman
 
Application of Derivative 1
Application of Derivative 1Application of Derivative 1
Application of Derivative 1
Lakshmikanta Satapathy
 
Change of order in integration
Change of order in integrationChange of order in integration
Change of order in integration
Shubham Sojitra
 

What's hot (16)

Proofs nearest rank
Proofs nearest rankProofs nearest rank
Proofs nearest rank
 
Friedrichs1958
Friedrichs1958Friedrichs1958
Friedrichs1958
 
Theorem-proving Verification of Multi-clock Synchronous Circuits on Multimoda...
Theorem-proving Verification of Multi-clock Synchronous Circuits on Multimoda...Theorem-proving Verification of Multi-clock Synchronous Circuits on Multimoda...
Theorem-proving Verification of Multi-clock Synchronous Circuits on Multimoda...
 
Basic terminology description in convex optimization
Basic terminology description in convex optimizationBasic terminology description in convex optimization
Basic terminology description in convex optimization
 
Composition Of Functions & Difference Quotient
Composition Of Functions & Difference QuotientComposition Of Functions & Difference Quotient
Composition Of Functions & Difference Quotient
 
Fixedpoint
FixedpointFixedpoint
Fixedpoint
 
Cycloidal pendulum
Cycloidal pendulumCycloidal pendulum
Cycloidal pendulum
 
Zero. Probabilystic Foundation of Theoretyical Physics
Zero. Probabilystic Foundation of Theoretyical PhysicsZero. Probabilystic Foundation of Theoretyical Physics
Zero. Probabilystic Foundation of Theoretyical Physics
 
Tensor analysis
Tensor analysisTensor analysis
Tensor analysis
 
Newton Raphson Method
Newton Raphson MethodNewton Raphson Method
Newton Raphson Method
 
Help, we have no more time for testing! (gotoCon Berlin 2013)
Help, we have no more time for testing! (gotoCon Berlin 2013)Help, we have no more time for testing! (gotoCon Berlin 2013)
Help, we have no more time for testing! (gotoCon Berlin 2013)
 
L4 one sided limits limits at infinity
L4 one sided limits limits at infinityL4 one sided limits limits at infinity
L4 one sided limits limits at infinity
 
Line integrals
Line integralsLine integrals
Line integrals
 
Application of integral calculus
Application of integral calculusApplication of integral calculus
Application of integral calculus
 
Application of Derivative 1
Application of Derivative 1Application of Derivative 1
Application of Derivative 1
 
Change of order in integration
Change of order in integrationChange of order in integration
Change of order in integration
 

Similar to Normal equations for linear regression?

Random Matrix Theory and Machine Learning - Part 3
Random Matrix Theory and Machine Learning - Part 3Random Matrix Theory and Machine Learning - Part 3
Random Matrix Theory and Machine Learning - Part 3
Fabian Pedregosa
 
06_AJMS_256_20-compressed.pdf
06_AJMS_256_20-compressed.pdf06_AJMS_256_20-compressed.pdf
06_AJMS_256_20-compressed.pdf
BRNSS Publication Hub
 
Solving High-order Non-linear Partial Differential Equations by Modified q-Ho...
Solving High-order Non-linear Partial Differential Equations by Modified q-Ho...Solving High-order Non-linear Partial Differential Equations by Modified q-Ho...
Solving High-order Non-linear Partial Differential Equations by Modified q-Ho...
BRNSS Publication Hub
 
Ch07 5
Ch07 5Ch07 5
Ch07 5
Rendy Robert
 
Metodo gauss_newton.pdf
Metodo gauss_newton.pdfMetodo gauss_newton.pdf
Metodo gauss_newton.pdf
MarceloAlejandroPala
 
QMC: Operator Splitting Workshop, Using Sequences of Iterates in Inertial Met...
QMC: Operator Splitting Workshop, Using Sequences of Iterates in Inertial Met...QMC: Operator Splitting Workshop, Using Sequences of Iterates in Inertial Met...
QMC: Operator Splitting Workshop, Using Sequences of Iterates in Inertial Met...
The Statistical and Applied Mathematical Sciences Institute
 
MASSS_Presentation_20160209
MASSS_Presentation_20160209MASSS_Presentation_20160209
MASSS_Presentation_20160209
Yimin Wu
 
Non-negative Matrix Factorization
Non-negative Matrix FactorizationNon-negative Matrix Factorization
Non-negative Matrix Factorization
AkankshaAgrawal55
 
Recurrence equations
Recurrence equationsRecurrence equations
Recurrence equations
Tarun Gehlot
 
Es272 ch5a
Es272 ch5aEs272 ch5a
The low-rank basis problem for a matrix subspace
The low-rank basis problem for a matrix subspaceThe low-rank basis problem for a matrix subspace
The low-rank basis problem for a matrix subspace
Tasuku Soma
 
Quadrature
QuadratureQuadrature
Quadrature
Linh Tran
 
Lecture 3 - Linear Regression
Lecture 3 - Linear RegressionLecture 3 - Linear Regression
Lecture 3 - Linear Regression
Harsha Vardhan Tetali
 
Appendex b
Appendex bAppendex b
Appendex b
swavicky
 
Concentration inequality in Machine Learning
Concentration inequality in Machine LearningConcentration inequality in Machine Learning
Concentration inequality in Machine Learning
VARUN KUMAR
 
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
The Statistical and Applied Mathematical Sciences Institute
 
Chapter 3 solving systems of linear equations
Chapter 3 solving systems of linear equationsChapter 3 solving systems of linear equations
Chapter 3 solving systems of linear equations
ssuser53ee01
 
The electromagnetic field
The electromagnetic fieldThe electromagnetic field
The electromagnetic field
Gabriel O'Brien
 
ch3.ppt
ch3.pptch3.ppt
overviewPCA
overviewPCAoverviewPCA
overviewPCA
Edwin Heredia
 

Similar to Normal equations for linear regression? (20)

Random Matrix Theory and Machine Learning - Part 3
Random Matrix Theory and Machine Learning - Part 3Random Matrix Theory and Machine Learning - Part 3
Random Matrix Theory and Machine Learning - Part 3
 
06_AJMS_256_20-compressed.pdf
06_AJMS_256_20-compressed.pdf06_AJMS_256_20-compressed.pdf
06_AJMS_256_20-compressed.pdf
 
Solving High-order Non-linear Partial Differential Equations by Modified q-Ho...
Solving High-order Non-linear Partial Differential Equations by Modified q-Ho...Solving High-order Non-linear Partial Differential Equations by Modified q-Ho...
Solving High-order Non-linear Partial Differential Equations by Modified q-Ho...
 
Ch07 5
Ch07 5Ch07 5
Ch07 5
 
Metodo gauss_newton.pdf
Metodo gauss_newton.pdfMetodo gauss_newton.pdf
Metodo gauss_newton.pdf
 
QMC: Operator Splitting Workshop, Using Sequences of Iterates in Inertial Met...
QMC: Operator Splitting Workshop, Using Sequences of Iterates in Inertial Met...QMC: Operator Splitting Workshop, Using Sequences of Iterates in Inertial Met...
QMC: Operator Splitting Workshop, Using Sequences of Iterates in Inertial Met...
 
MASSS_Presentation_20160209
MASSS_Presentation_20160209MASSS_Presentation_20160209
MASSS_Presentation_20160209
 
Non-negative Matrix Factorization
Non-negative Matrix FactorizationNon-negative Matrix Factorization
Non-negative Matrix Factorization
 
Recurrence equations
Recurrence equationsRecurrence equations
Recurrence equations
 
Es272 ch5a
Es272 ch5aEs272 ch5a
Es272 ch5a
 
The low-rank basis problem for a matrix subspace
The low-rank basis problem for a matrix subspaceThe low-rank basis problem for a matrix subspace
The low-rank basis problem for a matrix subspace
 
Quadrature
QuadratureQuadrature
Quadrature
 
Lecture 3 - Linear Regression
Lecture 3 - Linear RegressionLecture 3 - Linear Regression
Lecture 3 - Linear Regression
 
Appendex b
Appendex bAppendex b
Appendex b
 
Concentration inequality in Machine Learning
Concentration inequality in Machine LearningConcentration inequality in Machine Learning
Concentration inequality in Machine Learning
 
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
 
Chapter 3 solving systems of linear equations
Chapter 3 solving systems of linear equationsChapter 3 solving systems of linear equations
Chapter 3 solving systems of linear equations
 
The electromagnetic field
The electromagnetic fieldThe electromagnetic field
The electromagnetic field
 
ch3.ppt
ch3.pptch3.ppt
ch3.ppt
 
overviewPCA
overviewPCAoverviewPCA
overviewPCA
 

More from Hamed Zakerzadeh

Can you count on your computer?
Can you count on your computer?Can you count on your computer?
Can you count on your computer?
Hamed Zakerzadeh
 
Asymptotic Preserving Schemes
Asymptotic Preserving SchemesAsymptotic Preserving Schemes
Asymptotic Preserving Schemes
Hamed Zakerzadeh
 
Is “Principal Component Analysis” different from SVD?
Is “Principal Component Analysis” different from SVD?Is “Principal Component Analysis” different from SVD?
Is “Principal Component Analysis” different from SVD?
Hamed Zakerzadeh
 
Can you count on your computer for the Gaussian elimination?
Can you count on your computer for the Gaussian elimination?Can you count on your computer for the Gaussian elimination?
Can you count on your computer for the Gaussian elimination?
Hamed Zakerzadeh
 
Congrès SMAI 2019
Congrès SMAI 2019Congrès SMAI 2019
Congrès SMAI 2019
Hamed Zakerzadeh
 
Higham
HighamHigham
ENTROPY STABLE ENO SCHEMES
ENTROPY STABLE ENO SCHEMESENTROPY STABLE ENO SCHEMES
ENTROPY STABLE ENO SCHEMES
Hamed Zakerzadeh
 

More from Hamed Zakerzadeh (7)

Can you count on your computer?
Can you count on your computer?Can you count on your computer?
Can you count on your computer?
 
Asymptotic Preserving Schemes
Asymptotic Preserving SchemesAsymptotic Preserving Schemes
Asymptotic Preserving Schemes
 
Is “Principal Component Analysis” different from SVD?
Is “Principal Component Analysis” different from SVD?Is “Principal Component Analysis” different from SVD?
Is “Principal Component Analysis” different from SVD?
 
Can you count on your computer for the Gaussian elimination?
Can you count on your computer for the Gaussian elimination?Can you count on your computer for the Gaussian elimination?
Can you count on your computer for the Gaussian elimination?
 
Congrès SMAI 2019
Congrès SMAI 2019Congrès SMAI 2019
Congrès SMAI 2019
 
Higham
HighamHigham
Higham
 
ENTROPY STABLE ENO SCHEMES
ENTROPY STABLE ENO SCHEMESENTROPY STABLE ENO SCHEMES
ENTROPY STABLE ENO SCHEMES
 

Recently uploaded

8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf
by6843629
 
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
Sérgio Sacani
 
GBSN - Biochemistry (Unit 6) Chemistry of Proteins
GBSN - Biochemistry (Unit 6) Chemistry of ProteinsGBSN - Biochemistry (Unit 6) Chemistry of Proteins
GBSN - Biochemistry (Unit 6) Chemistry of Proteins
Areesha Ahmad
 
11.1 Role of physical biological in deterioration of grains.pdf
11.1 Role of physical biological in deterioration of grains.pdf11.1 Role of physical biological in deterioration of grains.pdf
11.1 Role of physical biological in deterioration of grains.pdf
PirithiRaju
 
Sciences of Europe journal No 142 (2024)
Sciences of Europe journal No 142 (2024)Sciences of Europe journal No 142 (2024)
Sciences of Europe journal No 142 (2024)
Sciences of Europe
 
Direct Seeded Rice - Climate Smart Agriculture
Direct Seeded Rice - Climate Smart AgricultureDirect Seeded Rice - Climate Smart Agriculture
Direct Seeded Rice - Climate Smart Agriculture
International Food Policy Research Institute- South Asia Office
 
Farming systems analysis: what have we learnt?.pptx
Farming systems analysis: what have we learnt?.pptxFarming systems analysis: what have we learnt?.pptx
Farming systems analysis: what have we learnt?.pptx
Frédéric Baudron
 
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
vluwdy49
 
Gadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdfGadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdf
PirithiRaju
 
waterlessdyeingtechnolgyusing carbon dioxide chemicalspdf
waterlessdyeingtechnolgyusing carbon dioxide chemicalspdfwaterlessdyeingtechnolgyusing carbon dioxide chemicalspdf
waterlessdyeingtechnolgyusing carbon dioxide chemicalspdf
LengamoLAppostilic
 
molar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptxmolar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptx
Anagha Prasad
 
Micronuclei test.M.sc.zoology.fisheries.
Micronuclei test.M.sc.zoology.fisheries.Micronuclei test.M.sc.zoology.fisheries.
Micronuclei test.M.sc.zoology.fisheries.
Aditi Bajpai
 
Sexuality - Issues, Attitude and Behaviour - Applied Social Psychology - Psyc...
Sexuality - Issues, Attitude and Behaviour - Applied Social Psychology - Psyc...Sexuality - Issues, Attitude and Behaviour - Applied Social Psychology - Psyc...
Sexuality - Issues, Attitude and Behaviour - Applied Social Psychology - Psyc...
PsychoTech Services
 
Mending Clothing to Support Sustainable Fashion_CIMaR 2024.pdf
Mending Clothing to Support Sustainable Fashion_CIMaR 2024.pdfMending Clothing to Support Sustainable Fashion_CIMaR 2024.pdf
Mending Clothing to Support Sustainable Fashion_CIMaR 2024.pdf
Selcen Ozturkcan
 
Applied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdfApplied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdf
University of Hertfordshire
 
ESR spectroscopy in liquid food and beverages.pptx
ESR spectroscopy in liquid food and beverages.pptxESR spectroscopy in liquid food and beverages.pptx
ESR spectroscopy in liquid food and beverages.pptx
PRIYANKA PATEL
 
The debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically youngThe debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically young
Sérgio Sacani
 
AJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR NIET GreNo Guava Project File.pdfAJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR
 
Randomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNERandomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNE
University of Maribor
 
快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样
快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样
快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样
hozt8xgk
 

Recently uploaded (20)

8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf
 
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
 
GBSN - Biochemistry (Unit 6) Chemistry of Proteins
GBSN - Biochemistry (Unit 6) Chemistry of ProteinsGBSN - Biochemistry (Unit 6) Chemistry of Proteins
GBSN - Biochemistry (Unit 6) Chemistry of Proteins
 
11.1 Role of physical biological in deterioration of grains.pdf
11.1 Role of physical biological in deterioration of grains.pdf11.1 Role of physical biological in deterioration of grains.pdf
11.1 Role of physical biological in deterioration of grains.pdf
 
Sciences of Europe journal No 142 (2024)
Sciences of Europe journal No 142 (2024)Sciences of Europe journal No 142 (2024)
Sciences of Europe journal No 142 (2024)
 
Direct Seeded Rice - Climate Smart Agriculture
Direct Seeded Rice - Climate Smart AgricultureDirect Seeded Rice - Climate Smart Agriculture
Direct Seeded Rice - Climate Smart Agriculture
 
Farming systems analysis: what have we learnt?.pptx
Farming systems analysis: what have we learnt?.pptxFarming systems analysis: what have we learnt?.pptx
Farming systems analysis: what have we learnt?.pptx
 
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
 
Gadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdfGadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdf
 
waterlessdyeingtechnolgyusing carbon dioxide chemicalspdf
waterlessdyeingtechnolgyusing carbon dioxide chemicalspdfwaterlessdyeingtechnolgyusing carbon dioxide chemicalspdf
waterlessdyeingtechnolgyusing carbon dioxide chemicalspdf
 
molar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptxmolar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptx
 
Micronuclei test.M.sc.zoology.fisheries.
Micronuclei test.M.sc.zoology.fisheries.Micronuclei test.M.sc.zoology.fisheries.
Micronuclei test.M.sc.zoology.fisheries.
 
Sexuality - Issues, Attitude and Behaviour - Applied Social Psychology - Psyc...
Sexuality - Issues, Attitude and Behaviour - Applied Social Psychology - Psyc...Sexuality - Issues, Attitude and Behaviour - Applied Social Psychology - Psyc...
Sexuality - Issues, Attitude and Behaviour - Applied Social Psychology - Psyc...
 
Mending Clothing to Support Sustainable Fashion_CIMaR 2024.pdf
Mending Clothing to Support Sustainable Fashion_CIMaR 2024.pdfMending Clothing to Support Sustainable Fashion_CIMaR 2024.pdf
Mending Clothing to Support Sustainable Fashion_CIMaR 2024.pdf
 
Applied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdfApplied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdf
 
ESR spectroscopy in liquid food and beverages.pptx
ESR spectroscopy in liquid food and beverages.pptxESR spectroscopy in liquid food and beverages.pptx
ESR spectroscopy in liquid food and beverages.pptx
 
The debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically youngThe debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically young
 
AJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR NIET GreNo Guava Project File.pdfAJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR NIET GreNo Guava Project File.pdf
 
Randomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNERandomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNE
 
快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样
快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样
快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样
 

Normal equations for linear regression?

  • 1. Normal equations for linear regression? No! Please no! Hamed Zakerzadeh Hamed Zakerzadeh Normal equations 1 / 3
  • 2. Linear regression Find the best parameters β describing the linear relation between n variables x1, ⋯, xn (columns of X ∈ Rm×n ) and y, having m data points, that is, to minimize ε: y = Xβ + ε How to solve minβ ∥Xβ − y∥? using normal equation Apply first-order optimality condition: (Xt X) β = Xt y solve n × n full symmetric system using Cholesky factorization using QR decomposition X = Q R the product of orthogonal Q ∈ Rm×m and upper-triangular R ∈ Rm×n min β ∥Xβ − y∥ = min β ∥R β − Qt y∥ solve simple n × n upper-triangular system using backward substitution If m ≫ n Ô⇒ NE method is 2x faster (flops: O(n3 + mn2 ) vs O(2mn2 ) for QR) Hamed Zakerzadeh Normal equations 2 / 3
  • 3. Achilles heel: numerical stability Information may be lost forming Xt X: [ 1 1 0 ] Ô⇒ [ 1 + 2 1 1 1 ] Condition number being denoted by κ, forward error bound is proportional to κ(X)2 for NE method while it was only κ(X) for the original least squares problem. QR method is always backward stable while NE method is guaranteed to be backward stable only if X is well-conditioned. The last word NE method is simple for teaching machine learning and, sometimes, useful in practice. But be aware of its disadvantages! “Although numerical analysts almost invariably solve the full rank LS problem by QR factor- ization, statisticians frequently use the normal equations (though perhaps less frequently than they used to, thanks to the influence of numer- ical analysts).” Hamed Zakerzadeh Normal equations 3 / 3