Uncertainty for least squares fit

In summary, the conversation discusses fitting data to a parabolic equation using the least squares fit method, where each data point has error bars based on the standard deviation of 5 y values. The individual asks about calculating uncertainty for a single point on the fitted line and is introduced to conditional standard errors. The conversation then delves into the use of conditional standard errors and how they are derived from the basic linear model. Finally, the conversation briefly touches on the relationship between uncertainty and the goodness of fit, and the use of sigma as the variance of the residual terms.
  • #1
LizardCobra
17
0
I am fitting data to a parabolic equation using the least squares fit method. Each data point that goes into the fit is the average of 5 data points at that x value, so that each point has error bars that come from the standard deviation of those 5 y values.

I have a fitted equation, and I can calculate the residuals, but how can I calculate the uncertainty for a single point on the fitted line? So say the fitted equation is y = ax^2 +bx+c. I want to be able to plug in a value for x, get a value for y (that much is trivial) and get the associated uncertainty on that y value.

Thanks
 
Physics news on Phys.org
  • #2
Hey LizardCobra and welcome to the forums.

Are you aware of conditional standard errors? (I.e. se(y|x)?) They are related to conditional variances and standard deviations (same sort of idea) but you are dealing with sample data and not population data.
 
  • #3
No, I hadn't considered conditional standard error- does that apply here, and if so how would I use it?

I said that the standard deviation of the fitted line (which I called the uncertainty on y_fit) was the square root of the variance of the residuals. The uncertainty for the fitted line ended up being smaller than the uncertainty for many of the individual data points. Not entirely sure if what I did is Kosher.
 
  • #4
An example using a simple linear model (with y and x only) would be that

Var(y_hat|x) = sigma^2(1/n + (x-x_bar)^2/SXX) where SXX is summation from i = 1 to n (n is the number of paired observations) for (x_i - x_bar)*(x_i - x_bar).

The above gives the variance of the predicted y (y_hat) given an x.

You can derive these from the basic linear model.
 
  • #5
I don't understand this at all. What are x_i, x_bar, and x referring to here? And shouldn't the uncertainty somehow depend on the y values for the data and the y values for the fit?
 
  • #6
The ith observation is x_i and the sample mean is x_bar. The x is the x-value that you finding the standard error on.

Remember you are getting the standard error of the fitted y-value at a given x point (recall that y is a function of x).
 
  • #7
I don't see how this is at all related to the 'goodness of fit'. It seems like it is really only dependent on the number of data points that were used.
 
  • #8
What is sigma? The standard deviation of... what?

thanks
 
  • #9
You asked about uncertainty for a fitted model at a single point, and I've outlined the expression to calculate it under a simple linear regression.

Sigma is the variance of the residual terms (we assume in this model it's constant for every residual term) and we estimate this through sigma_hat^2.
 

1. What is uncertainty for least squares fit?

Uncertainty for least squares fit is a measure of the variability or margin of error in the predicted values of a regression line. It represents the range of values that the actual data points are likely to fall within, given the limitations of the model and the data.

2. Why is uncertainty important in least squares fit?

Uncertainty is important in least squares fit because it allows us to assess the reliability and accuracy of the regression model. It helps us understand the potential errors and limitations of the model and make informed decisions based on the data.

3. How is uncertainty calculated in least squares fit?

Uncertainty in least squares fit is typically calculated using the standard error of the estimate, which takes into account the variability of the data points and the distance of each data point from the regression line. It can also be calculated using other statistical measures such as confidence intervals and p-values.

4. What factors can affect uncertainty in least squares fit?

There are several factors that can affect uncertainty in least squares fit, including the amount and quality of the data, the assumptions made about the data and the model, and the statistical techniques used to calculate uncertainty. Other factors such as outliers and influential data points can also impact uncertainty.

5. How can we reduce uncertainty in least squares fit?

One way to reduce uncertainty in least squares fit is to increase the amount and quality of the data. This can help to reduce the variability of the data and improve the accuracy of the regression model. Additionally, using appropriate statistical techniques, checking for outliers and influential data points, and validating assumptions can also help to reduce uncertainty in least squares fit.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
28
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
891
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
491
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
24
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
16
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
16
Views
1K
Back
Top