fitting a negative exponential function to a profile
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
dpb
il 21 Set 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.
Risposte (2)
dpb
il 20 Set 2016
Modificato: dpb
il 22 Set 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.
0 Commenti
Star Strider
il 21 Set 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.)
0 Commenti
Vedere anche
Categorie
Scopri di più su Descriptive Statistics in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
