# arima

Convert regression model with ARIMA errors to ARIMAX model

## Syntax

## Description

`[`

returns the table or timetable of predictor data `ARIMAXMdl`

,`Tbl2`

] = arima(`Mdl`

,PredictorTbl=`Tbl1`

)`Tbl2`

for the output
ARIMAX model, transformed from the specified predictor data in the table or timetable
`Tbl1`

associated with the input regression model with ARIMA errors.
`arima`

selects all variables in `Tbl1`

as
predictor variables for the regression component of `Mdl`

.* (since R2023b)*

## Examples

## Input Arguments

## Output Arguments

## Algorithms

Let *X* denote the matrix of concatenated predictor data vectors (or
design matrix) and *β* denote the regression component for the regression
model with ARIMA errors, `Mdl`

.

If you specify

`X`

or`Tbl1`

,`arima`

returns converted predictor data in`XNew`

or`Tbl2`

using a certain format. Suppose that the nonzero autoregressive lag term degrees of`Mdl`

are 0 <*a*_{1}<*a*_{2}< ...<*P*, which is the largest lag term degree. The software obtains these lag term degrees by expanding and reducing the product of the seasonal and nonseasonal autoregressive lag polynomials, and the seasonal and nonseasonal integration lag polynomials$$\varphi (L){(1-L)}^{D}\Phi (L)(1-{L}^{s}).$$

The first converted predictor variable is

*Xβ*.The second converted predictor variable is a sequence of

*a*_{1}`NaN`

s, and then the product $${X}_{{a}_{1}}\beta ,$$ where $${X}_{{a}_{1}}\beta ={L}^{{a}_{1}}X\beta .$$Converted Predictor variable

*j*is a sequence of*a*_{j}`NaN`

s, and then the product $${X}_{{a}_{j}}\beta ,$$ where $${X}_{{a}_{j}}\beta ={L}^{{a}_{j}}X\beta .$$The last converted predictor variable is a sequence of

*a*_{p}`NaN`

s, and then the product $${X}_{p}\beta ,$$ where $${X}_{p}\beta ={L}^{p}X\beta .$$

Suppose that

`Mdl`

is a regression model with ARIMA(3,1,0) errors, and*ϕ*_{1}= 0.2 and*ϕ*_{3}= 0.05. Then the product of the autoregressive and integration lag polynomials is$$(1-0.2L-0.05{L}^{3})(1-L)=1-1.2L+0.02{L}^{2}-0.05{L}^{3}+0.05{L}^{4}.$$

This implies that

`ARIMAXMdl.Beta`

is`[1 -1.2 0.02 -0.05 0.05]`

and`XNew`

is$$\left[\begin{array}{ccccc}{x}_{1}\beta & NaN& NaN& NaN& NaN\\ {x}_{2}\beta & {x}_{1}\beta & NaN& NaN& NaN\\ {x}_{3}\beta & {x}_{2}\beta & {x}_{1}\beta & NaN& NaN\\ {x}_{4}\beta & {x}_{3}\beta & {x}_{2}\beta & {x}_{1}\beta & NaN\\ {x}_{5}\beta & {x}_{4}\beta & {x}_{3}\beta & {x}_{2}\beta & {x}_{1}\beta \\ \vdots & \vdots & \vdots & \vdots & \vdots \\ {x}_{T}\beta & {x}_{T-1}\beta & {x}_{T-2}\beta & {x}_{T-3}\beta & {x}_{T-4}\beta \end{array}\right],$$

where

*x*is row_{j}*j*of*X*.If you do not specify

`X`

or`Tbl1`

,`arima`

returns converted predictor data in`XNew`

as an empty matrix without rows and a number of columns equal to one plus the number of nonzero autoregressive coefficients in the difference equation of`Mdl`

.

## Version History

**Introduced in R2013b**