ISYE 6402 Homework 4: Time Series Analysis
of Domestic Passenger Counts
ISYE 6402 Homework 4
Background
For this data analysis, you will analyze the daily and weekly domestic passenger count arriving in Hawaii airports.
File DailyDomestic.csv contains the daily number of passengers between May 2019 and February 2023 File
WeeklyDomestic.csv contains the weekly number of passengers for the same time period. Here we will use
different ways of fitting the ARIMA model while dealing with trend and seasonality.
library(lubridate)
library(mgcv)
library(tseries)
library(car)
Instructions on reading the data
To read the data in R , save the file in your working directory (make sure you have changed the directory if
different from the R working directory) and read the data using the R function read.csv()
daily <- read.csv("DailyDomestic.csv", head = TRUE)
daily$date <- as.Date(daily$date)
weekly <- read.csv("WeeklyDomestic.csv", head = TRUE)
weekly$week <- as.Date(weekly$week)
Question 1. Trend and seasonality estimation
1a. Plot the daily and weekly domestic passenger count separately. Do you see a strong trend and seasonality?
daily_ts = ts(daily$domestic,start=decimal_date(ymd("2019-05-01")),frequency=365)
ts.plot(daily_ts,ylab="Domestic Count")
1/21
, 2/
weekly_ts = ts(weekly$domestic,decimal_date(ymd("2019-05-05")),frequency=52)
ts.plot(weekly_ts,ylab="Domestic Count")
Response: I see seasonality as well as a slight trend, as the peaks of the cycles are rising slightly overtime. It’s
hard to tell exactly what the seasons are but it looks like there are typically two peaks within a year - one towards
2/21
, 2/
the beginning of the year and one a little after the middle of the year (maybe summer travel).
1b. (Trend and seasonality) Fit the weekly domestic passenger count with a non-parametric trend using splines
and monthly seasonality using ANOVA. Is the seasonality significant? Plot the fitted values together with the
original time series. Plot the residuals and the ACF of the residuals. Comment on how the model fits and on the
appropriateness of the stationarity assumption of the residuals.
3/21