www.gusucode.com > econ 案例源码程序 matlab代码 > econ/NonmodifiablePropertiesGARCHExample.m
%% Nonmodifiable Properties % Not all model properties are modifiable. You cannot change these % properties in an existing model: % % * |P|. This property updates automatically when the lag corresponding to % the largest nonzero GARCH term changes. % * |Q|. This property updates automatically when the lag corresponding to % the largest nonzero ARCH or leverage term changes. %% % Not all name-value pair arguments you can use for model creation are % properties of the created model. Specifically, you can specify the % arguments |GARCHLags| and |ARCHLags| (and |LeverageLags| for EGARCH and % GJR models) during model creation. These are not, however, properties of % |garch|, |egarch|, or |gjr| model. This means you cannot retrieve or % modify them in an existing model. %% % The ARCH, GARCH, and leverage lags update automatically if you add any % elements to (or remove from) the coefficient cell arrays |GARCH|, |ARCH|, % or |Leverage|. %% % For example, specify an EGARCH(1,1) model: % Copyright 2015 The MathWorks, Inc. Mdl = egarch(1,1) %% % The model output shows nonzero GARCH, ARCH, and leverage coefficients at % lag 1. %% % Add a new GARCH coefficient at lag 3: Mdl.GARCH{3} = NaN %% % The nonzero GARCH coefficients at lags 1 and 3 now display in the model % output. However, the cell array assigned to |GARCH| returns three % elements: garchCoefficients = Mdl.GARCH %% % |GARCH| has a zero coefficient at lag 2 to maintain consistency with % traditional MATLAB(R) cell array indexing.