summaryrefslogtreecommitdiff
path: root/calModelPara.sci
diff options
context:
space:
mode:
authorttt2018-07-09 16:54:44 +0530
committerttt2018-07-09 16:54:44 +0530
commite5e316e1958e27696d7670e2492992d34ff38b68 (patch)
tree8dab5cc24e31921cfb3c44444d48cfbfd3ff76f8 /calModelPara.sci
parent681c88404f9f2861d228d0d0c3bd61b200ca1442 (diff)
downloadFOSSEE-System-Identification-Toolbox-e5e316e1958e27696d7670e2492992d34ff38b68.tar.gz
FOSSEE-System-Identification-Toolbox-e5e316e1958e27696d7670e2492992d34ff38b68.tar.bz2
FOSSEE-System-Identification-Toolbox-e5e316e1958e27696d7670e2492992d34ff38b68.zip
added scilabs files
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