Curve fit equation calculation
1 view (last 30 days)
Show older comments
Hi, i have a data set and i want to find the best equation can describe the data trend. Cftool need an equation to calculate the fit but i don't know which equation describe better my data; there is a tool or script that can ound the best equation.
Thanks
6 Comments
Mathieu NOE
on 9 Feb 2021
there is an interesting post about waht "automatic" curve fitting exist (according to each personnal definition)
I don't have the Curve Fitting Tbx so I stick with basic methods , but maybe you have more ressources than I
otherwise , you can always fit a polynomial of sufficientlty high order to any data
load('workspace2.mat')
% polynomial fit method
p = polyfit(Time_2,Log_storage_2,25);
% Evaluate the fitted polynomial p and plot:
f = polyval(p,Time_2);
figure(2),plot(Time_2,Log_storage_2,'b',Time_2,f,'r')
legend('data','poly fit')
Alex Sha
on 10 Feb 2021
Hi, Isac, for time_1 series, one point is miss written? "36.5468 -2.72657737722164" should be "36.5468 -0.72657737722164", if so, refer to the result below:
y=A2+(A1-A2)/(1+exp((x-x0)/dx))+p1*exp(x*p2+p3/x)+p4*x;
Root of Mean Square Error (RMSE): 0.0199485805235078
Sum of Squared Residual: 0.0656610677089744
Correlation Coef. (R): 0.999763315428711
R-Square: 0.999526686877008
Parameter Best Estimate
---------- -------------
a2 -0.94962007323826
a1 0.0535110752630396
x0 337.617289679719
dx -39.219494340785
p1 -1.70924446590519
p2 0.0011217021565316
p3 -218.35619640782
p4 0.0059970024350561
Answers (0)
See Also
Categories
Find more on Linear and Nonlinear Regression in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!