Docsity

Linear Regression: Minimizing Error and Finding Coefficients, Lecture notes of Computer Engineering and Programming

Toggle sidebar
bg1
Minimizing Error
- MSE for simplu
linear regression is:
E (a,b)= ŕ Ž (yn caxn+b)*
,
v
In -
(b²
nel
-We want
to
minimize E
E
- Use the derivative:
d E
da =
Ñ [ -2xn lyn- Carn +b)) 20
n=1
12
nel
-
E
- we get a =
ni
de
db
- 2 (yn - (axn+b)) = 0
(
Using the second equation:
- we eventually find b=ý - ax
b =
9 -
Using the first equation:
& Xn yn - Nyx
-NE?
Matrix form of linear regression
]
y=Xß + € (we can write equations for all data points compactly
by using this equation)
nal
y,
simple linear regresion: x= [1] B=(8] yol
XN
na?..., N
multivariable linear regression: (M explanatory variables)
y = a, xn,1 + a2 *n, 2
+ + am Xn, M + b + En
"
y,
X is the
Xa
X2,M I
EM
ß

Partial preview of the text

Download Linear Regression: Minimizing Error and Finding Coefficients and more Lecture notes Computer Engineering and Programming in PDF only on Docsity!

Minimizing Error

  • MSE for simplu

linear regression is: E (a,b)= ŕ Ž (yn caxn+b)* , v In - (b² nel -We want to minimize E E

  • Use the derivative:

d E da = Ñ [ -2xn lyn- Carn +b)) 20 n= 12 nel

E

  • we get a =

ni de db

  • 2 (yn - (axn+b)) = 0

( Using the second equation:

  • we eventually find b=ý - ax

b = 9 - Using the first equation: & Xn yn - Nyx -NE? Matrix form of linear regression ] y=Xß + € (we can write equations for all data points compactly by using this equation) nal y, simple linear regresion: x= [1] B=(8] yol XN na?..., N multivariable linear regression: (M explanatory variables) y = a, xn,1 + a2 *n, 2

    • am Xn, M + b + En " y, X is the Xa X2,M I EM ß