Dynamic Programming in QuantEcon.jl

Hello everyone :slightly_smiling_face:

I am struggling to implement them efficiently in my code.

Can anyone suggest best practices and resources for optimizing performance; especially for high dimensional problems?

thanks :hugs:

Hi Madison,
I think that dynamic programming is always a challenge as you increase the number of dimensions with these methods, so it might help us if you can say roughly what number of dimensions and what algorithms in QuantEcon.jl you were intending to use? Depending on the circumstances, it is better to implement code from scratch.

To a first-order, I think the algorithm choice is the one which matters most - but it is problem dependent.

-Jesse

How many dimensions are you dealing with? It’s hard to make concrete suggestions without more information about your specific problem, but a personal rule of thumb is:

  1. if Ndim \leq 3, then `conventional’ methods like VFI, PFI, etc. on a regular grid will do fine, especially if you can parallelize across the states and exploit Julia’s column major format.
  2. if 3 < Ndim \leq \approx 20, then you’ll probably have to look into Smolyak’s method or adaptive sparse grids. However, if your problem isn’t `nice’ e.g. it has kinks and discontinuities, then Smolyak’s method wouldn’t work.
  3. For Ndim > 20, you’d have to use machine learning methods like Gaussian processes or neural networks.