Weighted Least Squares fit

8 views (last 30 days)
Sudheer
Sudheer on 30 Apr 2011
Hello Friends,
The weights in Weighted Least squares are traditionally assumed as inverse of variance. But for example if my data is made of two parts. My question is instead of inverse of variance, can I use any value for weight. For example for the first part of data, when I use w1=10 and for second part of data the weight w2=1 I can see visually that the fit is good and i want to use this.
When I use w1=5 and w2=1 the fit is not so great.
So does the fact that I'm not using the variance as estimates of weights make a difference to my results. Is it a rule that weights have to be known. Can you judge the fit visually and make adjustments to weights randomly.
Thank you.

Accepted Answer

Andrew Newell
Andrew Newell on 30 Apr 2011
You can certainly make visual adjustments to the weights to get a better fit - but what would the fit mean? I am assuming that there is some purpose to fitting the data besides making a nice plot.
When you're doing least squares fits, you're fitting the data to some statistical model. The most common model is that the errors in your measurements are independent and have equal variance. If they don't have equal variance, then you use weighted least squares. If you don't know the variances, there are methods for estimating them. See this earlier discussion.

More Answers (1)

Sudheer
Sudheer on 2 May 2011
Hello Andrew, Thanks a lot for your answer. My idea behind my question was that I was trying to estimate four parameters by fitting a model to some experimental data. When I used ordinary least squares and based my judgement on residual sum of square value and visual judgement, I was able to estimate the parameters. How ever when I used random weights of w1=10 and w=1 for first and second parts the fit improved greatly(visually). So can I believe the new parameters through the weighted least squares. So I was wondering since I had no way to know weights in prior, does these random weights effect the results in any way. I am currently reading the links you have provided to estimate the weights to see if I can incorporate them.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!