==Áp dụng==
Phương pháp bình phương tối thiểu tuyến tính có thể được sử dụng để tìm một hàm affine '''R'''<sup>n</sup> → '''R''' khớp nhất với một tập hợp dữ liệu cho trước (xem phương pháp [[bình phương tối thiểu]]).
The linear least squares method can be used to find an affine function '''R'''<sup>n</sup> → '''R''' that best fits a given set of data (see general [[least squares]] method). It is widely and erroneously thought that the word ''linear'' in the term ''[[linear regression]]'' refers to the linear or affine nature of the fitted function.
Ví dụ
For example
: <math>y = \alpha + \beta x + \gamma x^2 + \varepsilon</math>
là một mô hình regression tuyến tính, với phần phải là một tổ hợp tuyến tính của các tham số α, β, và γ; hơn nữa, các đánh giá bình phương tối thiểu của các tham số này là tuyến tính trong vector của các giá trị quan sát ''y''.
is still a linear regression model, for the right-hand side is a linear combination of the parameters α, β, and γ; moreover, the least-squares estimates of those parameters are linear in the vector of observed ''y''-values. In this case it is useful to think of ''x''<sup>2</sup> as a new independent variable, formed by modifying the original variable ''x''. However, it is convention to call this a quadratic fit or a 2nd-order polynomial fit.
WeChúng writeta theviết linearhàm functiontuyến wetính trycần totìm findnhư aslà amột ma trận 1-bynhân-''n'' matrix '''x'''<sup>T</sup> (sodo đó '''x''' isthật actuallyra alà column1 vectơ vectorcột, seexem alsothêm [[linearbiến đổi tuyến transformationtính]]).
TheTập setdữ ofliệu datagồm consists ofcó ''m'' (''n'' + 1)-[[bộ n-tuple số|tuplesbộ số]] (''x''<sub>1</sub>, ..., ''x''<sub>''n''</sub>, ''y''). ThoseNhững cangiá betrị writtennày intođược viết vào một ma trận an ''m''-bynhân-''n'' matrix ''A'' andvà amột vector '''b''', wherevới everymỗi tuplebộ correspondstương toứng avới rowmột ofhàng của ''A'', thevà ''y'' becomingtrở thành các phần thetử correspondingtương entryứng introng '''b'''.
Sau đó,
Then,
: ''A'''''x''' ≈ '''b'''
yieldscho theta functionhàm số '''x''' wecần seektìm.
== Ví dụ ==
|