Double exponential fits, but single curves away from the data- why?

조회 수: 1 (최근 30일)
IJ
IJ 2016년 4월 27일
댓글: dpb 2016년 5월 2일
When I try single exponential fit (red line in attached pic) to my data (the part in blue on the attached graph), it seems to curve way from the values, and clearly does not fit. I used:
f=fit(newx(10000:11000), yy2(10000:11000), 'a*exp(-(1/b)*x)');
plot(f, newx(10000:11000), yy2(10000:11000))
I tried to filter and smooth the signal down to a single line, and I also tried cftool. When I use double exponential, it works, but for my calculations, I need a single exponential fit to get the b-coeff. Is there any reason why single exponential just does not work with this trace?
-----edit
I attached the whole trace, and I want to fit to points 10000:10500
  댓글 수: 1
dpb
dpb 2016년 4월 27일
Because the data aren't exponential, maybe, would be the firstmost that comes to mind.
Need to attach a dataset if expect somebody to try to do anything other than look at a picture.

댓글을 달려면 로그인하십시오.

채택된 답변

J. Webster
J. Webster 2016년 4월 27일
편집: J. Webster 2016년 4월 28일
very steep power laws can be notoriously difficult to fit, since small changes in x lead to big changes in y, it makes it hard on the fitting algorithms.
A trick you might try is (in your case) take the natural log of the data and then fit it to the natural log of your fit equation...
ln(a e^(-(1/b)*x)) = ln(a) - x/b;
so that now your fit problem has been reduced to a linear fit y = Mx+B, with M=-1/b and B = ln(a).
Also remember in matlab that the function for ln is log() which drives me crazy.
  댓글 수: 9
IJ
IJ 2016년 4월 29일
Thanks for pinpointing where the problem was, dpb and J. Webster. Now I can start looking for alternative approaches.
IJ
dpb
dpb 2016년 5월 2일
Who knows, maybe there's a Nobel prize hidden in the extra curvature waiting to be discovered... :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by