summaryrefslogtreecommitdiff
path: root/calModelPara.sci
diff options
context:
space:
mode:
Diffstat (limited to 'calModelPara.sci')
-rw-r--r--calModelPara.sci16
1 files changed, 16 insertions, 0 deletions
diff --git a/calModelPara.sci b/calModelPara.sci
new file mode 100644
index 0000000..e8fbc02
--- /dev/null
+++ b/calModelPara.sci
@@ -0,0 +1,16 @@
+function varargout = calModelPara(varargin)
+ y = varargin(1)+varargin(2)
+ N = size(y,'r')
+ ek = varargin(2)
+ np = varargin(3)
+ //pause
+ mse = sum(ek.^2)/N;//disp(mse)
+ fpe = mse * (1 + np/N)/(1 - np/N);//disp(fpe)
+ nrmse = 1 - sqrt(sum(ek^2))/sqrt(sum((y - mean(y))^2));//disp(nrmse)
+ AIC = N * log(mse) + 2 * np + N * size(y,'c') * (log(2 * %pi) + 1);//disp(AIC)
+ AICc = AIC * 2 * np * (np + 1)/(N - np - 1);//disp(AICc)
+ nAIC = log(mse) + 2 * np/N;//disp(nAIC)
+ BIC = N * log(mse) + N * size(y,'c') * (log(2 * %pi) + 1) + np * log(N);//disp(BIC)
+ //pause
+ varargout(1) = struct('MSE',mse,'FPE',fpe,'FitPer',nrmse*100,'AIC',AIC,'AICc',AICc,'nAIC',nAIC,'BIC',BIC)
+endfunction