Theta for computing mean reversion half life

In the lecture, the equation to find half life is given as log(2)/theta where theta is the eigenvalue of the Johansen test. However, in the coding example that follows the half life lecture, the value of theta was derived from a CADF as opposed to taking it from a Johansen test and it is obtained by running a linear regression on the difference between mean of spread and spread, and the difference between tomorrow's value of spread and today's value of spread.



Based on the above, I have two questions which I am hoping to get some help on:

1.) what is the code to get the eigenvalue attributes from the Johansen test result

2.) can someone explain the logic in the method above to obtain the eigenvalue from a CADF?



Many thanks in advance,

Ryan

Hello Ryan, thanks for your question.



1) In the notebook, you can get the eigenvalue using the code:



# Store the results of Johansen test

result = coint_johansen(df[:90], 0, 1)



# Store the value of eigenvector. Using this eigenvector, you can create the spread

ev = result.evec



2) The CADF returns a t-statistic and not an eigenvalue.