Johansen Test doen;t depend on the order of the time series

Hi,



I learned from the lecture video that Johansen Test doen't depend on the order of the time series. But seems it's giving me different ev = ev/ev[0] result, hence the different pairs.



For example, in the example code:

df_x = pd.read_excel("GLD2.xls",index_col=0)
df_y = pd.read_excel("GDX2.xls",index_col=0)
df_z = pd.read_excel("USO2.xls",index_col=0)

# Combine data files
df = pd.DataFrame({'x':df_x['Adj Close'],'y':df_y['Adj Close'],'z':df_z['Adj Close']})


This give me the result:

Spread = 1.0.GLD + (-0.8155950410401775).GDX + (0.5157666154100387).USO


If i change the sequence of df from x,y,z, to y, z, x:

# Read data from CSV file
df_y = pd.read_excel("GLD2.xls",index_col=0)
df_z = pd.read_excel("GDX2.xls",index_col=0)
df_x = pd.read_excel("USO2.xls",index_col=0)

# Combine data files
df = pd.DataFrame({'x':df_x['Adj Close'],'y':df_y['Adj Close'],'z':df_z['Adj Close']})


The result become:

Spread = 1.0.USO + (5.072124838238447).GLD + (8.819001369584223).GDX


Seems it becomes a different combination. All 3 names on the long side.

May i ask how to explaine this?

Thanks.

 

Hi Evian,



Johansen test is used to check whether the spread is cointegrated or not similar to the ADF test. 



Here you are talking about the hedge ratio, after changing the order of time series, you get different hedge ratio. But while checking the cointegration of the spread, the order of time series doesn't matter. This you can observe through the value of Trace Statistics and Eigen Statistics.