Hi, I tried running your code with the newest version of numpy and I am getting a ValueError for the function ts_regimes, line 30. I think this is due to the way numpy now handles inhomogeneous arrays. What would be an easy fix? Thanks!