econ-ark / HARK

Heterogenous Agents Resources & toolKit
Apache License 2.0
336 stars 199 forks source link

Automatic normalization of configured models #711

Open sbenthall opened 4 years ago

sbenthall commented 4 years ago

Building on #491 ...

A key part of the economics research method used by HARK researchers is normalization. http://www.econ2.jhu.edu/people/ccarroll/SolvingMicroDSOPs/

A model defined with a configuration dictionary might be amenable to normalization, simplifying the state space and control function.

This issue is for:

sbenthall commented 4 months ago

We now are using SymPy to parse strings for model equations into symbolic expressions.

I know @alanlujan91 has made progress on composing these symbolic expressions to build new expressions relevant to e.g. EGM equations.

It's possible that SymPy has some functionality in it that could find simplifications or reductions of a model auto-algebraically.

alanlujan91 commented 4 months ago

In practice I use a lot of cancel and simplify.

https://docs.sympy.org/latest/tutorials/intro-tutorial/simplification.html

What also helps with sympy is having well defined symbols with assumptions (real? positive? negative?) as this helps cancel and simplify some expressions.