Recreating Weighted linear regression
Hello,
I am using the curve fitting algorithm (line) to fit (x,y) points of data. I have estimated uncertainty associated with the Y wave that I put into a "weight wave" and the weight wave is 0.01*ydata (ie, 1% uncertainty). I curve fit the ydata vs xdata and include this weighting wave in the dialog and I get a fit that I like.
My issue is that I would like to recreate this fit without the weighting option so that I can do it in other code environments, or in Excel. All my linear regression texts say that I should multiply the ydata and xdata by some function of the weight (either weight itself, sqrt(weight), (weight)^2 etc depending on how weight is defined) to get a new set of x and y that will yield the same fitting parameters. However every combination that I try doesn't work.
For reference.
http://www.real-statistics.com/multiple-regression/weighted-linear-regr…
I figured it out. Not only do I have to multiply xdata by 1/(weight^2) but also the column of "ones" in the X-matrix. Thanks!
July 25, 2018 at 12:29 pm - Permalink
Your link takes us to a description of weighted fitting. If Excel doesn't have a way to do weighted fitting, that proves that you should not be using Excel.
July 25, 2018 at 12:31 pm - Permalink
In reply to I figured it out. Not only… by psingh8
This arrived while I was writing my response. It sounds like you are trying to do weighted curve fitting without using Igor's curve fitting. Is that right?
July 25, 2018 at 12:32 pm - Permalink