Fitting a discontinuous function?
ompf
Mon, 06/09/2008 - 12:26 pm
Is there a way to fit a discontinuous function using Igor? More specifically, I have some kinetic data that demonstrates a lag time, L, which is followed by an exponential growth. The function would be y(x) = 0, if x < L and y(x) = y0 + A*exp(-kt), if x > L.
wave w
variable x
//w[0]=L
//w[1] = y0
//w[2] = A
//w[3] = k
if(x<w[0])
return 0
else
return w[1]+w[2]*exp(-w[3]*x)
endif
End
June 10, 2008 at 02:00 am - Permalink
June 10, 2008 at 07:05 am - Permalink
I might add that if w[0] is unknown, and you want to fit it, you will need to create an epsilon wave and set the value of epsilon[0] to something larger than the X spacing of the data. An epsilon wave sets the differencing interval used in computing numeric derivatives of chi-square with respect to the data. If a derivative is zero, it causes a singular matrix error. If the differencing interval for L is less than a single data point, then there will be no change in chi-square.
Chances are you can set L simply by inspecting the data set. Then you can hold it. That will make the fit much more trouble-free.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
June 10, 2008 at 02:48 pm - Permalink
June 11, 2008 at 01:30 am - Permalink