EconForge / dolo.py

Economic modelling in python
BSD 2-Clause "Simplified" License
98 stars 72 forks source link

docs: v_t defined as function of v_t ? #235

Open sbenthall opened 1 year ago

sbenthall commented 1 year ago

In the documentation of the (non-separable) value function, the signature is given as:

$v_t = w(s_t,x_t,vt,s{t+1},x{t+1},v{t+1})$

Note that $v_t$ is repeated on both sides of the equation. Is that intentional?

See:

https://github.com/EconForge/dolo.py/blob/master/docs/model_specification.md#value https://dolo.readthedocs.io/en/latest/model_specification.html#value

albop commented 1 year ago

yes, it is a general updating equation. It is there to accommodate nonseparable value function like epstein-zin formulation. It is also defined as such in the recipes file https://github.com/EconForge/dolo.py/blob/master/dolo/compiler/recipes.yaml

For the "reward" there is an additional felicity function which is purely intratemporal.

In any case, this could use some dust cleaning, or some name renormalization: the VFI algorithm was never very advanced in dolo

On Wed, Apr 5, 2023 at 4:37 PM Sebastian Benthall @.***> wrote:

In the documentation of the (non-separable) value function, the signature is given as:

$v_t = w(s_t,x_t,vt,s{t+1},x{t+1},v{t+1}$

Note that $v_t$ is repeated on both sides of the equation. Is that intentional?

See:

https://github.com/EconForge/dolo.py/blob/master/docs/model_specification.md#value https://dolo.readthedocs.io/en/latest/model_specification.html#value

— Reply to this email directly, view it on GitHub https://github.com/EconForge/dolo.py/issues/235, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACDSKJWJM5HONOBB2F5EYDW7V7UDANCNFSM6AAAAAAWUFMIDY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

sbenthall commented 1 year ago

I'm sorry if this is a dense question, but isn't $v_t = v_t$ always, so if $v_t$ is an argument to $w$, the function is trivial?

albop commented 1 year ago

Actually the way I did Epstein-Zin a while ago was by iterating on two variables:

V_t <- U(ct) + \beta (V{t+1}/EV_t^{1/alpha})^{-\gamma} EVt <- (V{t+1})^\alpha

In equilibrium, EV_t is of course the same on the left and on the right.

I admit it is a little bit of a corner case ....

In other applications, I used arbitrage equations for the same purpose (treating left and right hand side in the same way) but that is also not super satisfying.

sbenthall commented 1 year ago

Oh, I see. So with some solution algorithms, you might run this to convergence to solve for a single period, before incrementing t.

So there's two update/convergence loops?

Is the solution algorithm for this in the repository?