How to calculate confidence intervals of the output curve from smooth function?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I have some data points for which I used the smooth function to obtain a smoother curve. How can I calculate the confidence intervals of this output?
Here is some of my code:
% Data from all patients
data = randn(12,200);
x = [0:size(data,2)-1];
% Number of patients
nPatients = 12;
% Get average data of all patients
aveData = mean(data)'; % Outputs a vector 200x1
% Get smooth
smoothData = smooth(aveData, 0.4, 'rlowess');
% Residuals
residuals = aveData-smoothData;
% Residual error
resError = sum(residuals.^2);
% Get confidence interval of smoothData (?)
This would yield something similar as if I was using:
% Get Polynomial
[p,S] = polyfit(x,smoothData,5);
[y_fit,delta] = polyval(p,x,S);
% Confidence interval
C95min = y_fit-2*delta;
c95max = y_fit+2*delta;
So, how do I calculate this delta of smoothData?
Thank you in advance!
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Preprocessing Data 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!