MATLAB: Weighted Least Squares fit

Statistics and Machine Learning Toolboxweighted least squaresweights

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.

Best Answer

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.