fitting a negative exponential function to a profile

8 visualizaciones (últimos 30 días)
ILARIA DI PIETRO
ILARIA DI PIETRO el 20 de Sept. de 2016
Editada: dpb el 22 de Sept. de 2016
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 comentarios
ILARIA DI PIETRO
ILARIA DI PIETRO el 21 de Sept. de 2016
Editada: ILARIA DI PIETRO el 21 de Sept. de 2016
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 el 21 de Sept. de 2016
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.

Iniciar sesión para comentar.

Respuestas (2)

dpb
dpb el 20 de Sept. de 2016
Editada: dpb el 22 de Sept. de 2016
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 el 21 de Sept. de 2016
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.)

Categorías

Más información sobre Descriptive Statistics en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by