Trying to apply a general exponential fit to data

11 views (last 30 days)
Hello
I am using CFtool for fitting an exponential curve to a set of data. However, whenever I try to use the coefficients (A,B,C,D) and apply them back to my data using the biexponential general model (f(x) = a*exp(b*x) + c*exp(d*x) ) the resultant curve is nothing like the results shown in cftool
Here is my data and the resulting coefficients:
X = 0.301 2.301 4.301 6.301 8.301 10.301 12.301 14.301 16.301 18.301
Y = 918.8 448.3 192.9 132.3 93.7 211.3 290.3 257.2 80.8 154.3
General model Exp2:
f(x) = a*exp(b*x) + c*exp(d*x)
where x is normalized by mean 9.301 and std 6.055
Coefficients (with 95% confidence bounds):
a = 5.095 (-22.48, 32.67)
b = -3.391 (-6.88, 0.09925)
c = 160.8 (32.15, 289.4)
d = 0.08843 (-0.7854, 0.9622)
I would greatly appreciate your help.
Best,
Alonso Figueroa

Accepted Answer

Torsten
Torsten on 24 May 2023
Edited: Torsten on 24 May 2023
As written in the output from CFtool: x is normalized by mean 9.301 and std 6.055.
Thus, for x in the equation, you have to insert (x-mean(x))/std(x) to get the expected curve.
X = [0.301 2.301 4.301 6.301 8.301 10.301 12.301 14.301 16.301 18.301].';
Y = [918.8 448.3 192.9 132.3 93.7 211.3 290.3 257.2 80.8 154.3].';
f = fit(X,Y,'exp2','Normalize','on')
f =
General model Exp2: f(x) = a*exp(b*x) + c*exp(d*x) where x is normalized by mean 9.301 and std 6.055 Coefficients (with 95% confidence bounds): a = 5.09 (-22.46, 32.64) b = -3.391 (-6.882, 0.09921) c = 160.7 (32.16, 289.3) d = 0.08831 (-0.7855, 0.9621)
X_normalized = (X-mean(X))/std(X);
Y_model = f.a*exp(f.b*X_normalized)+f.c*exp(f.d*X_normalized);
hold on
plot(X,Y,'o')
plot(X,Y_model)
hold off
  1 Comment
Luis FigueroaFernandez
Luis FigueroaFernandez on 24 May 2023
Thank you So much Thorsten, I thought I was going insane over here.
Best,
Alonso Figueroa

Sign in to comment.

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!