Thread Subject: Double exponential decay fit

Subject: Double exponential decay fit

From: Jean-Sebastien

Date: 14 Jan, 2009 17:39:01

Message: 1 of 7

Hi folks,
OK :
You have a set of data points (time,response) which correspond to a simple two exponential decay function (peak to baseline).
You feed sigmaplot10 with it and using the simple equation y=a*exp(-bx)+c*exp(-dx) it gives you a nice fit.
Now you do it in Matlab using the same data, same equation and on 2 out of 3 fit you've got a funny fit which obviously is wrong...
Question:
Does anyone can explain the decrepancy between the two softwares? why sigmaplot10 can fit a simple two exponential decay function while Matlab doesn't?
Is there any issue with the method used? If so is there an alternative to make Matlab fit this simple two eponential decay function correctly?
Thanks for your help,
JS

Subject: Double exponential decay fit

From: Aaron Callard

Date: 14 Jan, 2009 18:10:04

Message: 2 of 7

"Jean-Sebastien" <newsreader@mathworks.com> wrote in message <gkl7vl$nb0$1@fred.mathworks.com>...
> Hi folks,
> OK :
> You have a set of data points (time,response) which correspond to a simple two exponential decay function (peak to baseline).
> You feed sigmaplot10 with it and using the simple equation y=a*exp(-bx)+c*exp(-dx) it gives you a nice fit.
> Now you do it in Matlab using the same data, same equation and on 2 out of 3 fit you've got a funny fit which obviously is wrong...
> Question:
> Does anyone can explain the decrepancy between the two softwares? why sigmaplot10 can fit a simple two exponential decay function while Matlab doesn't?
> Is there any issue with the method used? If so is there an alternative to make Matlab fit this simple two eponential decay function correctly?
> Thanks for your help,
> JS
>

um it's hard to answer your question as you have not really given much information. It's like me asking why C++ can give me answer but pearl can't. Matlab is a programing language. What algorithm are you using to fit the points, in matlab. What is sigmaplot10?

My guess is that the algorithm you are using in matlab is messed up slightly. You shouldn't blame the language for code written in it.

Aaron

Subject: Double exponential decay fit

From: Jean-Sebastien

Date: 14 Jan, 2009 18:55:03

Message: 3 of 7

Hi Aaron,

Thanks for your reply. Yes I realized that there isn't too much of info in my first post but thanks to have reply anyway. I have made a bit of research and found that sigmaplot (analysis software) is using the Marquardt-Levenberg algorithm to find the
coefficients (parameters) of the independent variable(s) that give the “best fit”
between the equation and the data. (Shrager, R.I. (1970). Regression with Linear Constraints: An Extension of the Magnified Diagonal Method. Journal of the Association for Computing Machinery, 17, 446-452.).

So now my question is how do I found out which algorithm Matlab is using? And how can I adapt it so it would use this algorithm?

Many thanks,
Jean-Seb


"Aaron Callard" <no.thanks@hotmail.com> wrote in message <gkl9ps$rd2$1@fred.mathworks.com>...
> "Jean-Sebastien" <newsreader@mathworks.com> wrote in message <gkl7vl$nb0$1@fred.mathworks.com>...
> > Hi folks,
> > OK :
> > You have a set of data points (time,response) which correspond to a simple two exponential decay function (peak to baseline).
> > You feed sigmaplot10 with it and using the simple equation y=a*exp(-bx)+c*exp(-dx) it gives you a nice fit.
> > Now you do it in Matlab using the same data, same equation and on 2 out of 3 fit you've got a funny fit which obviously is wrong...
> > Question:
> > Does anyone can explain the decrepancy between the two softwares? why sigmaplot10 can fit a simple two exponential decay function while Matlab doesn't?
> > Is there any issue with the method used? If so is there an alternative to make Matlab fit this simple two eponential decay function correctly?
> > Thanks for your help,
> > JS
> >
>
> um it's hard to answer your question as you have not really given much information. It's like me asking why C++ can give me answer but pearl can't. Matlab is a programing language. What algorithm are you using to fit the points, in matlab. What is sigmaplot10?
>
> My guess is that the algorithm you are using in matlab is messed up slightly. You shouldn't blame the language for code written in it.
>
> Aaron

Subject: Double exponential decay fit

From: Per Sundqvist

Date: 14 Jan, 2009 20:29:02

Message: 4 of 7

