Skip to content

applies low-pass filtering on historical data of stocks and then plots its phase space

Notifications You must be signed in to change notification settings

frizchar/phase-space-reconstruction-of-financial-time-series

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Phase space reconstruction of financial data

Overview

In this project we attempt to reconstruct the phase space of the AAPL stock based on Doyne Farmer's famous paper Geometry from a Time Series.
Namely, any time series $\{x_i\}$ may be restructured as $d$-dimensional vectors of the form

$\vec{x_i} = (x_i, x_{i+\tau}, x_{i+2\tau}, ..., x_{i+(d-1)\cdot\tau})$

where d is the embedding dimension of the phase space and $\tau$ is the time delay parameter.

Specifically, we follow the steps below:

  1. pull historical data of the selected stock using the yfinance package
  2. apply a low-pass Butterworth filter on the data, in order to extract the low-frequency signal
  3. plot the stock time-series **
  4. plot the $3$-dimensional ($d = 3$) reconstructed phase space of the time-series **
    ** applied to both initial and filtered time series

Input parameters

  • TICKER_SYMBOL (string):= ticker symbol of selected stock
  • START_DATE (string):= start date of historical data in 'YYYY-MM-DD' format
  • END_DATE (string):= end date of historical data in 'YYYY-MM-DD' format
  • CUTOFF_FREQ (float):= cutoff frequency for the low-pass filter
  • SAMPLE_RATE (float):= sampling rate of the input data used for the low-pass filter
  • ORDER (int):= order of the Butterworth low-pass filter
  • TIME_DELAY_PARAMETER (int):= time delay parameter of the phase space embedding

Dependencies

The required packages are included in file requirements.txt.
Python interpreter version used for this project: 3.9.4

Results

graphs

About

applies low-pass filtering on historical data of stocks and then plots its phase space

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages