Jet Blue Airways

Author

Penelope Pooler Eisenbies

Published

May 2, 2024

Import and Examine Data

Show the code
# data source: https://www.transtats.bts.gov/Data_Elements.aspx?Data=1

jetblue <- read_csv("data/jetblue_passengers_5_2_2024.csv",
                   show_col_types = F, skip=1)|>
  filter(Month != "TOTAL") |>
  mutate(date_som = ym(paste(Year, Month)),
         Date = ceiling_date(date_som, "month")-1,
         Total = (TOTAL/1000000) |> round(2)) |>
  select(Date, Total) |>
  glimpse(width=60)
Rows: 256
Columns: 2
$ Date  <date> 2002-10-31, 2002-11-30, 2002-12-31, 2003-01…
$ Total <dbl> 0.55, 0.54, 0.64, 0.64, 0.60, 0.75, 0.74, 0.…
Show the code
jetblue_pp <- jetblue |>          # post_pandemic data 
  filter(Date >= "2021-06-01") |>
  glimpse(width=60)
Rows: 32
Columns: 2
$ Date  <date> 2021-06-30, 2021-07-31, 2021-08-31, 2021-09…
$ Total <dbl> 3.07, 3.42, 3.21, 2.49, 2.81, 2.80, 3.03, 2.…

Interactive Time Series Plot

Full and Truncated Data Plots

Plot of Full Time Series

Seasonal pattern was disrupted by the pandemic when air travel was considered dangerous.

Plot of Truncated Time Series

Once vaccines became readily available, air travel began to resume it’s traditional pattern:

  • Peaks occur at the end of July

  • Low points occur at the end of Jnauary

  • Pattern is not straightforward to discern because post-pandemic data are fairly limited.

  • Data for February and March of 2024 are not available yet.

Forecast Modeling

Create Time Series (ts)

Show the code
jetblue_ts <- ts(jetblue_pp$Total, freq=12, start=c(2021,6)) # create time series

jetblue_ts # display time series
      Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
2021                          3.07 3.42 3.21 2.49 2.81 2.80 3.03
2022 2.30 2.55 3.36 3.48 3.50 3.39 3.70 3.68 3.17 3.42 3.45 3.63
2023 3.26 3.09 3.88 3.77 3.82 3.72 3.91 3.94 3.18 3.41 3.38 3.45
2024 3.03                                                       

Model 1

Show the code
jetblue_model1 <- jetblue_ts |> auto.arima(ic="aic", seasonal=T)

jetblue_forecast1 <- jetblue_model1 |> forecast(h=12)

(jetblue_fcp1 <- autoplot(jetblue_forecast1) + 
    labs(y = "Number of Passenger (Mill.)") + 
    theme_classic())

Show the code
jetblue_forecast1
         Point Forecast    Lo 80    Hi 80    Lo 95    Hi 95
Feb 2024           2.86 2.642117 3.077883 2.526777 3.193223
Mar 2024           3.65 3.341867 3.958133 3.178751 4.121249
Apr 2024           3.54 3.162616 3.917384 2.962841 4.117159
May 2024           3.59 3.154234 4.025766 2.923554 4.256446
Jun 2024           3.49 3.002799 3.977201 2.744890 4.235110
Jul 2024           3.68 3.146298 4.213702 2.863773 4.496227
Aug 2024           3.71 3.133536 4.286464 2.828375 4.591625
Sep 2024           2.95 2.333734 3.566266 2.007503 3.892497
Oct 2024           3.18 2.526351 3.833649 2.180331 4.179669
Nov 2024           3.15 2.460994 3.839006 2.096256 4.203744
Dec 2024           3.22 2.497364 3.942636 2.114824 4.325176
Jan 2025           2.80 2.045232 3.554768 1.645681 3.954319
Show the code
checkresiduals(jetblue_forecast1, test=F)

Show the code
(acr1 <- accuracy(jetblue_forecast1)) 
                      ME      RMSE        MAE        MPE     MAPE     MASE
Training set -0.01737907 0.1310053 0.07332234 -0.5223242 2.176763 0.194489
                   ACF1
Training set -0.2968123

Model 2

Show the code
jetblue_model2 <- jetblue_ts |> auto.arima(ic="aic", seasonal=F) 

jetblue_forecast2 <- jetblue_model2 |> forecast(h=12)

(jetblue_fcp2 <- autoplot(jetblue_forecast2) + 
    labs(y = "Number of Passenger (Mill.)") + 
    theme_classic())

Show the code
jetblue_forecast2
         Point Forecast    Lo 80    Hi 80     Lo 95    Hi 95
Feb 2024           3.03 2.556300 3.503700 2.3055391 3.754461
Mar 2024           3.03 2.360088 3.699912 2.0054576 4.054542
Apr 2024           3.03 2.209528 3.850472 1.7751969 4.284803
May 2024           3.03 2.082601 3.977399 1.5810782 4.478922
Jun 2024           3.03 1.970776 4.089224 1.4100562 4.649944
Jul 2024           3.03 1.869678 4.190322 1.2554405 4.804560
Aug 2024           3.03 1.776709 4.283291 1.1132567 4.946743
Sep 2024           3.03 1.690175 4.369825 0.9809152 5.079085
Oct 2024           3.03 1.608901 4.451099 0.8566173 5.203383
Nov 2024           3.03 1.532031 4.527969 0.7390535 5.320946
Dec 2024           3.03 1.458916 4.601084 0.6272351 5.432765
Jan 2025           3.03 1.389057 4.670943 0.5203939 5.539606
Show the code
checkresiduals(jetblue_forecast2, test=F)

Show the code
(acr2 <- accuracy(jetblue_forecast2)) 
                       ME      RMSE       MAE        MPE     MAPE      MASE
Training set -0.001154063 0.3638084 0.2657209 -0.7409993 8.542515 0.7048301
                   ACF1
Training set -0.1975244