Time Series in Finance

Project Summary

Matt and Ken led two labs for the engineering section of STA 111/130, an introductory course in statistics and probability. The lab assignments were written by Matt and Ken in order to bridge the gap between introductory linear regression, which is often explained in terms of a static, complete dataset, and time series analysis, which is not a common topic in introductory courses. 

Themes and Categories

Graduate students: Matt Johnson and Ken McAlinn 

Faculty instructor: David Banks

Course: STA 130 Probability and Statistics in Engineering 


Over the course of the two modules, students:

  • Learned introductory topics in finance, including returns, log returns, and the Fama/French model for explaining market returns,
  • Learned about and applied autoregressive time series models,
  • Applied linear regression to a new topic, and
  • Applied new functionality in the MATLAB programming language.

Notably, as these topics were presented in a lab setting, little if any time was spent on a lecture. Instead, the material was presented to students through the lab, with students deriving concepts and properties on their own as a part of the assignment (with some help from Matt and Ken when necessary). Students applied the above methods to a dataset containing daily returns for the Standard & Poor’s 500 Index as well as the returns for the three factors included in the Fama and French Three Factor Model (the original dataset, consisting of tick-level data for Japanese stocks, was considered somewhat overwhelming to introduce, clean, and analyze in a single class session). The main topics covered were those important to fitting a linear regression, including:

  • Identifying predictors,
  • Checking for collinearity among predictors,
  • Removing unnecessary predictors using forward selection.

These topics were related to the autocorrelation and partial autocorrelation functions relevant in time series analysis, and especially with regards to autoregressive time series.

Data Description

For Data Expeditions, we have collected two datasets.

The first consists of daily closing prices of the S&P 500 from 1/4/1995-12/31/2014 and market factors.

These are:

  • Date: Trading date, ranging from 1/4/1995 to 12/31/2014.
  • Adj Close: The adjusted closing price of the S&P 500 (adjustments account for dividends, distribu- tions, corporate actions, etc. that occur before the open of the next day). For our purposes, this is the same as the closing price (the closing price is usually the last price at which a stock trades that day).
  • Mkt-RF: Market - Risk Free, compares the performance of the (risky) market as a whole to a risk-free asset (daily returns).
  • SMB: Small Minus Big, a factor portfolio that measures the performance of small cap stocks relative to large cap stocks (daily returns). When SMB goes up, small cap outperforms large cap.
  • HML: High Minus Low, a factor portfolio that measures the performance of “value” stocks compared to “growth” stocks (daily returns).

The second data set includes high frequency trading data for two stocks from the Japanese stock market, Sony (6758) and Toyota (7203), for the month of January in 2012. Each .csv file contains the trading data for that day, where the files are named as YYYYMMDD ####.csv (#### denote the stock number).

In each file, there are five columns. The first column is the stock number, the second is the hour and minute, the third is the second, the fourth is the 1/10 and 1/100th of the second, and the fifth the price. Every time an order is made on the market (either buy or sell), the time and price is recorded. 

Related Projects

This Data Expedition introduces students to network tools and approaches and invites students to consider the relationship(s) between social networks and social imaginaries. Using foundation-funding data that was collected from the The Foundation Directory Online, the Data Expedition enables students to visualize and explore the relationship between networks, social imaginaries, and funding for higher education. The Data Expedition is based on two sets of data. The first set list the grants received by Duke University in 2016 from five foundations: The Bill and Melinda Gates Foundation, Fidelity Charitable Gift Fund, Silicon Valley Community Foundation, The Community Foundation of Western North Carolina, and The Robert Wood Johnson Foundation. The second set lists the names of board members from Duke University and each of these five foundations along with the degree granting institution for their undergraduate education. For the sake of this exercise, the degree granting institutions data was fabricated from a randomized list of the top twenty-five undergraduate institutions.

This Data Expedition seeks to introduce students to statistical analysis in the field of international development. Students construct a index of wealth/poverty based on asset holdings using four datasets collected under the umbrella of the Living Standards Measurement Survey project at the World Bank. We selected countries to represent different continents with comparable and recent survey data: Bulgaria (2007), Tajikistan (2009), Tanzania (2010-2011), and Panama (2008).

First, we construct an index of wealth based on household assets in the different countries using Principle Components Analysis. Once a poverty index is constructed, students seek to understand what the main drivers of wealth/poverty are in different countries. We include variables for health, education, age, relationship to the household head, and sex. Students then use regression analysis to identify the main drivers of poverty in different countries.

This data expedition explores the local (ego) patent citation networks of three hybrid vehicle-related patents. The concept of patent citations and technological development is a core theme in innovation and entrepreneurship, and the purpose of these network explorations is to both quantitatively and visually assess how innovations are connected and what these connections mean for the focal innovations and the technologies that draw on those patents in the future. The expedition was incorporated as part of the Sociology of Entrepreneurship class, where students are thinking about the emergence and diffusion of innovations.