Weighted least squares residuals

  • Context: Graduate 
  • Thread starter Thread starter vibe3
  • Start date Start date
  • Tags Tags
    Least squares Squares
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 2K views
vibe3
Messages
39
Reaction score
1
Hello,

When doing a weighted least squares fit of a model to data, I want to examine the residuals to see if their histogram matches the expected probability distribution. Since I am minimizing
[tex] \chi^2 = \sum_i w_i \left[ y_i - Y(x_i) \right]^2[/tex]
would I define my (normalized/studentized) residuals as
[tex] r_i = \frac{\sqrt{w_i} ( y_i - Y(x_i) )}{\sigma \sqrt{1 - h_i}}[/tex]
or in the usual way as
[tex] r_i = \frac{y_i - Y(x_i)}{\sigma \sqrt{1 - h_i}}[/tex]
where [itex]h_i[/itex] are the statistical leverages and [itex]\sigma[/itex] is the residual standard deviation. I am using a robust (iterative) least squares procedure to determine the weights [itex]w_i[/itex] in order to detect and eliminate outliers, so the residual histogram should match the expected distribution of the M-estimator function I'm using (Huber in my case).
 
Physics news on Phys.org
I don't know what a "statistical leverage" is.

If the weights are just something used in the fitting process and are not parameters of the predictive model then the weights are not involved in the calculation of an individual "residual" of the model, by the usual definition of "residual". You'll get better advice if you state the problem precisely. If you are using an example of M-estimation as a guide, can you give a link to it?
 
It looks like to me that you're using a bisquare weight method. You will want to use the normal definition of the residual and with adjusted residual defined as [tex]r_{adj} = \frac{r_{i}}{\sqrt{1-h_i}}[/tex]. Where [tex]r_{i}[/tex] is your residual as defined normally and [tex]h_{i}[/tex] is your leverage. Matlab or SAS will produce this as your weighted least squares as the default.