Closed r2evans closed 1 year ago
The problem was that you did filter(!is.na(Bricks))
when fitting the models, but not when making the plot!
library(fable)
#> Loading required package: fabletools
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(tsibbledata)
library(tsibble)
#>
#> Attaching package: 'tsibble'
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, union
aus_production <- aus_production |>
filter(!is.na(Bricks))
brick_fit <- aus_production |>
model(
`Seasonal_naïve` = SNAIVE(Bricks),
`Naïve` = NAIVE(Bricks),
Drift = RW(Bricks ~ drift()),
Mean = MEAN(Bricks)
)
brick_fit |>
forecast(h = "5 years") |>
autoplot(
filter(aus_production, Quarter > yearquarter("2000 Q1")),
level = 50,
show_gap = FALSE
)
Created on 2023-09-18 with reprex v2.0.2
(In the posit::conf 2023 workshop)
This works, but adding
show_gap=FALSE
fails withOddly enough, very similar models built on slightly different datasets do work:
I'm really enjoying the class, thank you!
sessioninfo::session_info()