# run to switch index to count
spx_ts2 <- spx_ts %>% drop_na()
spx_ts2 <- spx_ts2 %>%
mutate(count = 1:length(spx_ts2$time)) %>%
update_tsibble(index = count)
spx_ts2 %>%
model(STL(close ~ season(period = 276))) %>%
components() %>%
autoplot() +
labs(title = "STL Decomposition of SPX500 - time index ignored") +
theme_bw()