I'd like to do a weighted least squares regression using the "robustfit" command, but I want to create my own variable of weights and not use one of the set weighting functions. Is this possible?
Thanks in advance, Janis
Best Answer
If you want to specify the weights yourself, I recommend using glmfit or LinearModel instead of robustfit.
In the first iteration fit your data with given method you want. Then calclaute weights by reciprocating residue and save that weights in workspace, the more the residue the less will be weights. In next iteration that weights will help you to get good fit.
Best Answer