Skip to content
DeepForgeby svx
All problems
HardTime Seriests-351

ARIMA(1,1,1) One-Step Forecast

Problem

Compute a one-step forecast from an ARIMA(1,1,1) model fitted to a series. Work on the differenced scale: the predicted difference is c + phi * (y_now - y_prev) + theta * e_last, where e_last is the most recent residual.

The level forecast adds that predicted difference back onto the last observation, y_now + d_hat.

Hint

Forecast the difference first, then integrate it by adding it to the last level.

Test cases

case 1
in: [0.1,0.5,0.3,10,9,0.5]
expected: 10.75
case 2
in: [0,0,0,5,4,1]
expected: 5
case 3
in: [1,1,0,3,3,0]
expected: 4
case 4
in: [0.2,-0.5,0.4,8,10,1]
expected: 9.6
Starter codePython
def arima_111_forecast(c, phi, theta, y_now, y_prev, e_last):
    # Your code here
    pass

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