Course Name: Mean Reversion Strategies In Python, Section No: 1, Unit No: 1, Unit type: Video
In the Triplets code example ev has been assigned twice, is this ok or is it a typo?
ev = result.evec ev = result.evec.T[0] ev = ev/ev[0]
Course Name: Mean Reversion Strategies In Python, Section No: 1, Unit No: 1, Unit type: Video
In the Triplets code example ev has been assigned twice, is this ok or is it a typo?
ev = result.evec ev = result.evec.T[0] ev = ev/ev[0]
Hi Ankit,
Firstly, the progress you have made in the course on Mean Reversion Strategies is really impressive.
To answer your question,
In the notebook on 'Mean Reversion on Triplets Code', under the 'Calculate Spread' section, you can check the values in 'ev' after each of the 3 steps mentioned above, in order to get a better perspective.
For example, here's what the outputs would look like at each step:
Note that, there is no need to follow this stepwise approach, as you can get the exact same output by running just 1 line of code as shown below:
ev = result.evec.T[0] / result.evec.T[0][0]
However, at Quantra, we try our best to simplify the concepts covered within every course unit. And hence, you will find the code broken down into 3 easy-to-follow steps.
Going forward, I also encourage you to go ahead and tweak the code in the notebooks by yourself (as shown in the above example), as this will surely help you get a much better understanding of everything that's being covered.
I hope this was helpful in clarifying your doubt.
Do feel free to reach out if you come across any more questions in the future.
Warm Regards,
Kevin