1

I need to solve max (a', m') f(a, m, e, m', a'). I have approximated f with a grid F - it has shape (nA, nM, nE, nM, nA). Now, I want to interpolate over the last two dimensions (the one I need to maximize over, and then maximize.
The following is the only code I could come up with. It looks to...