Monthly international airline passengers, 1949 to 1960, in thousands. Each tree forecasts next month from the last three months and the calendar month. One deep tree overreacts to quirks in the history. Bagging trains many trees on bootstrap resamples of 1950 to 1958 and averages them. Then we score the forecasts on 1959 and 1960, which no tree ever saw.
In the shaded test years the faint lines fan out: that spread is variance. The blue line is their average. Where every tree misses in the same direction, that is bias, and averaging can't fix it.
The first ten or so trees do most of the work, then the curve flattens. Notice the orange OOB line sits well below the real test error. Out of bag months fall between training months, so OOB measures filling gaps, not forecasting the future.
Each cell is one training month. The number is how many times the bootstrap drew it.
After building lag features, every month becomes one row: its last three months and its calendar month in, its value out. Bagging draws those rows with replacement. Some months show up twice, about a third never show up, so every tree learns a slightly different history.
If each tree's forecast has variance σ²T and trees are correlated by ρ, the average has variance ρσ²T + (1 − ρ)σ²T/B. More trees shrink the second term only. That is why the curve flattens instead of reaching zero.
An out of bag month still has training months right before and after it, so OOB error is an interpolation score. For a forecast you want a later holdout, or time series cross validation with an expanding window.
A tree predicts averages of values it has seen. Switch the target to raw counts and every 1960 forecast is stuck below the 1958 peak, no matter how many trees you bag. Modeling the seasonal log change removes the trend, so the trees only learn growth rates, and the forecast rebuilds the level.