The QuantEcon libraries already have the tauchen and rouwenhorst methods for discretizing AR(1) processes, reducing them to finite Markov chains. Here’s a more general approach, that could be used for discretizing other state processes.
I think it would be a good addition to both libraries (Python lib and Julia lib)
I’ve discussed this with Alexis Toda and he’s given permission to port his Matlab code to Julia and Python, and to disseminate it under an open source licence of our choosing.
If anyone wants to work on the conversion please let me know (or submit a PR to corresponding GitHub repo).