Num Py Markov Chains I
Num Py Markov Chains I
net
The close price is the fifth number in each tuple. We should have a list of about 253 close prices now.
The nice thing about this NumPy code, is that there were very few for loops. I am willing to bet that it is much faster than equivalent normal Python code, so it would be nice to measure the difference. Lets leave this as an exercise for the reader. Next time we will compute the transition probabilities for the various states. We will need these numbers to do fancy things with the stochastic matrix and steady state vector. If you liked this post and are interested in NumPy check out NumPy Beginners Guide by yours truly.