Half life in mean-reversion strategy

Hi , 

I have the following questions after watching mean-reversion strategy lectures :

  1. Section 4 Unit 1 - theta mentioned as an eigenvalue. half life = log2/theta. How was eigenvalue calculated in Johansen test in given example ?
  2. Section 4 Unit 4 - here are theta mentioned as a regression beta between spread and difference between spread. why here theta=  model_s.params[0] ? what will be if theta=  model_s.params or theta=  model_s.params[y] ? what will be if I will not execute model_s = model_s.fit() ?
  3. What is actually theta ? Is it eigenvalue or beta ? Or it is the same thing ? 
  4. I have seen the following formula for theta : theta = -lnB/t , where B - beta , t - time interval (t=1/252) in some research papers. And then we apply half life = ln2/theta. Can these formula also be used for the purpose of calculating half life ?



    Thank's in advance.
1.  The Johansen test function returns the eigenvalue. The exact implementation can be found in the last section --> downloadables unit --> Triplets folder --> johansen.py (line 103 to 217)

2.  The model.params[0] returns the slope of the regression between the difference in spread vs spread. The half-life is not related to the regression between the prices of the two instruments x and y. That regression gives the hedge ratio. The fit method is used to fit the best line.

3.  If we only have two instruments, theta can be found either by Johansen test or by linear regression. If there are more than 2 instruments, only Johansen test can find the theta. 

4.  Half-life is not a dimensionless quantity - it has a dimension of time. So its numerical value depends on the unit of measurement. If the time series is measured in trading days than the half-life will be measured in trading days. If instead, you want to measure it in years, you have to divide it by 252.

I hope this helps.
 
Hi, 

1. Section 4 Unit 1 - theta mentioned as an eigenvalue. half life = log2/theta. How was eigenvalue calculated in Johansen test in given example ?
 
In the output of the Johansen test you can find the Eigen values in the statistics.
 
results.eig
https://www.statsmodels.org/dev/generated/statsmodels.tsa.vector_ar.vecm.JohansenTestResult.html#statsmodels.tsa.vector_ar.vecm.JohansenTestResult
 
. Section 4 Unit 4 - here are theta mentioned as a regression beta between spread and difference between spread. why here theta=  model_s.params[0] ? what will be if theta=  model_s.params[x] or theta=  model_s.params[y] ?
 
Here you are getting Theta by mean of a linear regression rather than with the Johansen test.
https://www.statsmodels.org/dev/examples/notebooks/generated/ols.html
 
what will be if I will not execute model_s = model_s.fit() ?
 
If you don’t fit (execute) the model, you don’t get any result.
 
3. What is actually theta ? Is it eigenvalue or beta ? Or it is the same thing ? 
 
Theta could be the eigenvalue from Johansen test or the beta from the linear regression
 
4. I have seen the following formula for theta in some research papers.: 
theta = -lnB/t , 
where B - beta ,
t - time interval (t=1/252) 
And then we apply half life = ln2/theta. Can these formula also be used for the purpose of calculating half life ?
 
There are several approaches to compute the half-life, you must to be sure that you understand the method and the reasoning behind it. 
 
The Johansen Test explained: