I have the following questions after watching mean-reversion strategy lectures :
Section 4 Unit 1 - theta mentioned as an eigenvalue. half life = log2/theta. How was eigenvalue calculated in Johansen test in given example ?
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() ?
What is actually theta ? Is it eigenvalue or beta ? Or it is the same thing ?
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 ?
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.
. 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.