www.gusucode.com > econ 案例源码程序 matlab代码 > econ/SpecifyTheInnovationDistributionARIMAExample.m
%% Specify the Innovation Distribution % The property |Distribution| in a model stores the distribution name (and % degrees of freedom for the _t_ distribution). The data type of % |Distribution| is a |struct| array. For a Gaussian innovation % distribution, the data structure has only one field: |Name|. For a % Student's _t_ distribution, the data structure must have two fields: % % * |Name|, with value |'t'| % * |DoF|, with a scalar value larger than two (|NaN| is the default % value) %% % If the innovation distribution is Gaussian, you do not need to assign a % value to |Distribution|. |arima| creates the required data structure. %% % To illustrate, consider specifying an MA(2) model with an iid Gaussian % innovation process: % Copyright 2015 The MathWorks, Inc. Mdl = arima(0,0,2) %% % The model output shows that |Distribution| is a |struct| array with one % field, |Name|, with the value |'Gaussian'|. %% % When specifying a Student's _t_ innovation distribution, you can specify % the distribution with either unknown or known degrees of freedom. If the % degrees of freedom are unknown, you can simply assign |Distribution| the % value |'t'|. By default, the property |Distribution| has a data structure % with field |Name| equal to |'t'|, and field |DoF| equal to |NaN|. When % you input the model to |estimate|, the degrees of freedom are estimated % along with any other unknown model parameters. %% % For example, specify an MA(2) model with an iid Student's % _t_ innovation distribution, with unknown degrees of freedom: Mdl = arima('MALags',1:2,'Distribution','t') %% % The output shows that |Distribution| is a data structure with two fields. % Field |Name| has the value |'t'|, and field |DoF| has the value |NaN|. %% % If the degrees of freedom are known, and you want to set an equality % constraint, assign a |struct| array to |Distribution| with fields |Name| % and |DoF|. In this case, if the model is input to |estimate|, the degrees % of freedom won't be estimated (the equality constraint is upheld). %% % Specify an MA(2) model with an iid Student's _t_ innovation process with % eight degrees of freedom: Mdl = arima('MALags',1:2,'Distribution',struct('Name','t','DoF',8)) %% % The output shows the specified innovation distribution.