📄 selmo.m
字号:
function [FPE,AIC,BIC,SBC,MDL,CAT,PHI,optFPE,optAIC,optBIC,optSBC,optMDL,optCAT,optPHI]=selmo(E,N);
% SELECTION OF THE MODEL ORDER OF A TIME SERIES
% [FPE,AIC,BIC,SBC,MDL,CAT,PHI,optFPE,optAIC,optBIC,optSBC,optMDL,optCAT,optPHI]=selmo(E,N);
%
% E Error function E(p)
% N maximal order (optional)
% show optional; if given the parameters are shown
%
% FPE Final Prediction Error (Kay 1987 -> Akaike 1969)
% AIC Akaike Information Criterion (Marple 1987 -> Akaike 1974)
% BIC Bayesian Akaike Information Criterion (Wei 1994 -> Akaike 1978,1979)
% CAT Parzen's CAT Criterion (Wei 1994 -> Parzen 1974)
% MDL Minimal Description length Criterion (Marple 1987 -> Rissanen 1978,83)
% SBC Schwartz's Bayesian Criterion (Wei 1994; Schwartz 1978)
% PHI Phi criterion (Pukkila et al. 1988)
% optFPE order where FPE is minimal
% optAIC order where AIC is minimal
% optBIC order where BIC is minimal
% optSBC order where SBC is minimal
% optMDL order where MDL is minimal
% optCAT order where CAT is minimal
% optPHI order where PHI is minimal
% Version 2.40
% last revision 27.04.1998
% Copyright (c) 1997-1998 by Alois Schloegl
% e-mail: a.schloegl@ieee.org
% This library is free software; you can redistribute it and/or
% modify it under the terms of the GNU Library General Public
% License as published by the Free Software Foundation; either
% Version 2 of the License, or (at your option) any later version.
%
% This library is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
% Library General Public License for more details.
%
% You should have received a copy of the GNU Library General Public
% License along with this library; if not, write to the
% Free Software Foundation, Inc., 59 Temple Place - Suite 330,
% Boston, MA 02111-1307, USA.
if nargin<2 Pmax=min([100 N/3]); end;
[lr,lc]=size(E);
if lr>1 & lc>1
E=mean(E);
end;
M=lc-1;
m=0:M;
FPE=E.*(N+m)./(N-m); %OK
optFPE=find(FPE==min(FPE))-1; %optimal order
AIC=N*log(E)+2*m; %OK
optAIC=find(AIC==min(AIC))-1; %optimal order
AIC4=N*log(E)+4*m; %OK
optAIC4=find(AIC4==min(AIC4))-1; %optimal order
m=1:M;
BIC=[ N*log(E(1)) N*log(E(m+1))-(N-m).*log(1-m/N)+m*log(N)+m*log((E(1)./E(m+1)-1)/m)];
optBIC=find(BIC==min(BIC))-1; %optimal order
m=0:M;
SBC=N*log(E)+m*log(N);
optSBC=find(SBC==min(SBC))-1; %optimal order
MDL=N*log(E)+log(N)*m;
optMDL=find(MDL==min(MDL))-1; %optimal order
m=0:M;
%CAT= (cumsum(1./E(m+1))/N-1./E(m+1));
E1=N*E./(N-m);
CAT= (cumsum(1./E1(m+1))/N-1./E1(m+1));
optCAT=find(CAT==min(CAT))-1; %optimal order
PHI=N*log(E)+2*log(log(N))*m;
optPHI=find(PHI==min(PHI))-1; %optimal order
p=([optFPE optAIC optBIC optSBC optCAT optMDL optPHI]);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -