1 function X = selmo2(y,Pmax);
2 % SELMO2 - model order selection for univariate and multivariate
3 % autoregressive models
8 % Pmax maximum model order
9 % X.A, X.B, X.C parameters of AR model
10 % X.OPT... various optimization criteria
12 % see also: SELMO, MVAR,
14 % $Id: selmo2.m 5090 2008-06-05 08:12:04Z schloegl $
15 % Copyright (C) 2007 by Alois Schloegl <a.schloegl@ieee.org>
16 % This is part of the TSA-toolbox. See also
17 % http://hci.tugraz.at/schloegl/matlab/tsa/
18 % http://octave.sourceforge.net/
19 % http://biosig.sourceforge.net/
21 % This program is free software: you can redistribute it and/or modify
22 % it under the terms of the GNU General Public License as published by
23 % the Free Software Foundation, either version 3 of the License, or
24 % (at your option) any later version.
26 % This program is distributed in the hope that it will be useful,
27 % but WITHOUT ANY WARRANTY; without even the implied warranty of
28 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 % GNU General Public License for more details.
31 % You should have received a copy of the GNU General Public License
32 % along with this program. If not, see <http://www.gnu.org/licenses/>.
42 [AutoCov, AutoCorr, ARPMX, E, NC] = invest0(y,Pmax);
43 [FPE,AIC,BIC,SBC,MDL,CATcrit,PHI,optFPE,optAIC,optBIC,optSBC,optMDL,optCAT,optPHI,s,C] = selmo(E,NC);
47 [AR,RC,PE] = mvar(y',Pmax);
48 E2 = repmat(NaN,1,Pmax);
53 %%%% FIX ME %%%%% this does not seem right because it depends on the scaling of y
54 AIC_MV(k+1) = 2*log(det(S))+2*k*M*M/N; % Ding et al. 2000 refering to Akaike 1974
77 [tmp,X.OPT.MVAIC] = min(AIC_MV);