QuantEcon.py icon indicating copy to clipboard operation
QuantEcon.py copied to clipboard

Simple interface to specifying models in DiscreteDP

Open jstac opened this issue 8 years ago • 4 comments

@oyamad This is just a wish list idea that I'm noting down while I think of it. (Perhaps other people have mentioned it too.)

It would be nice to have an interface to specifying discrete DP models for DiscreteDP by a simplified version of what @albop has built for dolo:

http://dolo.readthedocs.org/en/doc/modeling_language.html#example

The interface would allow you to easily specify

  • the feasible state action pairs,
  • the transition probs
  • the rewards for each state action pair

A numbafied routine would map that specification to an instance of DiscreteDP.

This code would be greatly simplified and more attractive to users: http://quant-econ.net/py/aiyagari.html

Same goes for the Julia side.

jstac avatar Feb 14 '16 15:02 jstac

@jstac Thanks for the suggestion. Let me think about it.

I suppose you are not suggesting we invent a "modeling language" as in dolo. Maybe we should start with a simple example.

oyamad avatar Feb 15 '16 15:02 oyamad

We'll definitely need input from @albop on this, but to me it makes sense to extend the modeling language of dolo to allow the input of dtdsdc (discrete time discrete state discrete control) models that leverages this code as a compilation backend and solution routine

sglyon avatar Feb 15 '16 15:02 sglyon

Please disregard that last comment (that has been deleted). I accidentally posted to the wrong repository. Sorry for the noise

sglyon avatar Feb 15 '16 16:02 sglyon

A quick feedback before I come back from holidays:

The model presented in the lecture corresponds to a dtcscc model for the partial eq case so it can be defined using the existing dolo syntax, modulo some terminological adjustments. Then it would be relatively easy to write a translator/wrapper to translate to the few matrices that discretedp operates on. That would essentially be be another solution method, a good dolo application and a way to strengthen the links between the two libraries. In a similar vein, there is ongoing work to describe and solve the very same heterogeneous agents model in dolo. We expect to finish it by the end of next week.

There is a different problem which consists in defining a syntax for matrices and operations on them. There is some limited support for matrices in dolo/dtmscc models to define Markov matrices, discretize shocks and combine them together, but I have never found it completely convincing and have always wanted to find something more systematic and robust. Another way to construct Markov matrices (not in this example) would be to allow for conditional expressions which don't exist yet.

Basically depending on how transparent you want the construction of the model matrices to be in the lectures, depending on whether the model is discrete or discetized I would suggest one way or the other.

albop avatar Feb 16 '16 23:02 albop