You are Here: Home >< Maths

# Least Squares Deriviation Watch

Announcements
1. I've got the derivation of least squares in my notes here, but I'm confused about part of it. I'll post everything, in case I missed something.

(Assuming the errors in x are much smaller than the errors in y)

Let us represent the N data points, with i going from 1 to N, by (, ). We then need to define S, the sum of the vertical squared distances of all the points from the straight line y = mx+c. This is given by

To find the values of c and m which minimise S we partially differentiate with respect to c, and to m. The derivatives are set to equal zero. The values of c and m which satisfy the resulting pair of equations are the values which minimise S.

The first equation gives us:

and the second:

Solving these simultaenously gives us the values of m and c, which allows us to write the equation of the line of best fit for the data points.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

My question: where do the 2s in the derivitives go?

I'm probably being obtuse, but it's actually confusing me lol. I figure once I fully understand the process for the line of best fit, adapting to a curve shouldn't be difficult. (It's just one more equation to solve simultaenously, right? :P)
2. If you have the equation 2*(whatever) = 0, then it's true that (whatever) = 0. They've done this because it makes it easier to look at.
3. (Original post by spex)
If you have the equation 2*(whatever) = 0, then it's true that (whatever) = 0. They've done this because it makes it easier to look at.
*facepalm*

I feel like an actual idiot now. I knew it was something obvious. Thanks!

EDIT: I guess an actual derivation of this method would require looking at the second derivitives to prove that m and c are actually minimised, right?
4. You could do that, or you could think about it a bit more. There's not going to be a maximum distance for how far a line can be from the set of points, because you can always move it further. So the critical point where the derivatives are 0 must be a minimum.
5. (Original post by spex)
You could do that, or you could think about it a bit more. There's not going to be a maximum distance for how far a line can be from the set of points, because you can always move it further. So the critical point where the derivatives are 0 must be a minimum.
...That also makes perfect sense. Already +rep'd you.

TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: December 30, 2010
Today on TSR

### Things NOT to do at uni

Have you done any of these?

### How much revision have yr12s done?

Discussions on TSR

• Latest
• ## See more of what you like on The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

• Poll
Useful resources

### Maths Forum posting guidelines

Not sure where to post? Read the updated guidelines here

### How to use LaTex

Writing equations the easy way

### Study habits of A* students

Top tips from students who have already aced their exams

## Groups associated with this forum:

View associated groups
Discussions on TSR

• Latest
• ## See more of what you like on The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

• The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.