How Do You Optimize a and b in Linear Regression for Minimal Deviation?

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 3K views
oleandora
Messages
2
Reaction score
0

Homework Statement



I've been given a set of data
x 0 0.5 0.7 1.5 1.75
y 0.5 0.72 0.51 1.5 1.63

Given y=ax+b

for this data points of linear model, I have to
1. minimize the sum of the absolute values of deviations between experimental value of Y and value predicted by the linear relation
2. minimiza the maximum value of deviation between all experimental values of Y and value predicted by linear relation

The question is
What are the optimal values of a and b for both cases and values of objective function.

Homework Equations


The Attempt at a Solution


What I know is
y=ax+b+e where e is the deviation but that's it. I don't even have the slightest idea for the next steps.
I know seems simplebut I have very little background on linear regression.
Help! T_T
 
Physics news on Phys.org
Hey, this is the first time I tried to help someone on this forum, so don't shoot me if I am wronge. If we are at the same level I guess you are supposed to use OLS Ordinary Least Square.

b = [tex]\sum[/tex] (Xi-[tex]\bar{X}[/tex])(Yi-[tex]\bar{Y}[/tex])/
[tex]\sum[/tex] (Xi-[tex]\bar{X}[/tex])2

a = [tex]\bar{Y}[/tex] - b[tex]\bar{X}[/tex]

where you sum from 1 to n.
[tex]\bar{X}[/tex] means the average