how to include an integral in dynare code?

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

how to include an integral in dynare code?

Postby danmx » Tue Apr 05, 2011 10:35 pm

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.
danmx
 
Posts: 1
Joined: Tue Apr 05, 2011 10:08 pm

Re: how to include an integral in dynare code?

Postby jpfeifer » Wed Apr 06, 2011 7:54 pm

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
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: how to include an integral in dynare code?

Postby paulofnm » Tue Dec 11, 2012 7:45 pm

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.
paulofnm
 
Posts: 1
Joined: Thu Jul 05, 2012 11:19 pm

Re: how to include an integral in dynare code?

Postby jpfeifer » Sat Dec 29, 2012 9:39 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 5 guests