sarimaSS#
Purpose#
Estimates SARIMA models using a state space representation, the Kalman filter, and maximum likelihood.
Format#
- vOut = sarimaSS(y, p, d, q, P_s, D_s, Q_s, s, trend, const)#
- Parameters:
y (Nx1 vector) – data.
p (Scalar) – the autoregressive order.
d (Scalar) – the order of differencing.
q (Scalar) – the moving average order.
P_s (Scalar) – the seasonal autoregressive order.
D_S (Scalar) – the seasonal order of differencing.
Q_s (Scalar) – the seasonal moving average order.
s (Scalar) – the seasonal frequency term.
trend (Scalar) – an indicator variable to include a trend in the model. Set to 1 to include trend, 0 otherwise.
const (Scalar) – an indicator variable to include a constant in the model. Set to 1 to include trend, 0 otherwise.
- Returns:
amo (struct) –
An instance of an
arimamtOut
structure 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
tsmtModelDesc
structure 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
tsmtSummaryStats
structure 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;
cls;
library tsmt;
airline = loadd( getGAUSSHome() $+ "pkgs/tsmt/examples/airline.dat");
// Transform data
y = ln(airline);
p = 0;
d = 1;
q = 1;
P_s = 0;
D_s = 1;
Q_s = 1;
s=12;
trend = 0;
const = 0;
struct arimamtOut amo;
amo = sarimaSS( y, p, d, q, P_s, D_s, Q_s, s, trend, const );
Library#
tsmt
Source#
sarima_ss.src