You will build the whole method for quarterly data: centred moving averages, seasonal components and a forecast.
The idea. Centre the 4-point averages by taking the mean of each neighbouring pair. The first centred value belongs to quarter 3. Seasonal variation actual centred average. The component of a season is the mean of its variations. Forecast trend value component.
Your tasks.
centred(data). Return the centred 4-point moving averages, for quarters 3 to .components(data). Return a dictionary {1: ..., 2: ..., 3: ..., 4: ...} of seasonal components.forecast(a, b, t, comps). Return the trend value plus the component of quarter 's season.Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…