fitting a negative exponential function to a profile

조회 수: 8 (최근 30일)
ILARIA DI PIETRO
ILARIA DI PIETRO 2016년 9월 20일
편집: dpb 2016년 9월 22일
Hello everybody,
I need to fit my profile (discrete points) with this equation. I'm not able to customize it. does anyone know how to write it properly?
thanks
  댓글 수: 4
ILARIA DI PIETRO
ILARIA DI PIETRO 2016년 9월 21일
편집: ILARIA DI PIETRO 2016년 9월 21일
I have topographic profiles and I have to estimate their concavity. in order to do this, first, I have to fit my profile (discrete points) with function z to get a continuous line and then I have to find B. Z∞ is zt in this figure. </matlabcentral/answers/uploaded_files/59700/FIGURE.png>
dpb
dpb 2016년 9월 21일
The above functional form won't produce the shapes of the reference figure above--in particular note that if B=0 you get a constant independent of x:
z=zinf + (za-zinf)exp(Bx)
=zinf + (za-zinf)exp(0)
=zinf + (za-zinf)
=za
You're missing another term in x somewhere/somehow.

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

답변 (2개)

dpb
dpb 2016년 9월 20일
편집: dpb 2016년 9월 22일
fnz=@(b,x) = b(1) + (b(2)-b(1))*exp(-b(3)*(x-b(4));
b=nlinfit(x,y,fnz,b0);
where you've estimated an initial starting value for the coefficients in b0 first, before calling nlinfit.
b0(1) = y(end); % might be reasonable estimate for it
b0(2) = y(end)-y(1); % probably ok for it...
b0(3) = ??? % you'll have to use your data to estimate these...
b0(4) = ???
ADDENDUM W/ the above figure you've now attached, b(4)-->0 so all you need is a starting value for b0(3); possibly even beginning with 0 would be adequate as it's the only shape-changing coefficient in the expression as written. If that turns out to not work well, simply choose a small, nonnegative value; you can determine the initial sign by the expedient of fitting a quadratic and checking the curvature or fit a straight line and check the preponderance of the residuals in the mid range--if they're positive it'll be convex and vice versa.
However, as I noted above, that doesn't seem to be the proper form as it won't be continuous with B over the range [-,0,+] as it appears the intent is from the graphic as what you've written is degenerate at B=0.

Star Strider
Star Strider 2016년 9월 21일
You need to use a function that allows you to get confidence intervals on the parameters. Both nlinfit and lsqcurvefit can do this. You then need to get the 95% confidence interval (confidence limits) on ‘B’. If they include zero (they will have opposite signs), then you can assume it is straight (neither concave nor convex). If they do not include zero (both the same sign), ‘B’ is significantly different from zero, and your data are either concave or convex depending on its sign.
If you have the Global Optimization Toolbox, I would begin by using the patternsearch function, because it could be difficult to determine an appropriate set of the initial parameter estimates by trial-and-error. Use the parameter estimates returned by patternsearch as your initial parameter estimates for nlinfit or lsqcurvefit to get the parameter estimates on ‘B’. Then use nlparci to get the confidence intervals on the parameters. (You will also get the confidence intervals on all the other parameters, to use if you need them.)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by