Least Square Method to fit a line to a set of datapoints

  • Thread starter Thread starter MatinSAR
  • Start date Start date
  • Tags Tags
    Method Square
AI Thread Summary
To fit a line to a set of data points in the form of y = a_0 + a_1x, the least squares method minimizes the total error defined by E = ∑(y_i - a_0 - a_1x_i)². To find the coefficients a_0 and a_1, one must set the partial derivatives of E with respect to these coefficients to zero and solve the resulting equations. The discussion highlights the challenge of determining the uncertainties of a_0 and a_1, which requires assumptions about the residuals, specifically normality and homoscedasticity. Resources were shared to assist in deriving the expressions for these uncertainties. Understanding these concepts is essential for accurate linear regression analysis in physics and other fields.
MatinSAR
Messages
673
Reaction score
204
Homework Statement
Given a set of data points, we aim to fit a line to these points by minimizing the total error and finding the coefficients ##a_0##(intercept) and ##a_1##(slope).

Each of these data points has an associated error. Derive the expressions that give the errors (uncertainties) of ##a_0## and ##a_1##.
Relevant Equations
I'll mention the relevant equations later in my solution.
We are given a set of points ##(x_i , y_i)##. If we want to fit a line to these points which has the form of ##y=a_0+a_1x##, we need to do it in a way which minimizes the total error E:$$E = \sum_{i=1}^n (y_i - a_0 - a_1x_i)^2$$So we set ##\frac{\partial E}{\partial a_0} = 0## and ##\frac{\partial E}{\partial a_1} = 0## and solve the system of equations. Then we get:

1734639701853.png

1734639731835.png


My problem , I have no idea how to start with errors to find uncertainties of ##a_0## and ##a_1##.
 
Physics news on Phys.org
I believe you need to make some assumptions on the residuales; IIRC, normality and homostadicity, in order to find the distribution of the slope, intercept. Under " reasonable" conditions, they are both normal and converge to the true value.
 
  • Like
Likes Gavran and MatinSAR
WWGD said:
homostadicity
homoschedasticity ?
 
haruspex said:
homoschedasticity ?
Something like that.
 
  • Like
Likes PhDeezNutz and MatinSAR
According to this Wikipedia article,
In statistics, a sequence of random variables is homoscedastic (/ˌhoʊmoʊskəˈdæstɪk/) if all its random variables have the same finite variance; this is also known as homogeneity of variance. The complementary notion is called heteroscedasticity, also known as heterogeneity of variance. The spellings homoskedasticity and heteroskedasticity are also frequently used. “Skedasticity” comes from the Ancient Greek word “skedánnymi”, meaning “to scatter”.
 
  • Like
Likes MatinSAR and WWGD
MatinSAR said:
Homework Statement: Given a set of data points, we aim to fit a line to these points by minimizing the total error and finding the coefficients ##a_0##(intercept) and ##a_1##(slope).

Each of these data points has an associated error. Derive the expressions that give the errors (uncertainties) of ##a_0## and ##a_1##.
...
My problem , I have no idea how to start with errors to find uncertainties of ##a_0## and ##a_1##.

Here are a few links in an old thread (with a link to an even older thread, etc. etc. -- sigh -- turtles all the way down).

I specially recommend Kirchner

##\ ##
 
BvU said:
Here are a few links in an old thread (with a link to an even older thread, etc. etc. -- sigh -- turtles all the way down).

I specially recommend Kirchner

##\ ##
Thank you for providing the links. Of course, I'll eventually find a post that doesn't link to an older one.
 
  • #10
Why is this thread placed in the Introductory Physics Homework Help?
 
  • #11
Gavran said:
Why is this thread placed in the Introductory Physics Homework Help?
Because students in introductory physics courses with a lab component are sometimes required to use linear regression to analyze their data?
 
Last edited:
  • Like
Likes MatinSAR and Gavran
  • #12

Similar threads

Replies
2
Views
5K
Replies
13
Views
1K
Replies
9
Views
2K
Replies
4
Views
1K
Replies
3
Views
3K
Replies
12
Views
2K
Back
Top