Fitted values, residuals and innovations
Today let's understand fitted values, residuals and innovations, the three columns a fitted time series model hands back the moment it is fit.
Northfield Outdoor Supply sells hiking and camping gear. Its owner keeps 60 months of revenue on record, January 2020 through December 2024. Revenue starts at $34,451 and climbs most years, with a summer peak that gets bigger in dollar terms as the business grows.
Look at that climb, and the summer bumps riding on top of it. Once you fit a model to a series shaped like this, R can give back a fitted line that sits almost exactly on top of the real one, and it is tempting to read a line that close as proof the model can forecast. This lesson shows you exactly what that fitted line is built from, and why closeness like that is not the proof it looks like.
What augment() adds to a fitted model
To see what augment() adds, first fit a model to Northfield's revenue. Build the 60 months as a tsibble, the tidyverse's structure for a table indexed by time, then fit a random walk with drift to the logged revenue.
report() names the model RW w/ drift, a random walk with drift: its rule is last month's real value plus one constant step, called the drift, repeated every month. Because the model fit log(revenue) rather than revenue itself, that step lives on the log scale. The Drift row reads 0.0087, which works out to revenue growing by about 0.87% from one month to the next, on average across the whole series.
Now ask fabletools for the model's own bookkeeping with augment(). Hand it the mable, the fitted-model table fit_full holds, and it adds three new columns onto the original month and revenue columns.
Three new columns appear. .fitted holds the model's fitted value for that month, what it predicts revenue should have been. .resid holds the response residual, real revenue minus .fitted, in dollars. .innov holds the innovation residual, the miss measured on the scale the model actually fit, here the logged scale.
Row 1, January 2020, is NA across all three columns. There is no earlier month in this series for the model to build a one-step value from yet.