Spirit Airlines and Disney Series (Part 1) - Quick Forecasting

Peng Chen

June 4, 2021

library(tidyquant)
library(tidyverse)
library(fable)
library(tsibble)
tickers <- c("SAVE", "DIS")
stocks <- tq_get(
  tickers, from = "2020-06-09", to = "2021-06-09", get = "stock.prices"
)

stocks_tsbl <- stocks %>% 
  group_by(symbol) %>% 
  mutate(day = row_number()) %>% 
  ungroup() %>% 
  tsibble(key = symbol, index = day) 

stocks_tsbl %>% 
  autoplot(adjusted) 

stocks_mods <- stocks_tsbl %>% 
  model(ets = ETS(adjusted), arima = ARIMA(adjusted))

stocks_fc <- stocks_mods %>% 
  forecast(h = 5)

stocks_fc %>% autoplot(stocks_tsbl)