# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.timeseries.linear.univariate.arima

## Class ARIMAXModel

• java.lang.Object
• com.numericalmethod.suanshu.stats.timeseries.linear.univariate.arima.ARIMAXModel
• Direct Known Subclasses:
ARIMAModel, ARMAXModel

public class ARIMAXModel
extends Object
The ARIMAX model (ARIMA model with eXogenous inputs) is a generalization of the ARIMA model by incorporating exogenous variables. Letting B be the backward or lag operator, the d-th difference of an ARIMAX(p, d, q) process Xt is $(1 - B)^d X_t = Y_t$ where Yt is an ARMAX(p, q) process, for which $Y_t = \mu + \sum_{i=1}^p \phi_i Y_{t-i} + \sum_{i=1}^q \theta_j \epsilon_{t-j} + \psi' D_t + \epsilon_t,$ where Dt is an (m * 1) vector which contains all exogenous variables at time t (excluding the intercept term), and its coefficients are represented by an m-dimensional vector ψ.
• ### Constructor Summary

Constructors
Constructor and Description
ARIMAXModel(ARIMAXModel that)
Copy constructor.
ARIMAXModel(double[] AR, int d, double[] MA, double[] psi)
Construct a univariate ARIMAX model with unit variance and zero-intercept (mu).
ARIMAXModel(double[] AR, int d, double[] MA, double[] psi, double sigma)
Construct a univariate ARIMAX model with zero-intercept (mu).
ARIMAXModel(double mu, double[] AR, int d, double[] MA, double[] psi)
Construct a univariate ARIMAX model with unit variance.
ARIMAXModel(double mu, double[] AR, int d, double[] MA, double[] psi, double sigma)
Construct a univariate ARIMAX model.
• ### Method Summary

All Methods
Modifier and Type Method and Description
double AR(int i)
Get the i-th AR coefficient; AR(0) = 1.
int d()
Get the order of integration.
ARMAXModel getARMAX()
Get the ARMAX part of this ARIMAX model, essentially ignoring the differencing.
double MA(int i)
Get the i-th MA coefficient; MA(0) = 1.
int maxPQ()
Get the maximum of AR length or MA length.
double mu()
Get the intercept (constant) term.
int p()
Get the number of AR terms.
double[] phi()
Get all the AR coefficients.
Polynomial phiPolynomial()
Get the polynomial (1 - φ).
double[] psi()
Get the coefficients of the deterministic terms.
int q()
Get the number of MA terms.
double sigma()
Get the white noise variance.
double[] theta()
Get all the MA coefficients.
Polynomial thetaPolynomial()
Get the polynomial (1 + θ).
String toString()
• ### Constructor Detail

• #### ARIMAXModel

public ARIMAXModel(double mu,
double[] AR,
int d,
double[] MA,
double[] psi,
double sigma)
Construct a univariate ARIMAX model.
Parameters:
mu - the intercept (constant) term
AR - the AR coefficients (excluding the initial 1); null if no AR coefficient
d - the order of integration
MA - the MA coefficients (excluding the initial 1); null if no MA coefficient
psi - the coefficients of the deterministic terms (excluding the intercept term)
sigma - the white noise variance
• #### ARIMAXModel

public ARIMAXModel(double mu,
double[] AR,
int d,
double[] MA,
double[] psi)
Construct a univariate ARIMAX model with unit variance.
Parameters:
mu - the intercept (constant) term
AR - the AR coefficients (excluding the initial 1); null if no AR coefficient
d - the order of integration
MA - the MA coefficients (excluding the initial 1); null if no MA coefficient
psi - the coefficients of the deterministic terms (excluding the intercept term)
• #### ARIMAXModel

public ARIMAXModel(double[] AR,
int d,
double[] MA,
double[] psi,
double sigma)
Construct a univariate ARIMAX model with zero-intercept (mu).
Parameters:
AR - the AR coefficients (excluding the initial 1); null if no AR coefficient
d - the order of integration
MA - the MA coefficients (excluding the initial 1); null if no MA coefficient
psi - the coefficients of the deterministic terms (excluding the intercept term)
sigma - the white noise variance
• #### ARIMAXModel

public ARIMAXModel(double[] AR,
int d,
double[] MA,
double[] psi)
Construct a univariate ARIMAX model with unit variance and zero-intercept (mu).
Parameters:
AR - the AR coefficients (excluding the initial 1); null if no AR coefficient
d - the order of integration
MA - the MA coefficients (excluding the initial 1); null if no MA coefficient
psi - the coefficients of the deterministic terms (excluding the intercept term)
• #### ARIMAXModel

public ARIMAXModel(ARIMAXModel that)
Copy constructor.
Parameters:
that - a univariate ARIMAX model
• ### Method Detail

• #### mu

public double mu()
Get the intercept (constant) term.
Returns:
the intercept (constant) term
• #### AR

public double AR(int i)
Get the i-th AR coefficient; AR(0) = 1.
Parameters:
i - an index
Returns:
the i-th AR coefficient
• #### phi

public double[] phi()
Get all the AR coefficients.
Returns:
all the AR coefficients
• #### phiPolynomial

public Polynomial phiPolynomial()
Get the polynomial (1 - φ). The coefficients (except the initial 1) have the opposite signs to AR(int) and phi().
Returns:
the polynomial (1 - φ)
• #### MA

public double MA(int i)
Get the i-th MA coefficient; MA(0) = 1.
Parameters:
i - an index
Returns:
the i-th MA coefficient
• #### theta

public double[] theta()
Get all the MA coefficients.
Returns:
all the MA coefficients
• #### thetaPolynomial

public Polynomial thetaPolynomial()
Get the polynomial (1 + θ).
Returns:
the polynomial (1 + θ)
• #### psi

public double[] psi()
Get the coefficients of the deterministic terms.
Returns:
the coefficients of the deterministic terms; could be null
• #### d

public int d()
Get the order of integration.
Returns:
the order of integration
• #### p

public int p()
Get the number of AR terms.
Returns:
the number of AR terms
• #### q

public int q()
Get the number of MA terms.
Returns:
the number of MA terms
• #### maxPQ

public int maxPQ()
Get the maximum of AR length or MA length.
Returns:
max(# AR terms, # MA terms)
• #### sigma

public double sigma()
Get the white noise variance.
Returns:
the white noise variance
• #### getARMAX

public ARMAXModel getARMAX()
Get the ARMAX part of this ARIMAX model, essentially ignoring the differencing.
Returns:
the ARMAX part