"Jean-Sebastien" <newsreader@mathworks.com> wrote in message <gklce7$nl7$1@fred.mathworks.com>...
> Hi Aaron,
>
> Thanks for your reply. Yes I realized that there isn't too much of info in my first post but thanks to have reply anyway. I have made a bit of research and found that sigmaplot (analysis software) is using the Marquardt-Levenberg algorithm to find the
> coefficients (parameters) of the independent variable(s) that give the “best fit”
> between the equation and the data. (Shrager, R.I. (1970). Regression with Linear Constraints: An Extension of the Magnified Diagonal Method. Journal of the Association for Computing Machinery, 17, 446-452.).
>
> So now my question is how do I found out which algorithm Matlab is using? And how can I adapt it so it would use this algorithm?
>
> Many thanks,
> Jean-Seb
>
>
> "Aaron Callard" <no.thanks@hotmail.com> wrote in message <gkl9ps$rd2$1@fred.mathworks.com>...
> > "Jean-Sebastien" <newsreader@mathworks.com> wrote in message <gkl7vl$nb0$1@fred.mathworks.com>...
> > > Hi folks,
> > > OK :
> > > You have a set of data points (time,response) which correspond to a simple two exponential decay function (peak to baseline).
> > > You feed sigmaplot10 with it and using the simple equation y=a*exp(-bx)+c*exp(-dx) it gives you a nice fit.
> > > Now you do it in Matlab using the same data, same equation and on 2 out of 3 fit you've got a funny fit which obviously is wrong...
> > > Question:
> > > Does anyone can explain the decrepancy between the two softwares? why sigmaplot10 can fit a simple two exponential decay function while Matlab doesn't?
> > > Is there any issue with the method used? If so is there an alternative to make Matlab fit this simple two eponential decay function correctly?
> > > Thanks for your help,
> > > JS
> > >
> >
> > um it's hard to answer your question as you have not really given much information. It's like me asking why C++ can give me answer but pearl can't. Matlab is a programing language. What algorithm are you using to fit the points, in matlab. What is sigmaplot10?
> >
> > My guess is that the algorithm you are using in matlab is messed up slightly. You shouldn't blame the language for code written in it.
> >
> > Aaron

Hi, I think my function exp2fit could do it very well:

http://www.mathworks.com/matlabcentral/fileexchange/21959

,but sometimes with rough data you need optimization toolbox to access lsqcurvefit (which is optionally post-used in my function). If you have your own "lsqcurvefit" (look at file exchange) maby it will do it equally well?

Also, sum of two exponentials have a lot of functional freedom to be oscillating, or decaying, when the coefficients are complex. If there is "swings" (with additionally large noise) in your data it may fit it to a damped harmonic oscillating function.

/Per

Subject: Double exponential decay fit

From: Jean-Sebastien

Date: 14 Jan, 2009 22:13:02

Message: 5 of 7

OK,
Sigmaplot is using the Marquardt-Levenberg algorithm to find the
coefficients (parameters) of the independent variable(s) that give the “best fit”
between the equation and the data. Interestingly, you can choose the same algorithm in curve fitting tool box under fit option. However, chossing this option still does not give me the same result. It's look like sigmaplot get that the signal decaying converge to zero while Matlab doesn't. There must be a way to set this parameter but I can't see it in the Fit options window... And I pretty much try everything in that window...
Please, HELP!!
Thanks,
Jean-Seb

Subject: Double exponential decay fit

From: Thomas

Date: 18 Feb, 2009 04:21:01

Message: 6 of 7

Hi,

I was wondering if you have figured out a way of doing a double exponential equation fit in matlab

Thanks

"Jean-Sebastien" <newsreader@mathworks.com> wrote in message <gkl7vl$nb0$1@fred.mathworks.com>...
> Hi folks,
> OK :
> You have a set of data points (time,response) which correspond to a simple two exponential decay function (peak to baseline).
> You feed sigmaplot10 with it and using the simple equation y=a*exp(-bx)+c*exp(-dx) it gives you a nice fit.
> Now you do it in Matlab using the same data, same equation and on 2 out of 3 fit you've got a funny fit which obviously is wrong...
> Question:
> Does anyone can explain the decrepancy between the two softwares? why sigmaplot10 can fit a simple two exponential decay function while Matlab doesn't?
> Is there any issue with the method used? If so is there an alternative to make Matlab fit this simple two eponential decay function correctly?
> Thanks for your help,
> JS
>

Subject: Double exponential decay fit

From: William Murphy

Date: 8 Apr, 2010 21:28:07

Message: 7 of 7

Jean Sebastian,
Interesting that you are investigating this problem. I have a similar problem for the decay of energy in the revereberation of a room. I have just implemented a function that should provide the dual exponential decay and a background noise level. I conduct quite a lot of work in both SigmaPlot and Matlab. Maybe I can provide some insight

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
exponential decay Jean-Sebastien 14 Jan, 2009 17:15:09
regression with... Jean-Sebastien 14 Jan, 2009 13:55:10
marquardtlevenb... Jean-Sebastien 14 Jan, 2009 13:55:10
2 exponential fit Jean-Sebastien 14 Jan, 2009 12:40:31
fit Jean-Sebastien 14 Jan, 2009 12:40:31
two exponential... Jean-Sebastien 14 Jan, 2009 12:40:31
rssFeed for this Thread

Contact us at files@mathworks.com