Skip to content
DeepForgeby svx
All problems
HardTime Seriests-041

ARMA(1,1) One-Step Forecast

Problem

For the ARMA(1,1) model x[t] = c + phi * x[t-1] + e[t] + theta * e[t-1], compute the one-step-ahead forecast conditional on the last observation and the last residual: c + phi * x_last + theta * e_last.

Return the forecast as a number.

Hint

Future innovations have expectation zero, so only the last residual enters.

Test cases

case 1
in: [1,0.5,0.3,10,2]
expected: 6.6
case 2
in: [0,0.8,-0.5,5,1]
expected: 3.5
case 3
in: [2,0,0,7,3]
expected: 2
case 4
in: [1,0.5,0.3,10,0]
expected: 6
Starter codePython
def arma11_forecast(c, phi, theta, x_last, e_last):
    # Your code here
    pass

4 test cases · run your code against them in the editor