Skip to content
DeepForgeby svx
All problems
EasyTime Seriests-350

ARIMA Parameter Count

Problem

Count the estimated parameters of an ARIMA(p, d, q) model. The autoregressive and moving average orders contribute p + q parameters, and an optional mean or constant adds one more.

The differencing order d contributes no parameters, so it does not appear in the count.

Hint

Differencing is a data transformation, not an estimated parameter.

Test cases

case 1
in: [1,1,1,true]
expected: 3
case 2
in: [2,0,1,true]
expected: 4
case 3
in: [1,2,1,false]
expected: 2
case 4
in: [0,0,0,false]
expected: 0
case 5
in: [2,1,0,true]
expected: 3
Starter codePython
def arima_parameter_count(p, d, q, include_mean):
    # Your code here
    pass

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