Learn practical skills, build real-world projects, and advance your career

Cointegration Analysis and Estimation

In this report, we test cointegration realtionship between 909 pairs of funds to see if there exists a linear combination of each two funds.
There are two approaches used: coint method in statsmodels package, and the Cointegrated Augmented Dickey-Fuller test.

import numpy as np
import pandas as pd
import pandas_datareader.data as web
import datetime
import matplotlib.pyplot as plt
from scipy import integrate
import statsmodels
filepath = 'D:\\650internship\\620\\'
ticker = pd.read_csv(filepath+'portformer_peers2.csv')

We test the stationarity of prices of each two funds and if it is non-stationary and same-order stationary, then test the cointegration.