www.gusucode.com > econ 案例源码程序 matlab代码 > econ/RegressionModelwithSARIMAErrorsandtInnovationsExample.m
%% Regression Model with SARIMA Errors and t Innovations % This example shows how to set the innovation distribution of a regression % model with SARIMA errors to a _t_ distribution. % Copyright 2015 The MathWorks, Inc. %% % Specify the regression model with $\rm{SARIMA}(1,1,1)\times(1,1,0)_{12}$ % errors: % % $$\begin{array}{c}{y_t} = {X_t}\beta + {u_t}\\\left( {1 - 0.2L} \right)\left( {1 - L} \right)\left( {1 - 0.25{L^{12}} - 0.1{L^{24}}} \right)\left( {1 - {L^{12}}} \right){u_t} = \left( {1 + 0.15L} \right){\varepsilon _t},\end{array}$$ % % where $\varepsilon_t$ has a _t_ distribution with the default degrees of freedom % and unit variance. Mdl = regARIMA('AR',0.2,'SAR',{0.25, 0.1},'SARLags',[12 24],... 'D',1,'Seasonality',12,'MA',0.15,'Intercept',0,... 'Variance',1,'Distribution','t') %% % The default degrees of freedom is |NaN|. If you don't know the degrees % of freedom, then you can estimate it by passing |Mdl| and the data to % |estimate|. %% % Specify a $t_{10}$ distribution. Mdl.Distribution = struct('Name','t','DoF',10) %% % You can simulate or forecast responses by passing |Mdl| to |simulate| % or |forecast| because |Mdl| is completely specified. %% % In applications, such as simulation, the software normalizes the random % _t_ innovations. In other words, |Variance| overrides the theoretical % variance of the _t_ random variable (which is |DoF|/(|DoF| - 2)), but % preserves the kurtosis of the distribution.