Unrealistic fitting confidence levels in noisy data
Show older comments
The fitting of simple exponential is giving a confidence level which is not realistic providing how noisy are the data. Any explanation please ?
Thank you. Code:
Data = xlsread('data_test.xlsx','Sheet1','A1:B3990');
Time = Data(:,1) - 2.6E-6 ; % time offset
Signal = Data(:,2)-0.078; % amplitude offset
x = Time;
y = Signal;
y = y/(0.8*max(y)); % data normalization to about 1
format long % just to get more precision digits
mdl = fittype(' a*(1-exp(-b*x)) ','indep','x')
fittedmdl = fit(x,y,mdl,'StartPoint', [max(y) 1E5])
figure
plot(x,y, 'bp', 'DisplayName','data')
hold on
plot(fittedmdl)
grid
xlabel('Time /s')
ylabel('Intensity /a.u')
ax = gca;
ax.FontSize = 15;
As you can see the error on (b) is very small (only 3% !) which is not realistic looking how noisy are the data:
coefficientValues = coeffvalues(fittedmdl);
a = coefficientValues(1);
b = coefficientValues(2);
Tau = (1/b)
ConfIntervals = confint(fittedmdl);
b_err = (ConfIntervals(2,2) - ConfIntervals(1,2))/2;
DeltaTau = Tau * (b_err/b)
Error = (DeltaTau / Tau)*100
Accepted Answer
More Answers (0)
Categories
Find more on Calendar in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!