Page 1 of 1
how to include an integral in dynare code?
Posted:
Tue Apr 05, 2011 10:35 pm
by danmx
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.
Dan.
Re: how to include an integral in dynare code?
Posted:
Wed Apr 06, 2011 7:54 pm
by jpfeifer
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
http://www.columbia.edu/~mu2166/nberma/nberma_expanded.pdf
Re: how to include an integral in dynare code?
Posted:
Tue Dec 11, 2012 7:45 pm
by paulofnm
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.
Thanks.
Re: how to include an integral in dynare code?
Posted:
Sat Dec 29, 2012 9:39 am
by jpfeifer
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.