When's The Best Time to Ride Avatar Flight of Passage?

Avatar Flight of Passage Mural

Avatar Flight of Passage is my favorite ride in all of Disney World, I remember waiting close to four hours to ride the ride in December 2017 and I would do it again in a heartbeat. This past December I was able to visit Disney World again and managed to get a hold of some fast passes for the ride which made the experience much better. While I was waiting in line for the ride I wondered what the optimal time to queue up for the ride and wanted to see if I could analyze wait time data. In this post I’ll do some time series forecasting using Facebook’s open source Prophet project which is used in production for time series forecasting.

library(tidyverse)
library(prophet)

Import data

I was able to get the ride wait time data from the folks at touringplans.com.

df <- read_csv(here::here("data_files/flight_of_passage.csv")) 

df
## # A tibble: 122,247 x 4
##    date       datetime            SPOSTMIN SACTMIN
##    <chr>      <dttm>                 <dbl>   <dbl>
##  1 05/26/2017 2017-05-26 09:06:38     -999      NA
##  2 05/26/2017 2017-05-26 09:10:12        5      NA
##  3 05/26/2017 2017-05-26 09:17:09       60      NA
##  4 05/26/2017 2017-05-26 09:24:07       60      NA
##  5 05/26/2017 2017-05-26 09:30:10       60      NA
##  6 05/26/2017 2017-05-26 09:38:10       45      NA
##  7 05/26/2017 2017-05-26 09:45:32       45      NA
##  8 05/26/2017 2017-05-26 09:53:14       45      NA
##  9 05/26/2017 2017-05-26 09:10:11       NA      47
## 10 05/26/2017 2017-05-26 09:59:07       45      NA
## # … with 122,237 more rows

Data cleaning

Prophet requires a datetime column labeled ds and numerical y column. We can clean up the data by filtering out missing values and times when the ride was closed indicated by -999.

df2 <- df %>% 
  select(ds = datetime, y = SPOSTMIN,-date,-SACTMIN) %>% 
  filter(!y %in% c(-999) &
           !is.na(y))

df2
## # A tibble: 115,279 x 2
##    ds                      y
##    <dttm>              <dbl>
##  1 2017-05-26 09:10:12     5
##  2 2017-05-26 09:17:09    60
##  3 2017-05-26 09:24:07    60
##  4 2017-05-26 09:30:10    60
##  5 2017-05-26 09:38:10    45
##  6 2017-05-26 09:45:32    45
##  7 2017-05-26 09:53:14    45
##  8 2017-05-26 09:59:07    45
##  9 2017-05-26 10:17:07    45
## 10 2017-05-26 10:24:08    55
## # … with 115,269 more rows

Using prophet

We can call the prophet() function to run the model fitting API on our data and it returns a model object.

df_m <- df2 %>%
  prophet()

df_m

Generate future dates

Next we can use the make_future_dataframe() on our df_m model object to create a dataframe containing forecast date data.

future <- make_future_dataframe(df_m, periods = 365)
head(future)

Generating a forecast

The next step is to use predict() function to create a forecast of our model of the generated future dates.

forecast <- predict(df_m, future)
head(forecast)

Plotting

We can use dyplot.prophet() to create an interactive dyplot but I have included a static picture here so it loads faster on this site. We can see that on the Y axis overall that the overall wait time trend appears to be ~120 minutes. Prophet created a time series forecast as indicated by the blue line and as we expect the error increases as you predict more in the future.

FOP_dyplot <- dyplot.prophet(df_m, forecast)

FOP_dyplot

Plotting the components

One of the neatest features of Prophet is the ability to look at different components of the data. We can use prophet_plot_components() to four plots including, overall trends, weekly,yearly, and daily trends.

FOP_component_plot <- prophet_plot_components(df_m, forecast)

FOP_component_plot

We can see in the trend plot that we can confirm that the overall trend is that wait times are quite steady for Avatar Flight of Passage.

When we look at the weekly plot we can see up to a 10% reduction in wait time on Wednesdays!

Yearly data suggests the best time to ride the ride in September which seems to correspond to the start of school for most students in the US. I usually go to Disney World around the holidays and as we expect it is definitely one of the busiest times of the year. It’s nice to see that the data reflect what we intuitively think. The hourly level data suggests that getting to Animal Kingdom right when it opens and just before the parks close seem to be the best time to queue up for the ride.

TL;DR

It appears the best time to ride Avatar Flight of Passage is right when the park opens on a Wednesday in September! If you can’t manage to go to Disney’s Animal Kingdom during this time, you can still enjoy the beautiful scenery of the World of Pandora while you wait!

Avatar
Sean Nguyen
PhD Candidate