%% Print Estimation Results of a Regression Model with ARIMA Errors Fit
% Regress GDP onto CPI using a regression model with ARMA(1,1) errors, and print the results.
% Load the US Macroeconomic data set and preprocess the data.

load Data_USEconModel;
logGDP = log(DataTable.GDP);
dlogGDP = diff(logGDP);
dCPI = diff(DataTable.CPIAUCSL);

%
% Fit the model to the data.

Mdl = regARIMA('ARLags',1,'MALags',1);
[EstMdl,EstParamCov] = estimate(Mdl,dlogGDP,'X',...
   dCPI,'Display','off');

%
% Print the estimates.

print(EstMdl,EstParamCov)

% Copyright 2015 The MathWorks, Inc.