FunctionRacerProblemsRace

Next Three Values

HardstatsmodelsPython

values is a series in time order. Fit an autoregressive model with one lag, in which each value is a constant plus a multiple of the value before it plus noise, and return its forecasts for the next three steps.

Example 1

values [1,2,4,8,16,32,64,128,256,512]
returns [1024.0,2048.0,4096.0]

Each value is exactly twice the one before it, and the forecasts carry on doubling.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More statsmodels problems