MATLAB Examples

# Regression Model with AR Errors and t Innovations

This example shows how to set the innovation distribution of a regression model with AR errors to a distribution.

Specify the regression model with AR(4) errors:

where has a distribution with the default degrees of freedom and unit variance.

Mdl = regARIMA('AR',{0.2,0.1},'ARLags',[1,4],... 'Intercept',0,'Beta',[-2;0.5],'Variance',1,... 'Distribution','t') 
Mdl = regARIMA with properties: Description: "Regression with ARMA(4,0) Error Model (t Distribution)" Distribution: Name = "t", DoF = NaN Intercept: 0 Beta: [-2 0.5] P: 4 Q: 0 AR: {0.2 0.1} at lags [1 4] SAR: {} MA: {} SMA: {} Variance: 1 

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 distribution.

Mdl.Distribution = struct('Name','t','DoF',10) 
Mdl = regARIMA with properties: Description: "Regression with ARMA(4,0) Error Model (t Distribution)" Distribution: Name = "t", DoF = 10 Intercept: 0 Beta: [-2 0.5] P: 4 Q: 0 AR: {0.2 0.1} at lags [1 4] SAR: {} MA: {} SMA: {} Variance: 1 

You can simulate or forecast responses using simulate or forecast because Mdl is completely specified.

In applications, such as simulation, the software normalizes the random innovations. In other words, Variance overrides the theoretical variance of the random variable (which is DoF/(DoF - 2)), but preserves the kurtosis of the distribution.