[Stable] Next-step value of an ARMA process

ARMA_next_step(h = 1, X0, A, b, intercept = 0, eps = 0)

Arguments

h

integer(1), number of steps ahead.

X0

numeric vector of length p + q, state vector of past values.

A

numeric matrix of size p+q x p+q. See the function ARMA_companion_matrix for more details.

b

mumeric vector of length p+q. See the function ARMA_vector_b for more details.

intercept

Numeric scalar, intercept parameter.

eps

optional numeric vector of length h. Next step new residuals.

Note

Version 1.0.2

Examples

# Companion matrix and vector b
A <- ARMA_companion_matrix(c(0.4), c())
b <- ARMA_vector_b(1,0)
# Initial value
X0 <- c(0.9)

# Next step forecast
ARMA_next_step(1, X0, A, b, intercept = 0.2, eps = 0)
#>      [,1]
#> [1,] 0.56
# 3-steps ahead forecast
ARMA_next_step(3,X0, A, b, intercept = 0.2, eps = 0)
#>        [,1]
#> [1,] 0.3696
# 10-step ahead forecast
ARMA_next_step(10, X0, A, b, intercept = 0.2, eps = 0)
#>           [,1]
#> [1,] 0.3333928

# Next step simulation
eps <- rnorm(1)
ARMA_next_step(1, X0, A, b, intercept = 0.2, eps = eps)
#>            [,1]
#> [1,] -0.8400435
# 3-steps ahead simulation
eps <- rnorm(3)
ARMA_next_step(3, X0, A, b, intercept = 0.2, eps = eps)
#>           [,1]
#> [1,] -0.570026
# 10-step ahead simulation
eps <- rnorm(10)
ARMA_next_step(10, X0, A, b, intercept = 0.2, eps = eps)
#>            [,1]
#> [1,] -0.4192065