Weighting a linear fit with a gaussian
Tue, 11/05/2019 - 09:42 am
I am having trouble finding what I am looking for in a way that can be applied in igor without writing a new fitting program. As the title states, I want to create a modification to the normal curve fitting scheme where the contribution of the leastsquaresfit(LSF) is weighted by the distance from the central point according to a gaussian curve. The reason for doing this is that I am trying to calculate a faux derivative of raw set of data, and am using the elementary definition of a derivative to do so. At its fundamental core, a derivative is just the tangential slope of a point at each point of a curve. My data changes at a fairly smooth rate, so at this point I have made a panel that allows you to include N number of points on either side of the point being investigated, and fits a small line to the subset of points. This works pretty well for very smooth parts of the data. On "sharp" changes in slope, the slope isn't accurately represented. The "goodness of slope" is verified by taking a trapezoidal integral of the derivative and comparing the integral to the original data.
My desire is to weight points closer to the singular point being investigated higher than those farther. I have seen the /w,/I parameters in the curvefit help box, but that wants a wave with standard deviation, or standard error (/w says standard error, while /I says standard deviation. I would like a clarification on which is actually used since those two things are not the same). Is there a way to bridge my desire to have gaussian weighted contributions to an artificially created wave full of standard deviations(errors?) that will mimic the effect that I am seeking?
Hopefully this idea is expressed clearly enough.