Skip to main content Accessibility help
×
Hostname: page-component-77c89778f8-m8s7h Total loading time: 0 Render date: 2024-07-23T04:01:03.911Z Has data issue: false hasContentIssue false

6 - Time Series Analysis

Published online by Cambridge University Press:  20 October 2016

Mark J. Bennett
Affiliation:
University of Chicago
Dirk L. Hugen
Affiliation:
University of Iowa
Get access

Summary

You work for an airline in the operations department. They ask you to reach into the historical company and industry datasets and figure out the expected loading for every flight in their book for this coming year. This ties directly into projected revenue. In the back of your mind, you know that expenses for the company need to be offset by revenue. It doesn't help to be overly optimistic because the risk of not meeting the projections carries with it the risk of future disappointment.

What should you do? Passenger boardings are cyclical. There are risks of a downturn. But a downturn could impact profitability of the entire company. The price of oil and jet fuel is important. Mergers happen every year which change the competitive landscape and make some routes more efficient.

Time series analysis can certainly help. Just like confidence intervals in statistics (please see also the Appendix), there is a band of uncertainty around any of the projections. The expected airline passenger loadings is a random variable. Passenger boarding is one of several arenas we will explore with the help of tools in R.

Examining Time Series

We begin with a quick survey of the types of times series we will model. We can use the quantmod and PerformanceAnalytics packages, firstly. We will define the vector of symbols to be downloaded. The symbols GSPC, VIX, TNX, refer to the S&P 500 index, the CME volatility index, and the ten-year treasury yield, respectively. Use the getSymbols() function to download the time series for the symbols in sym.vec between the dates of January 3, 2003 and September 10, 2015. If the quantmod and PerformanceAnalytics packages are not yet installed, they can be installed with the commands install.packages(“quantmod”, dependencies=TRUE) and install.packages(“PerformanceAnalytics”, dependencies=TRUE).

  1. > library(quantmod)

  2. > library(PerformanceAnalytics)

  3. > sym.vec <-c(“GSPC”,“VIX”)

  4. > getSymbols(sym.vec, from = “2005-01-03”, to = “2015-09-16”)

[1] “GSPC” “VIX”

The first plot is of the S&P 500, shown in Figure 6.1.We see the peak of the market in early 2007 and then the steep decline as the housing crisis hit.We see the market bottom out in mid 2009 and begin a large rally that lasts through mid 2015. We see minor corrections in 2011 and 2012 due to uncertainty surrounding the government debt in the Euro zone, and a significant sell-off in mid 2015 due to uncertainty surrounding China's economy.

Type
Chapter
Information
Financial Analytics with R
Building a Laptop Laboratory for Data Science
, pp. 92 - 129
Publisher: Cambridge University Press
Print publication year: 2016

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×