Next Three Values
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
10 <= len(values) <= 80- The values are not all equal
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More statsmodels problems
- Slope Through TimeHard
- The Repeating PartHard
- Which Findings SurviveHard
- How Much Is ExplainedBeginner
- How Sure Is the SlopeBeginner
- Line Through ZeroBeginner
- Line Through the DataBeginner
- Reading Off the LineBeginner