The marketing team has two years of daily website visits and needs a forecast to plan server capacity and campaigns. The series climbs over time, dips every weekend and swings with the seasons. They have been eyeballing last year's numbers.
A forecast that fits the past closely can still fail on dates it has not seen, so the only score that counts is the backtest: refit on the data up to several past dates and see how the forecasts did. You will take the series apart into trend, weekly pattern and remainder, fit an exponential-smoothing model, read its backtest against the naive forecast, compare several methods on identical windows, and put the result on a dashboard. The data are simulated with a known trend and known patterns.
Data: Daily website visits (simulated) · Simulated. CodeSplash parity fixture l3_visits (simulated daily visits with trend, weekly and yearly patterns).
A seasonal decomposition splits the series into a trend, a repeating weekly pattern and what is left over. Seeing each part tells you what a forecast has to capture.
How big is the weekly swing compared with the trend's growth over two years?
Open Analyze and find Seasonal decomposition.
Choose website visits (sample), set Value to visits and Time to day.
Set Period to 7, one week of days.
Press Run.
Read the panels. How large is the weekly pattern next to the trend, and does anything seasonal remain in the remainder?
Stage 2 · forecast · ~14 min
Forecast with a backtest
Exponential smoothing handles trend and seasonality and is a dependable first model. Read its backtest, not its fit. The scaled error (MASE) divides the backtest errors by the naive forecast's one-step error in the training data, so it shows how large the errors are, not whether ETS beats the naive forecast over the horizon; the next stage compares them on the same windows.
How large are the ETS forecast's backtest errors, and what does its MASE leave unanswered?
Open Forecast in the sidebar.
Choose the ETS method in the list of methods. It is a dependable first model for a series with trend and seasonality.
Choose website visits (sample) as the dataset.
Set Time to time.
Set Value to value, the number to forecast.
Press Run.
Read the backtest. It refits on the data up to several past dates and scores the forecasts against what really happened. Find the scaled error (MASE).A forecast that fits its history closely can still fail on new dates. Only a backtest tests the future it was not shown.
Stage 3 · forecast · ~6 min
Compare methods on the same windows
Fit several methods on identical backtest windows. Different windows can flatter any method, so only a comparison on the same windows is fair. Prefer the simplest method that holds up.
Does any method beat the simplest baseline by more than the windows vary?
Open Compare methods.
Press Run to fit the ticked methods on the same windows. A few methods are plenty, so untick the slow ones if you like.Comparing on identical windows is what makes the scores comparable. Different windows can flatter any method.
Does anything beat the simplest baseline by more than the windows vary?
Stage 4 · dashboards · ~10 min
Publish the forecast
Give the team a page they will open: the visits over time and a headline number, from the same data source, so the page updates when the data does.
Open Dashboards, press the plus button and choose Blank dashboard.
Press Add a data source, choose website visits (sample) and press Add source.
Close the dialog, press Chart and choose a line chart of visits over day.
Press Add widget, choose KPI, and set it to the mean of visits.
Press Present.
Hints
Set the decomposition's period to 7 for a daily series with a weekly pattern.
Judge a forecast by its backtest. To beat the naive forecast, it needs a lower error on the same windows; MASE below 1 alone doesn't show that.
In Compare methods, prefer the simplest method whose lead is bigger than the variation across windows.
dashboard
A forecast dashboard with its caveats
Write the note that goes with the dashboard: what the series is made of, the method you chose and why, how it did in the backtest against the naive forecast, how wide the intervals are, and how far ahead you would trust it.
What drives the series
Method and backtest
Intervals
How far to trust it
Rubric
Criterion
Points
Describes the trend, the weekly pattern and what remains.
1
Uses the backtest rather than in-sample fit to judge the method, and compares it with the naive forecast on the same windows.
2
Compares methods on the same windows and justifies the choice.
2
Reports the forecast with its intervals and says they widen with the horizon.
2
Notes the data are simulated and forecasts assume the patterns continue.
1
Model answer
Show the model answer
What drives it. The decomposition shows a rising trend, a strong weekly pattern with weekend dips, and a slower yearly wave left in the remainder when the period is set to one week.
Method and backtest. ETS captures the trend and the weekly pattern. Its backtest refits on the data up to several past dates; read the MASE from your run. MASE compares the backtest errors with the naive forecast's one-step error in the training data, so it says how large the errors are, not whether ETS beats the naive forecast over the horizon. The comparison below answers that.
Comparison. On identical windows, compare each method's error with the simplest baseline and with how much the error varies between windows. Prefer the simplest method whose lead is larger than that variation; a small win on three windows may not last.
Intervals and trust. Quote the forecast with its 80% and 95% intervals and note how they widen with the horizon. The forecast assumes the trend and patterns continue; a campaign or an outage breaks that assumption. The series is simulated with these patterns built in.