arimaSS¶
Purpose¶
Estimates ARIMA models using a state space representation, the Kalman filter, and maximum likelihood.
Format¶
-
vOut =
arimaSS(y, p[, d, q, trend, const])¶ Parameters: - y (Nx1 vector) – data.
- p (Scalar) – the autoregressive order.
- d (Scalar) – Optional, the order of differencing. Default = 0.
- q (Scalar) – Optional, the moving average order. Default = 0.
- trend (Scalar) – Optional, an indicator variable to include a trend in the model. Set to 1 to include trend, 0 otherwise. Default = 0.
- const (Scalar) – Optional, an indicator variable to include a constant in the model. Set to 1 to include constant, 0 otherwise. Default = 1.
Returns: vOut (struct) –
An instance of an
arimamtOutstructure containing the following members:amo.aic Scalar, value of the Akaike information criterion. amo.b Kx1 vector, estimated model coefficients. amo.e Nx1 vector, residual from fitted model. amo.ll Scalar, the value of the log likelihood function. amo.sbc Scalar, value of the Schwartz Bayesian criterion. amo.lrs Lx1 vector, the Likelihood Ratio Statistic. amo.vcb KxK matrix, the covariance matrix of estimated model coefficients. amo.mse Scalar, mean sum of squares for errors. amo.sse Scalar, the sum of squares for errors. amo.ssy Scalar, the sum of squares for Y data. amo.rstl an instance of the kalmanResult structure. amo.tsmtDesc An instance of the
tsmtModelDescstructure containing the following members:tsmtDesc.depvar Kx1 string array, names of endogenous variables. tsmtDesc.indvars Mx1 string array, names of exogenous variables. tsmtDesc.timespan 2x1 string array, range of the time series. Available if date vector is passed as part of a dataframe input. tsmtDesc.ncases Scalar, number of observations. tsmtDesc.df Scalar, degrees of freedom. tsmtDesc.model_name String, model name. amo.sumStats An instance of the
tsmtSummaryStatsstructure containing the following members:sumStats.sse Vector, sum of the squared errors of estimates for endogenous variables in the model. sumStats.mse Vector, mean squared errors of estimates for endogenous variables in the model. sumStats.rmse Vector, root mean squared errors of estimates for endogenous variables in the model. sumStats.see Vector, standard error of the estimates for endogenous variables in the model. sumStats.rsq Vector, r-squared of estimates for endogenous variables in the model. sumStats.AdjRsq Scalar, adjusted r-squared of estimates for endogenous variables in the model. sumStats.ssy Scalar, total sum of the squares for endogenous variables in the model. sumStats.DW Scalar, Durbin-Watson statistic for residuals from the estimates for endogenous variables in the model.
Example¶
new;
library tsmt;
// Create file name with full path
fname = getGAUSSHome("pkgs/tsmt/examples/wpi1.dat");
// Load variable 'wpi' from 'wpi1.dat'
y = loadd(fname, "wpi");
// Model settings
p = 1;
d = 1;
q = 1;
trend = 0;
const = 1;
// Declare 'amo' to be an arimamtOut structure
// to hold the estimation results and then
// estimate the model
struct arimamtOut amo;
amo = arimaSS(y, p, d, q, trend, const);
The example above prints the following results
================================================================================
Model: ARIMA(1,1,1) Dependent variable: wpi
Time Span: Unknown Valid cases: 124
SSE: 68.406 Degrees of freedom: 119
Log Likelihood: 135.464 RMSE: 0.746
AIC: 262.928 SEE: 17.102
SBC: 290.177 Durbin-Watson: 1.768
R-squared: 0.416 Rbar-squared: 0.854
================================================================================
Coefficient Estimate Std. Err. T-Ratio Prob |>| t
--------------------------------------------------------------------------------
Constant 0.80003 --- --- ---
wpi L(1) 0.86813 0.06389 13.58860 0.00017
MA L(1) -0.40594 0.12318 -3.29550 0.03006
Sigma wpi 0.52382 0.29577 1.77104 0.15126
================================================================================
Library¶
tsmt