How do I find the degrees of freedom of a cubic spline fit to calculate AIC and BIC
CP_data=CP_Filt; % Cuff Pressure values
CPowe=CP_data(maxindex); % peak to peak of oscillometric waves
% Fit cubic spline
h=median(diff(CPowe)) % h=average distance between CP points in mmHg approx 2-2.5;
p = 1/(1 + h^3/0.6) % Satisfactory smoothing for evenly spaced data
[CPvalues]=csaps(CPowe,CPOWE,p);
CP_cs = linspace(min(CPowe),max(CPowe),length(CPowe)*5); % Interpolate at data points
CPY_cs = ppval(CPvalues,CP_cs); % yfit data matching ydata = CPowe
Question. in calculating RMSE, AdjR2, AIC and BIC i need degrees of freedom DFE
DFE=n-k; : where n=length(ydata).
How do I find k?CP_data=CP_Filt; % Cuff Pressure values
CPowe=CP_data(maxindex); % peak to peak of oscillometric waves
% Fit cubic spline
h=median(diff(CPowe)) % h=average distance between CP points in mmHg approx 2-2.5;
p = 1/(1 + h^3/0.6) % Satisfactory smoothing for evenly spaced data
[CPvalues]=csaps(CPowe,CPOWE,p);
CP_cs = linspace(min(CPowe),max(CPowe),length(CPowe)*5); % Interpolate at data points
CPY_cs = ppval(CPvalues,CP_cs); % yfit data matching ydata = CPowe
Question. in calculating RMSE, AdjR2, AIC and BIC i need degrees of freedom DFE
DFE=n-k; : where n=length(ydata).
How do I find k? CP_data=CP_Filt; % Cuff Pressure values
CPowe=CP_data(maxindex); % peak to peak of oscillometric waves
% Fit cubic spline
h=median(diff(CPowe)) % h=average distance between CP points in mmHg approx 2-2.5;
p = 1/(1 + h^3/0.6) % Satisfactory smoothing for evenly spaced data
[CPvalues]=csaps(CPowe,CPOWE,p);
CP_cs = linspace(min(CPowe),max(CPowe),length(CPowe)*5); % Interpolate at data points
CPY_cs = ppval(CPvalues,CP_cs); % yfit data matching ydata = CPowe
Question. in calculating RMSE, AdjR2, AIC and BIC i need degrees of freedom DFE
DFE=n-k; : where n=length(ydata).
How do I find k? cubic spline quality of fit measures, degrees of freedom MATLAB Answers — New Questions









