%% Specify Innovation Distribution
% regARIMA stores the distribution (and degrees of freedom for the t distribution) in the Distribution property. The data type of Distribution is a struct array with potentially two fields: Name and DoF.
% If the innovations are Gaussian, then the Name field is Gaussian, and there is no DoF field. regARIMA sets Distribution to Gaussian by default.
% If the innovations are t-distributed, then the Name field is t and the DoF field is NaN by default, or you can specify a scalar that is greater than 2.
% To illustrate specifying the distribution, consider this regression model with AR(2) errors:
% \begin{array}{rcl}y_t &=& c+X_t\beta+u_t \\
% u_t &=& \alpha_1 u_{t-1}+\alpha_2 u_{t-2}+\varepsilon_t\end{array}

Mdl = regARIMA(2,0,0);
Mdl.Distribution

% By default, Distribution property of Mdl is a struct array with the field Name having the value Gaussian.
% If you want to specify a t innovation distribution, then you can either specify the model using the name-value pair argument 'Distribution','t', or use dot notation to modify an existing model.
%
% Specify the model using the name-value pair argument.

Mdl = regARIMA('ARLags',1:2,'Distribution','t');
Mdl.Distribution

% If you use the name-value pair argument to specify the t innovation distribution, then the default degrees of freedom is NaN.
%
% You can use dot notation to yield the same result.

Mdl = regARIMA(2,0,0);
Mdl.Distribution = 't'

%
% If the innovation distribution is t_{10}, then you can use dot notation to modify the Distribution property of the existing model Mdl. You cannot modify the fields of Distribution using dot notation, e.g., Mdl.Distribution.DoF = 10 is not a value assignment. However, you can display the value of the fields using dot notation.

Mdl.Distribution = struct('Name','t','DoF',10)
tDistributionDoF = Mdl.Distribution.DoF

% Since the DoF field is not a NaN, it is an equality constraint when you estimate Mdl using estimate.
%
% Alternatively, you can specify the t_{10} innovation distribution using the name-value pair argument.

Mdl = regARIMA('ARLags',1:2,'Intercept',0,...
    'Distribution',struct('Name','t','DoF',10))

% Copyright 2015 The MathWorks, Inc.