• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 3 out of 22 pages
Exam (elaborations)

ISYE 6402 Homework 4: Time Series Analysis of Domestic Passenger Counts Questions and Answers with complete

Document preview thumbnail
Preview 3 out of 22 pages

For this data analysis, you will analyze the daily and weekly domestic passenger count arriving in Hawaii airports. File DailyD contains the daily number of passengers between May 2019 and February 2023 File WeeklyD 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 () daily - ("DailyD", head = TRUE) daily$date - as.Date(daily$date) weekly - ("WeeklyD", 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("")),frequency=365) (daily_ts,ylab="Domestic Count") 1/21 2/ weekly_ts = ts(weekly$domestic,decimal_date(ymd("")),frequency=52) (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 2/ ## Splines Trend Estimation = c(1:length(weekly_ts)) = c( - min())/max() #anova_monthly = season(weekly) month - r(month(weekly$week)) =gam(weekly_ts~s()+month) =ts(fitted(),start=decimal_date(ymd("")),frequency=52) resid_weekly_fit= ts((weekly_ts-fitted()),start=decimal_date(ymd("")),f requency=52) (resid_weekly_fit,ylab="Residual Process") 4/21 2/ acf(resid_weekly_fit) Response: The model seems to follow the time series data pretty well until the peaks get a little bigger in 2022. From the residual process, there seems to be increased variation as times goes on, which you can see when you compare the peaks at the beginning of 2020 and 2021 compared to the beginning of 2022 and end of 2022 The ACF plot of the residuals show no statistically significant pattern (because the lags diminish quickly), but we see some pattern that exhibits the seasonal periodicity. 1c. (Trend and seasonality) This time fit the daily domestic passenger count with a non-parametric trend using splines, monthly and day-of-the-week seasonality using ANOVA. Plot the fitted values together with the original time series. Are the seasonal effects significant? 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. 5/21 2/ ## Splines Trend Estimation = c(1:length(daily_ts)) = c( - min())/max() #anova_monthly = season(weekly) month - r(month(daily$date)) =gam(daily_ts~s()+month) =ts(fitted(),start=decimal_date(ymd("")),frequency=365) resid_daily_fit= ts((daily_ts-fitted()),start=decimal_date(ymd("")),fre quency=365) (resid_daily_fit,ylab="Residual Process") 6/21 2/ acf(resid_daily_fit) Response: The residual process looks slightly better for the model on the daily time series as compared to the residual process for the model on the daily time series. However, we see in the ACF plot that although the lags diminish quickly, there still seems to be a cyclical pattern remaining.

Content preview

2/


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

Document information

Uploaded on
August 17, 2026
Number of pages
22
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$11.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Brainarium
3.8
(338)
Sold
2048
Followers
1048
Items
24343
Last sold
2 hours ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions