How to include an integral in dynare code?

Hi everybody! I’m triying to replicate a paper wich include price dispersion in input demands, i.e. i have an expresion like: ∫_0^1〖(P_t/(P_t (i)))^θ di〗. My question is, someone knows how can i include the integral into the dynare code? Thanks in advance.


There is no way to enter this integral directly. The way to go is usually to define an auxiliary variable s=∫_0^1〖(P_t/(P_t (i)))^θ di〗which is substituted for every occurence of the integral. Moreover, there appears a law of motion for this variable s, see page 19 of

Is there a way to include in Dynare an integral of the type above but with a variable parameter \theta (=\theta_t)?

This would be useful for writing nonlinear models with mark-up shocks, where \theta follows some ARMA process (as in Smets and Wouters (AER, 2007)).

The trick suggested by jpfeifer does not work in this case. It seems the integral does not have a recursive representation when \theta varies in time.


In this case, the trick works similar, but only if you linearize the model by hand. Have a look at the model appendix to Smets/Wouters (2007) posted on the AER homepage. For the general non-linear case, there is no way as far as I know.