userguide: adding modifications

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1294 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
michel 2007-06-02 10:18:07 +00:00
parent 2101ecf15f
commit 9edf217598
13 changed files with 821 additions and 719 deletions

View File

@ -1,4 +1,8 @@
\documentclass[a4paper,11pt,titlepage]{memoir}
\maxsecnumdepth{subsection}
\setsecnumdepth{subsection}
\maxtocdepth{subsection}
\settocdepth{subsection}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
@ -31,7 +35,7 @@ pdftex}
\begin{document}
\frontmatter
\title{Dynare User Guide}
\title{Dynare v4 - User Guide \\ÊPublic beta version}
\author{\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ Tommaso Mancini Griffoli\\ tommaso.mancini@stanfordalumni.org}
\date{This draft: March 2007}
@ -45,7 +49,7 @@ pdftex}
\chapter*{Work in Progress!}
This is the second version of the Dynare User Guide which is still work in progress! This means two things. First, please read this with a critical eye and send me comments! Are some areas unclear? Is anything plain wrong? Are some sections too wordy, are there enough examples, are these clear? On the contrary, are there certain parts that just click particularly well? How can others be improved? I'm very interested to get your feedback. \\
The second thing that a work in progress manuscript comes with is messy and disturbing notes to myself or others of the Dynare development team. These are marked with two stars (**). Just ignore whatever follows them... although there should not be too many. \\
The second thing that a work in progress manuscript comes with is messy and disturbing notes to myself or others of the Dynare development team. These are marked with two stars (**). Just ignore whatever follows them... although there should not be too many left. \\
Thanks very much for your patience and good ideas. Please write either direclty to myself: tommaso.mancini@stanfordalumni.org, or \textbf{preferably on the Dynare Documentation Forum} available in the Forum section of the \href{http://www.cepremap.cnrs.fr/juillard/mambo/index.php?option=com_forum&Itemid=95}{Dynare website}.
@ -56,16 +60,16 @@ Dynare was originally developed by Michel Juillard in Paris, France. Currently,
\item StŽphane Adjemian (stephane.adjemian``AT''ens.fr)
\item Michel Juillard (michel.juillard``AT''ens.fr)
\item Ferhat Mihoubi (ferhat.mihoubi``AT''univ-evry.fr)
\item Ondra Kamenik (** email?)
\item Marco Ratto (** email?)
\item SŽbastien Villemont (sebastien.villemont``AT''ens.fr)
\item Ondra Kamenik (ondra.kamenik"AT"volny.cz)
\item Marco Ratto (marco.ratto"AT"jrc.it)
\item SŽbastien Villemot (sebastien.villemot``AT''ens.fr)
\end{itemize}
Several parts of Dynare use or have strongly benefitted from publicly available programs by F. Collard, L. Ingber, P. Klein, S. Sakata, F. Schorfheide, C. Sims, P. Soederlind and R. Wouters. \\
Finally, the development of Dynare could not have come such a long ways withough an active community of users who continually pose questions, report bugs and suggest new features. The help of this community is gratefully acknowledged.\\
The email addresses above are provided in case yo wish to contact any one of the authors of Dynare directly. We nonetheless encourage you to first use the \href{http://www.cepremap.cnrs.fr/juillard/mambo/index.php?option=com_forum&Itemid=95}{Dynare forums} to ask your questions so that other users can benefit from them as well; remember, almost no question is specific enough to interest just one person, and yours is not the exception!
The email addresses above are provided in case you wish to contact any one of the authors of Dynare directly. We nonetheless encourage you to first use the \href{http://www.cepremap.cnrs.fr/juillard/mambo/index.php?option=com_forum&Itemid=95}{Dynare forums} to ask your questions so that other users can benefit from them as well; remember, almost no question is specific enough to interest just one person, and yours is not the exception!
\mainmatter

View File

@ -1,98 +1,102 @@
\relax
\citation{Schorfheide2000}
\citation{CogleyNason1994}
\@writefile{lof}{\addvspace {10pt}}
\@writefile{lot}{\addvspace {10pt}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {6}Estimating DSGE models - advanced topics}{57}{chapter.6}}
\newlabel{ch:estadv}{{6}{57}{\@empty \relax }{chapter.6}{}}
\@writefile{toc}{\contentsline {section}{\numberline {6.1}A complete, complex and non-stationary example}{57}{section.6.1}}
\@writefile{toc}{\contentsline {subsection}{Introducing the example}{57}{section.6.1}}
\citation{Schorfheide2000}
\newlabel{fig:schorfmod}{{6.1}{58}{\@empty \relax }{section.6.1}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {6.1}{\ignorespaces CIA model illustration}}{58}{figure.6.1}}
\citation{Hamilton1994}
\citation{CogleyNason1994}
\@writefile{toc}{\contentsline {subsection}{Declaring variables and parameters}{62}{Item.59}}
\@writefile{toc}{\contentsline {subsection}{The origin of non-stationarity}{62}{Item.59}}
\newlabel{sec:nonstat}{{6.1}{62}{\@empty \relax }{Item.59}{}}
\citation{CogleyNason1994}
\@writefile{toc}{\contentsline {subsection}{Stationarizing variables}{63}{Item.59}}
\@writefile{toc}{\contentsline {subsection}{Linking stationary variables to the data}{64}{Item.59}}
\@writefile{toc}{\contentsline {subsection}{The resulting model block of the .mod file}{64}{Item.59}}
\@writefile{toc}{\contentsline {subsection}{Declaring observable variables}{65}{Item.59}}
\@writefile{toc}{\contentsline {subsection}{Declaring trends in observable variables}{65}{Item.59}}
\citation{DurbinKoopman2001}
\@writefile{toc}{\contentsline {subsection}{Declaring unit roots in observable variables}{66}{Item.59}}
\@writefile{toc}{\contentsline {subsection}{Specifying the steady state}{67}{Item.59}}
\@writefile{toc}{\contentsline {subsection}{Declaring priors}{67}{Item.59}}
\@writefile{toc}{\contentsline {subsection}{Launching the estimation}{67}{Item.59}}
\@writefile{toc}{\contentsline {subsection}{The complete .mod file}{68}{Item.59}}
\citation{Schorfheide2000}
\@writefile{toc}{\contentsline {subsection}{Summing it up}{69}{Item.59}}
\newlabel{fig:estsumm}{{6.1}{70}{\@empty \relax }{Item.59}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {6.2}{\ignorespaces Steps of model estimation}}{70}{figure.6.2}}
\@writefile{toc}{\contentsline {section}{\numberline {6.2}Comparing models based on their posterior distributions}{70}{section.6.2}}
\@writefile{toc}{\contentsline {section}{\numberline {6.3}Comparing output to BVARs}{70}{section.6.3}}
\@writefile{toc}{\contentsline {section}{\numberline {6.4}Where is your output stored?}{70}{section.6.4}}
\@setckpt{ch-estadv}{
\setcounter{page}{71}
\setcounter{equation}{0}
\setcounter{enumi}{12}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{2}
\setcounter{mpfootnote}{0}
\setcounter{storedpagenumber}{1}
\setcounter{part}{0}
\setcounter{chapter}{6}
\setcounter{section}{4}
\setcounter{subsection}{0}
\setcounter{subsubsection}{0}
\setcounter{paragraph}{0}
\setcounter{subparagraph}{0}
\setcounter{@ppsavesec}{0}
\setcounter{@ppsaveapp}{0}
\setcounter{vslineno}{0}
\setcounter{poemline}{0}
\setcounter{modulo@vs}{0}
\setcounter{verse}{0}
\setcounter{chrsinstr}{0}
\setcounter{newflo@tctr}{4}
\setcounter{@contsubnum}{0}
\setcounter{maxsecnumdepth}{1}
\setcounter{sheetsequence}{79}
\setcounter{lastsheet}{100}
\setcounter{lastpage}{92}
\setcounter{bvlinectr}{0}
\setcounter{cp@cntr}{0}
\setcounter{ism@mctr}{0}
\setcounter{xsm@mctr}{0}
\setcounter{csm@mctr}{0}
\setcounter{ksm@mctr}{0}
\setcounter{xksm@mctr}{0}
\setcounter{cksm@mctr}{0}
\setcounter{msm@mctr}{0}
\setcounter{xmsm@mctr}{0}
\setcounter{cmsm@mctr}{0}
\setcounter{bsm@mctr}{0}
\setcounter{workm@mctr}{0}
\setcounter{figure}{2}
\setcounter{lofdepth}{1}
\setcounter{lofdepth}{1}
\setcounter{table}{0}
\setcounter{lotdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{parentequation}{0}
\setcounter{r@tfl@t}{0}
\setcounter{NAT@ctr}{0}
\setcounter{Item}{59}
\setcounter{definition}{0}
\setcounter{lemma}{0}
\setcounter{property}{0}
\setcounter{theorem}{0}
\setcounter{remark}{0}
\setcounter{lofdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{section@level}{0}
}
\relax
\citation{Schorfheide2000}
\citation{CogleyNason1994}
\@writefile{lof}{\addvspace {10pt}}
\@writefile{lot}{\addvspace {10pt}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {6}Estimating DSGE models - advanced topics}{57}{chapter.6}}
\newlabel{ch:estadv}{{\M@TitleReference {6}{Estimating DSGE models - advanced topics}}{57}{\relax }{chapter.6}{}}
\@writefile{toc}{\contentsline {section}{\numberline {6.1}A complete, complex and non-stationary example}{57}{section.6.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1.1}Introducing the example}{57}{subsection.6.1.1}}
\citation{Schorfheide2000}
\newlabel{fig:schorfmod}{{\M@TitleReference {6.1.1}{Introducing the example}}{58}{Introducing the example\relax }{subsection.6.1.1}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {6.1}{\ignorespaces CIA model illustration}}{58}{figure.6.1}}
\citation{Hamilton1994}
\citation{CogleyNason1994}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1.2}Declaring variables and parameters}{61}{subsection.6.1.2}}
\citation{CogleyNason1994}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1.3}The origin of non-stationarity}{62}{subsection.6.1.3}}
\newlabel{sec:nonstat}{{\M@TitleReference {6.1.3}{The origin of non-stationarity}}{62}{The origin of non-stationarity\relax }{subsection.6.1.3}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1.4}Stationarizing variables}{62}{subsection.6.1.4}}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1.5}Linking stationary variables to the data}{63}{subsection.6.1.5}}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1.6}The resulting model block of the .mod file}{63}{subsection.6.1.6}}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1.7}Declaring observable variables}{64}{subsection.6.1.7}}
\citation{DurbinKoopman2001}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1.8}Declaring trends in observable variables}{65}{subsection.6.1.8}}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1.9}Declaring unit roots in observable variables}{65}{subsection.6.1.9}}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1.10}Specifying the steady state}{66}{subsection.6.1.10}}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1.11}Declaring priors}{66}{subsection.6.1.11}}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1.12}Launching the estimation}{66}{subsection.6.1.12}}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1.13}The complete .mod file}{67}{subsection.6.1.13}}
\citation{Schorfheide2000}
\newlabel{fig:estsumm}{{\M@TitleReference {6.1.14}{Summing it up}}{69}{Summing it up\relax }{subsection.6.1.14}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {6.2}{\ignorespaces Steps of model estimation}}{69}{figure.6.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1.14}Summing it up}{69}{subsection.6.1.14}}
\@writefile{toc}{\contentsline {section}{\numberline {6.2}Comparing models based on their posterior distributions}{69}{section.6.2}}
\@writefile{toc}{\contentsline {section}{\numberline {6.3}Comparing output to BVARs}{69}{section.6.3}}
\@writefile{toc}{\contentsline {section}{\numberline {6.4}Where is your output stored?}{69}{section.6.4}}
\@setckpt{ch-estadv}{
\setcounter{page}{70}
\setcounter{equation}{0}
\setcounter{enumi}{12}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{2}
\setcounter{mpfootnote}{0}
\setcounter{storedpagenumber}{1}
\setcounter{part}{0}
\setcounter{chapter}{6}
\setcounter{section}{4}
\setcounter{subsection}{0}
\setcounter{subsubsection}{0}
\setcounter{paragraph}{0}
\setcounter{subparagraph}{0}
\setcounter{@ppsavesec}{0}
\setcounter{@ppsaveapp}{0}
\setcounter{vslineno}{0}
\setcounter{poemline}{0}
\setcounter{modulo@vs}{0}
\setcounter{verse}{0}
\setcounter{chrsinstr}{0}
\setcounter{poem}{0}
\setcounter{newflo@tctr}{4}
\setcounter{@contsubnum}{0}
\setcounter{maxsecnumdepth}{2}
\setcounter{sheetsequence}{78}
\setcounter{lastsheet}{96}
\setcounter{lastpage}{90}
\setcounter{bvlinectr}{0}
\setcounter{cp@cntr}{0}
\setcounter{ism@mctr}{0}
\setcounter{xsm@mctr}{0}
\setcounter{csm@mctr}{0}
\setcounter{ksm@mctr}{0}
\setcounter{xksm@mctr}{0}
\setcounter{cksm@mctr}{0}
\setcounter{msm@mctr}{0}
\setcounter{xmsm@mctr}{0}
\setcounter{cmsm@mctr}{0}
\setcounter{bsm@mctr}{0}
\setcounter{workm@mctr}{0}
\setcounter{figure}{2}
\setcounter{lofdepth}{1}
\setcounter{lofdepth}{1}
\setcounter{table}{0}
\setcounter{lotdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{book}{0}
\setcounter{pagenote}{0}
\setcounter{lofdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{parentequation}{0}
\setcounter{r@tfl@t}{0}
\setcounter{NAT@ctr}{0}
\setcounter{Item}{58}
\setcounter{memhycontfloat}{0}
\setcounter{definition}{0}
\setcounter{lemma}{0}
\setcounter{property}{0}
\setcounter{theorem}{0}
\setcounter{remark}{0}
\setcounter{section@level}{1}
}

View File

@ -1,81 +1,85 @@
\relax
\@writefile{lof}{\addvspace {10pt}}
\@writefile{lot}{\addvspace {10pt}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {5}Estimating DSGE models - basics}{45}{chapter.5}}
\newlabel{ch:estbase}{{5}{45}{\@empty \relax }{chapter.5}{}}
\@writefile{toc}{\contentsline {section}{\numberline {5.1}Introducing an example}{45}{section.5.1}}
\newlabel{sec:modsetup}{{5.1}{45}{\@empty \relax }{section.5.1}{}}
\@writefile{toc}{\contentsline {section}{\numberline {5.2}Declaring variables and parameters}{46}{section.5.2}}
\@writefile{toc}{\contentsline {section}{\numberline {5.3}Declaring the model}{46}{section.5.3}}
\@writefile{toc}{\contentsline {section}{\numberline {5.4}Declaring observable variables}{47}{section.5.4}}
\@writefile{toc}{\contentsline {section}{\numberline {5.5}Specifying the steady state}{47}{section.5.5}}
\@writefile{toc}{\contentsline {section}{\numberline {5.6}Declaring priors}{47}{section.5.6}}
\@writefile{toc}{\contentsline {section}{\numberline {5.7}Launching the estimation}{49}{section.5.7}}
\newlabel{sec:estimate}{{5.7}{49}{\@empty \relax }{section.5.7}{}}
\@writefile{toc}{\contentsline {section}{\numberline {5.8}The complete .mod file}{53}{section.5.8}}
\@writefile{toc}{\contentsline {section}{\numberline {5.9}Interpreting output}{54}{section.5.9}}
\@writefile{toc}{\contentsline {subsection}{Tabular results}{54}{section.5.9}}
\@writefile{toc}{\contentsline {subsection}{Graphical results}{54}{section.5.9}}
\@writefile{toc}{\contentsline {section}{\numberline {5.10}Dealing with non-stationary models}{56}{section.5.10}}
\@setckpt{ch-estbase}{
\setcounter{page}{57}
\setcounter{equation}{0}
\setcounter{enumi}{24}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{storedpagenumber}{1}
\setcounter{part}{0}
\setcounter{chapter}{5}
\setcounter{section}{10}
\setcounter{subsection}{0}
\setcounter{subsubsection}{0}
\setcounter{paragraph}{0}
\setcounter{subparagraph}{0}
\setcounter{@ppsavesec}{0}
\setcounter{@ppsaveapp}{0}
\setcounter{vslineno}{0}
\setcounter{poemline}{0}
\setcounter{modulo@vs}{0}
\setcounter{verse}{0}
\setcounter{chrsinstr}{0}
\setcounter{newflo@tctr}{4}
\setcounter{@contsubnum}{0}
\setcounter{maxsecnumdepth}{1}
\setcounter{sheetsequence}{65}
\setcounter{lastsheet}{100}
\setcounter{lastpage}{92}
\setcounter{bvlinectr}{0}
\setcounter{cp@cntr}{0}
\setcounter{ism@mctr}{0}
\setcounter{xsm@mctr}{0}
\setcounter{csm@mctr}{0}
\setcounter{ksm@mctr}{0}
\setcounter{xksm@mctr}{0}
\setcounter{cksm@mctr}{0}
\setcounter{msm@mctr}{0}
\setcounter{xmsm@mctr}{0}
\setcounter{cmsm@mctr}{0}
\setcounter{bsm@mctr}{0}
\setcounter{workm@mctr}{0}
\setcounter{figure}{0}
\setcounter{lofdepth}{1}
\setcounter{lofdepth}{1}
\setcounter{table}{0}
\setcounter{lotdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{parentequation}{0}
\setcounter{r@tfl@t}{0}
\setcounter{NAT@ctr}{0}
\setcounter{Item}{47}
\setcounter{definition}{0}
\setcounter{lemma}{0}
\setcounter{property}{0}
\setcounter{theorem}{0}
\setcounter{remark}{0}
\setcounter{lofdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{section@level}{0}
}
\relax
\@writefile{lof}{\addvspace {10pt}}
\@writefile{lot}{\addvspace {10pt}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {5}Estimating DSGE models - basics}{45}{chapter.5}}
\newlabel{ch:estbase}{{\M@TitleReference {5}{Estimating DSGE models - basics}}{45}{\relax }{chapter.5}{}}
\@writefile{toc}{\contentsline {section}{\numberline {5.1}Introducing an example}{45}{section.5.1}}
\newlabel{sec:modsetup}{{\M@TitleReference {5.1}{Introducing an example}}{45}{Introducing an example\relax }{section.5.1}{}}
\@writefile{toc}{\contentsline {section}{\numberline {5.2}Declaring variables and parameters}{46}{section.5.2}}
\@writefile{toc}{\contentsline {section}{\numberline {5.3}Declaring the model}{46}{section.5.3}}
\@writefile{toc}{\contentsline {section}{\numberline {5.4}Declaring observable variables}{47}{section.5.4}}
\@writefile{toc}{\contentsline {section}{\numberline {5.5}Specifying the steady state}{47}{section.5.5}}
\@writefile{toc}{\contentsline {section}{\numberline {5.6}Declaring priors}{47}{section.5.6}}
\@writefile{toc}{\contentsline {section}{\numberline {5.7}Launching the estimation}{49}{section.5.7}}
\newlabel{sec:estimate}{{\M@TitleReference {5.7}{Launching the estimation}}{49}{Launching the estimation\relax }{section.5.7}{}}
\@writefile{toc}{\contentsline {section}{\numberline {5.8}The complete .mod file}{53}{section.5.8}}
\@writefile{toc}{\contentsline {section}{\numberline {5.9}Interpreting output}{54}{section.5.9}}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.9.1}Tabular results}{54}{subsection.5.9.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.9.2}Graphical results}{55}{subsection.5.9.2}}
\@writefile{toc}{\contentsline {section}{\numberline {5.10}Dealing with non-stationary models}{56}{section.5.10}}
\@setckpt{ch-estbase}{
\setcounter{page}{57}
\setcounter{equation}{0}
\setcounter{enumi}{23}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{storedpagenumber}{1}
\setcounter{part}{0}
\setcounter{chapter}{5}
\setcounter{section}{10}
\setcounter{subsection}{0}
\setcounter{subsubsection}{0}
\setcounter{paragraph}{0}
\setcounter{subparagraph}{0}
\setcounter{@ppsavesec}{0}
\setcounter{@ppsaveapp}{0}
\setcounter{vslineno}{0}
\setcounter{poemline}{0}
\setcounter{modulo@vs}{0}
\setcounter{verse}{0}
\setcounter{chrsinstr}{0}
\setcounter{poem}{0}
\setcounter{newflo@tctr}{4}
\setcounter{@contsubnum}{0}
\setcounter{maxsecnumdepth}{2}
\setcounter{sheetsequence}{65}
\setcounter{lastsheet}{96}
\setcounter{lastpage}{90}
\setcounter{bvlinectr}{0}
\setcounter{cp@cntr}{0}
\setcounter{ism@mctr}{0}
\setcounter{xsm@mctr}{0}
\setcounter{csm@mctr}{0}
\setcounter{ksm@mctr}{0}
\setcounter{xksm@mctr}{0}
\setcounter{cksm@mctr}{0}
\setcounter{msm@mctr}{0}
\setcounter{xmsm@mctr}{0}
\setcounter{cmsm@mctr}{0}
\setcounter{bsm@mctr}{0}
\setcounter{workm@mctr}{0}
\setcounter{figure}{0}
\setcounter{lofdepth}{1}
\setcounter{lofdepth}{1}
\setcounter{table}{0}
\setcounter{lotdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{book}{0}
\setcounter{pagenote}{0}
\setcounter{lofdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{parentequation}{0}
\setcounter{r@tfl@t}{0}
\setcounter{NAT@ctr}{0}
\setcounter{Item}{46}
\setcounter{memhycontfloat}{0}
\setcounter{definition}{0}
\setcounter{lemma}{0}
\setcounter{property}{0}
\setcounter{theorem}{0}
\setcounter{remark}{0}
\setcounter{section@level}{1}
}

View File

@ -25,7 +25,7 @@ Suppose that the equation of motion of technology is a \textbf{stationary} AR(1)
c+i = y;\\
y = (k(-1)$\hat{}$alpha)*(exp(z)*l)$\hat{}$(1-alpha);\\
w = y*((epsilon-1)/epsilon)*(1-alpha)/l;\\
r = y*((epsilon-1)/epsilon)*alpha/k;\\
r = y*((epsilon-1)/epsilon)*alpha/k(-1);\\
i = k-(1-delta)*k(-1);\\
y\_l = y/l;\\
z = rho*z(-1)+e;\\
@ -38,7 +38,9 @@ This should not come as a surprise. Dynare must know which variables are observa
\texttt{varobs Y;}\\
\section{Specifying the steady state}
Before Dynare estimates a model, it first linearizes it around a steady state. Thus, a steady state must exist for the model and although Dynare can calculate it, we must give it a hand by declaring approximate values for the steady state. This is just as explained in details and according to the same syntax explained in chapter \ref{ch:solbase}, covering the \texttt{initval}, \texttt{steady} and \texttt{check} commands. (** how can Dynare find a steady state if it doesn't yet know the parameter values?) We therefore write **?? \\
Before Dynare estimates a model, it first linearizes it around a steady state. Thus, a steady state must exist for the model and although Dynare can calculate it, we must give it a hand by declaring approximate values for the steady state. This is just as explained in details and according to the same syntax outlined in chapter \ref{ch:solbase}, covering the \texttt{initval}, \texttt{steady} and \texttt{check} commands.
\textsf{\textbf{TIP!}} During estimation, in finding the posterior mode, Dynare recalculates the steady state of the model at each iteration of the optimization routine (more on this later), based on the newest round of parameters available. Thus, by providing approximate initial values and relying solely on the built-in Dynare algorithm to find the steady state (a numerical procedure), you will significantly slow down the computation of the posterior mode. Dynare will end up spending 60 to 70\% of the time recalculating steady states. It is much more efficient to write an external \textbf{Matlab steady state file} and let Dynare use that file to find the steady state of your model by algebraic procedure. For more details on writing an external Matlab file to find your model's steady state, please refer to section \ref{sec:findsteady} of chapter \ref{ch:solbase}. \\
\section{Declaring priors}
@ -60,13 +62,13 @@ UNIFORM\_PDF& $U(p_3,p_4)$ & $[p_3,p_4]$
\end{tabular}\\
\\
\\
where $\mu$ is the \texttt{PRIOR\_MEAN}, $\sigma$ is the \texttt{PRIOR\_STANDARD\_ERROR}, $p_3$ is the \texttt{PRIOR 3$^{\textrm{rd}}$ PARAMETER} (whose default is 0) and $p_4$ is the \texttt{PRIOR 4$^{\textrm{th}}$ PARAMETER} (whose default is 1). \\
where $\mu$ is the \texttt{PRIOR\_MEAN}, $\sigma$ is the \texttt{PRIOR\_STANDARD\_ERROR}, $p_3$ is the \texttt{PRIOR 3$^{\textrm{rd}}$ PARAMETER} (whose default is 0) and $p_4$ is the \texttt{PRIOR 4$^{\textrm{th}}$ PARAMETER} (whose default is 1). \textsf{\textbf{TIP!}} When specifying a uniform distribution between 0 and 1 as a prior for a parameter, say $\alpha$, you therefore have to put two empty spaces for parameters $\mu$ and $\sigma$, and then specify parameters $p3$ and $p4$, since the uniform distribution only takes $p3$ and $p4$ as arguments. For instance, you would write \texttt{alpha, uniform\_pdf, , , 0,1;} \\
For a more complete review of all possible options for declaring priors, as well as the syntax to declare priors for maximum likelihood estimation (not Bayesian), see the \href{http://www.cepremap.cnrs.fr/juillard/mambo/index.php?option=com_content&task=view&id=51&Itemid=84}{Reference Manual}. Note also that if some parameters in a model are calibrated and are not to be estimated, you should declare them as such, by using the \texttt{parameters} command and its related syntax, as explained in chapter \ref{ch:solbase}. \\
\textsf{\textbf{TIP!}} ** How to choose appropriate prior distribution, mean and standard error... add after discussion with experts (Michel, Stephane, etc..)\\
\textsf{\textbf{TIP!}} Choosing the appropriate prior for your parameters is a tricky, yet very important endeavor. It is worth spending time on your choice of priors and to test the robustness of your results to your priors. Some considerations may prove helpful. First, think about the domain of your prior over each parameter. Should it be bounded? Should it be opened on either or both sides? Remember also that if you specify a probability of zero over a certain domain in your prior, you will necessarily also find a probability of zero in your posterior distribution. Then, think about the shape of your prior distribution. Should it be symmetric? Skewed? If so, on which side? You may also go one step further and build a distribution for each of your parameters in your mind. Ask yourself, for instance, what is the probability that your parameter is bigger than a certain value, and repeat the exercise by incrementally decreasing that value. You can then pick the standard distribution that best fits your perceived distribution. Finally, instead of describing here the shapes and properties of each distribution, you are instead encouraged to visualize these distributions yourself, either in a statistics book or on the Web. \\
\textsf{\textbf{TIP!}} It may at times be desirable to estimate a transformation of a parameter appearing in the model, rather than the parameter itself. In such a case, it is possible to declare the parameter to be estimated in the parameters statement and to define the transformation at the top of the model section, as a Matlab expression, by adding a pound sign (\#) at the beginning of the corresponding line. For example:\\
\textsf{\textbf{TIP!}} It may at times be desirable to estimate a transformation of a parameter appearing in the model, rather than the parameter itself. In such a case, it is possible to declare the parameter to be estimated in the parameters statement and to define the transformation at the top of the model section, as a Matlab expression, by adding a pound sign (\#) at the beginning of the corresponding line. For example, you may find it easier to define a prior over the discount factor, $\beta$, than its inverse which often shows up in Euler equations. Thus you would write:\\
\\
\texttt{model;\\
\# sig = 1/bet;\\
@ -100,11 +102,6 @@ To ask Dynare to estimate a model, all that is necessary is to add the command \
\item first\_obs = INTEGER: the number of the first observation to be used (default = 1). This is useful when running loops, or instance, to divide the observations into sub-periods.
\item prefilter = 1: the estimation procedure demeans the data (default=0, no prefiltering). This is useful if model variables are in deviations from steady state, for instance, and therefore have zero mean. Demeaning the observations would also impose a zero mean on the observed variables.
\item nograph: no graphs should be plotted.
\item lik\_init: INTEGER: type of initialization of Kalman filter.
\subitem 1 (default): for stationary models, the initial matrix of variance of the error of forecast is set equal to the
unconditional variance of the state variables.
\subitem 2: for nonstationary models: a wide prior is used with an initial matrix of variance of the error of forecast
diagonal with 10 on the diagonal. When using \texttt{unit\_root\_vars}, the \texttt{like\_init} option as no effect. (** but if have both stationary and nonstationary variables, what option should you use?)
\item conf\_sig = \{INTEGER | DOUBLE \}: the level for the confidence intervals reported in the results (default = 0.90)
\item mh\_replic = INTEGER: number of replication for Metropolis Hasting algorithm. For the time being, mh\_replic
should be larger than 1200 (default = 20000)
@ -118,17 +115,17 @@ rarely satisfactory. This option must be tuned to obtain, ideally, an acceptance
Dynare stores the mode (xparam1) and the hessian (hh) in a file called MODEL NAME\_mode. This is a particularly helpful option to speed up the estimation process if you have already undertaken initial estimations and have values of the posterior mode.
\item mode\_compute=INTEGER: specifies the optimizer for the mode computation.
\subitem 0: the mode isnÕt computed. mode\_file must be specified
\subitem 1: uses Matlab fmincon (see the Reference Manual (** add link) to set options for this command).
\subitem 1: uses Matlab fmincon (see the \href{http://www.cepremap.cnrs.fr/juillard/mambo/index.php?option=com_content&task=view&id=51&Itemid=84}{Reference Manual} to set options for this command).
\subitem 2: uses Lester IngberÕs Adaptive Simulated Annealing.
\subitem 3: uses Matlab fminunc.
\subitem 4 (default): uses Chris SimÕs csminwel.
\item mode\_check: when mode\_check is set, Dynare plots the minus of the posterior density for values around the computed mode
for each estimated parameter in turn. This is helpful to diagnose problems with the optimizer. A clear indication of a problem would be that the mode is not at the trough (bottom of the minus) of the posterior distribution.
\item load\_mh\_file: when load\_mh\_file is declared, Dynare adds to previous Metropolis-Hastings simulations instead
of starting from scratch. Again, this is a useful option to speed up the process of estimation. (** a new recover mode in version 4?)
of starting from scratch. Again, this is a useful option to speed up the process of estimation.
\item nodiagnostic: doesnÕt compute the convergence diagnostics for Metropolis-Hastings (default: diagnostics are computed and
displayed). Actually seeing if the various blocks of Metropolis-Hastings runs converge is a powerful and useful option to build confidence in your model estimation. More details on these diagnostics are given in Chapter \ref{ch:estadv}.
\item bayesian\_irf: triggers the computation of the posterior distribution of impulse response functions (IRFs). The length of the IRFs are controlled by the irf option (** where, how?). The shocks at the origin of these IRFs are those estimated by Dynare.
\item bayesian\_irf: triggers the computation of the posterior distribution of impulse response functions (IRFs). The length of the IRFs are controlled by the irf option, as specified in chapter \ref{ch:solbase} when discussing the options for \texttt{stoch\_simul}. The shocks at the origin of these IRFs are those estimated by Dynare.
\item moments\_varendo: triggers the computation of the posterior distribution of the theoretical moments of the endogenous variables as in \texttt{stoch\_simul} (the posterior distribution of the variance decomposition is also included).
\item filtered\_vars: triggers the computation of the posterior distribution of filtered endogenous variables and shocks. See the note below on the difference between filtered and smoothed shocks.
\item smoother: triggers the computation of the posterior distribution of smoothed endogenous variables and shocks. Smoothed shocks are a reconstruction of the values of unobserved shocks over the sample, using all the information contained in the sample of observations. Filtered shocks, instead, are built only based on knowing past information. To calculate one period ahead prediction errors, for instance, you should use filtered, not smoothed variables.

View File

@ -1,74 +1,76 @@
\relax
\@writefile{lof}{\addvspace {10pt}}
\@writefile{lot}{\addvspace {10pt}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {2}Installing Dynare}{7}{chapter.2}}
\newlabel{ch:inst}{{2}{7}{\@empty \relax }{chapter.2}{}}
\@writefile{toc}{\contentsline {section}{\numberline {2.1}Dynare versions}{7}{section.2.1}}
\@writefile{toc}{\contentsline {section}{\numberline {2.2}System requirements}{7}{section.2.2}}
\@writefile{toc}{\contentsline {section}{\numberline {2.3}Installing Dynare}{8}{section.2.3}}
\@writefile{toc}{\contentsline {subsection}{Installing on Windows}{8}{section.2.3}}
\@writefile{toc}{\contentsline {subsection}{Installing on UNIX}{8}{Item.6}}
\@writefile{toc}{\contentsline {subsection}{Installing on Mac OSX}{8}{Item.6}}
\@writefile{toc}{\contentsline {section}{\numberline {2.4}Matlab particularities}{9}{section.2.4}}
\@setckpt{ch-inst}{
\setcounter{page}{10}
\setcounter{equation}{0}
\setcounter{enumi}{6}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{1}
\setcounter{mpfootnote}{0}
\setcounter{storedpagenumber}{1}
\setcounter{part}{0}
\setcounter{chapter}{2}
\setcounter{section}{4}
\setcounter{subsection}{0}
\setcounter{subsubsection}{0}
\setcounter{paragraph}{0}
\setcounter{subparagraph}{0}
\setcounter{@ppsavesec}{0}
\setcounter{@ppsaveapp}{0}
\setcounter{vslineno}{0}
\setcounter{poemline}{0}
\setcounter{modulo@vs}{0}
\setcounter{verse}{0}
\setcounter{chrsinstr}{0}
\setcounter{newflo@tctr}{4}
\setcounter{@contsubnum}{0}
\setcounter{maxsecnumdepth}{1}
\setcounter{sheetsequence}{18}
\setcounter{lastsheet}{100}
\setcounter{lastpage}{92}
\setcounter{bvlinectr}{0}
\setcounter{cp@cntr}{0}
\setcounter{ism@mctr}{0}
\setcounter{xsm@mctr}{0}
\setcounter{csm@mctr}{0}
\setcounter{ksm@mctr}{0}
\setcounter{xksm@mctr}{0}
\setcounter{cksm@mctr}{0}
\setcounter{msm@mctr}{0}
\setcounter{xmsm@mctr}{0}
\setcounter{cmsm@mctr}{0}
\setcounter{bsm@mctr}{0}
\setcounter{workm@mctr}{0}
\setcounter{figure}{0}
\setcounter{lofdepth}{1}
\setcounter{lofdepth}{1}
\setcounter{table}{0}
\setcounter{lotdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{parentequation}{0}
\setcounter{r@tfl@t}{0}
\setcounter{NAT@ctr}{0}
\setcounter{Item}{6}
\setcounter{definition}{0}
\setcounter{lemma}{0}
\setcounter{property}{0}
\setcounter{theorem}{0}
\setcounter{remark}{0}
\setcounter{lofdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{section@level}{0}
}
\relax
\@writefile{lof}{\addvspace {10pt}}
\@writefile{lot}{\addvspace {10pt}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {2}Installing Dynare}{7}{chapter.2}}
\newlabel{ch:inst}{{\M@TitleReference {2}{Installing Dynare}}{7}{\relax }{chapter.2}{}}
\@writefile{toc}{\contentsline {section}{\numberline {2.1}Dynare versions}{7}{section.2.1}}
\@writefile{toc}{\contentsline {section}{\numberline {2.2}System requirements}{7}{section.2.2}}
\@writefile{toc}{\contentsline {section}{\numberline {2.3}Installing Dynare}{8}{section.2.3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.3.1}Installing on Windows}{8}{subsection.2.3.1}}
\@writefile{toc}{\contentsline {section}{\numberline {2.4}Matlab particularities}{8}{section.2.4}}
\@setckpt{ch-inst}{
\setcounter{page}{9}
\setcounter{equation}{0}
\setcounter{enumi}{6}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{1}
\setcounter{mpfootnote}{0}
\setcounter{storedpagenumber}{1}
\setcounter{part}{0}
\setcounter{chapter}{2}
\setcounter{section}{4}
\setcounter{subsection}{0}
\setcounter{subsubsection}{0}
\setcounter{paragraph}{0}
\setcounter{subparagraph}{0}
\setcounter{@ppsavesec}{0}
\setcounter{@ppsaveapp}{0}
\setcounter{vslineno}{0}
\setcounter{poemline}{0}
\setcounter{modulo@vs}{0}
\setcounter{verse}{0}
\setcounter{chrsinstr}{0}
\setcounter{poem}{0}
\setcounter{newflo@tctr}{4}
\setcounter{@contsubnum}{0}
\setcounter{maxsecnumdepth}{2}
\setcounter{sheetsequence}{17}
\setcounter{lastsheet}{96}
\setcounter{lastpage}{90}
\setcounter{bvlinectr}{0}
\setcounter{cp@cntr}{0}
\setcounter{ism@mctr}{0}
\setcounter{xsm@mctr}{0}
\setcounter{csm@mctr}{0}
\setcounter{ksm@mctr}{0}
\setcounter{xksm@mctr}{0}
\setcounter{cksm@mctr}{0}
\setcounter{msm@mctr}{0}
\setcounter{xmsm@mctr}{0}
\setcounter{cmsm@mctr}{0}
\setcounter{bsm@mctr}{0}
\setcounter{workm@mctr}{0}
\setcounter{figure}{0}
\setcounter{lofdepth}{1}
\setcounter{lofdepth}{1}
\setcounter{table}{0}
\setcounter{lotdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{book}{0}
\setcounter{pagenote}{0}
\setcounter{lofdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{parentequation}{0}
\setcounter{r@tfl@t}{0}
\setcounter{NAT@ctr}{0}
\setcounter{Item}{6}
\setcounter{memhycontfloat}{0}
\setcounter{definition}{0}
\setcounter{lemma}{0}
\setcounter{property}{0}
\setcounter{theorem}{0}
\setcounter{remark}{0}
\setcounter{section@level}{1}
}

View File

@ -8,7 +8,7 @@ This User Guide will exclusively \textbf{focus on the Matlab version of Dynare}.
You may also be interested by another version of Dynare, developed in parallel: \textbf{Dynare++}. This is a standalone C++ version of Dynare specialized in computing k-order approximations of dynamic stochastic general equilibrium models. See the \href{http://www.cepremap.cnrs.fr/juillard/mambo/index.php?option=com_content&task=view&id=53&Itemid=86}{Dynare++ webpage} for more information.
\section{System requirements}
Dynare can run on Windows 98, 2000, NT and XP; at the time of writing, no experience was available on Vista (** check?). Dynare can also run on Unix-like operating systems, such as any Linux distribution, Solaris and, of course, Mac OS X. If you have questions about the support of a particular platform, feel free to write directly to Michel Juillard (michel.juillard"AT"ens.fr) or visit the \href{http://www.cepremap.cnrs.fr/juillard/mambo/index.php?option=com_forum&Itemid=95&page=viewforum&f=1}{\textbf{Dynare forums}}. \\
Dynare can run on Windows, as well as Unix-like operating systems, such as any Linux distribution, Solaris and, of course, Mac OS X (** add compilation instructions). If you have questions about the support of a particular platform, feel free to write directly to Michel Juillard (michel.juillard"AT"ens.fr) or visit the \href{http://www.cepremap.cnrs.fr/juillard/mambo/index.php?option=com_forum&Itemid=95&page=viewforum&f=1}{\textbf{Dynare forums}}. \\
To run Dynare, it is recommended to allocate at least 256MB of RAM to the platform running Dynare, although 512MB is preferred. Depending on the type of computations required, like the very processor intensive Metropolis Hastings algorithm, you may need up to 1GB of RAM to obtain acceptable computational times. \\
@ -17,19 +17,15 @@ To run Dynare, it is recommended to allocate at least 256MB of RAM to the platfo
The following assumes you have Matlab version 6.5.1 or later installed on your Windows system.\footnote{As of writing this Guide, Dynare is being developed on Matlab version 7. Nonetheless, great care is taken not to introduce features that would not work with reasonably recent versions of Matlab. However, Dynare requires at least the Matlab feature set of version 6.5.1, released September 22, 2003.}
\begin{enumerate}
\item Download the latest stable version of Dynare for Matlab (Windows) from the \href{http://www.cepremap.cnrs.fr/juillard/mambo/index.php?option=com_frontpage&Itemid=1}{Dynare website}.
\item You will now have on your computer a .zip file which you should unzip. This will create a folder called, by default, Dynare and its version number, for example: Dynare\_v3.0
\item You will now have on your computer a .zip file which you should unzip. This will create a folder called, by default, Dynare and its version number, for example: Dynare\_v4.x (where $x$ stands for any subsequent upgrades).
\item This directory contains several sub-directories, among which (i) matlab, (ii) doc and (iii) examples.
\item Place the Dynare folder (Dynare\_v3.0 in our example) in the c: directory and note that location. The easiest is probably to put it in the root of c: as in c:/dynare\_v3.0.
\item Place the Dynare folder (Dynare\_v4.x in our example) in the c: directory and note that location. The easiest is probably to put it in the root of c: as in c:/dynare\_v4.x.
\item Start Matlab and use the menu File/Set-Path to add the path to the Dynare
matlab subdirectory. Following our example, this would correspond to
c:/dynare\_v3.0/matlab
\item Save these changes in Matlab and you're ready to go. (** doesn't work if dynare is put in ''program files''... bug?)
c:/dynare\_v4.x/matlab
\item Save these changes in Matlab and you're ready to go.
\end{enumerate}
\subsection{Installing on UNIX}
** TBD - must recompile parser, need exact instructions.
\subsection{Installing on Mac OSX}
** TBD - must recompile parser, need exact instructions.
\section{Matlab particularities}

View File

@ -1,73 +1,78 @@
\relax
\@writefile{lof}{\addvspace {10pt}}
\@writefile{lot}{\addvspace {10pt}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {1}Introduction}{1}{chapter.1}}
\newlabel{ch:intro}{{1}{1}{\@empty \relax }{chapter.1}{}}
\@writefile{toc}{\contentsline {section}{\numberline {1.1}About this Guide - approach and structure}{1}{section.1.1}}
\@writefile{toc}{\contentsline {section}{\numberline {1.2}What is Dynare?}{2}{section.1.2}}
\newlabel{fig:dyn}{{1.2}{3}{\@empty \relax }{section.1.2}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {1.1}{\ignorespaces Dynare, a bird's eyeview}}{3}{figure.1.1}}
\@writefile{toc}{\contentsline {section}{\numberline {1.3}Additional sources of help}{4}{section.1.3}}
\@writefile{toc}{\contentsline {section}{\numberline {1.4}Nomenclature}{5}{section.1.4}}
\@setckpt{ch-intro}{
\setcounter{page}{6}
\setcounter{equation}{0}
\setcounter{enumi}{0}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{storedpagenumber}{1}
\setcounter{part}{0}
\setcounter{chapter}{1}
\setcounter{section}{4}
\setcounter{subsection}{0}
\setcounter{subsubsection}{0}
\setcounter{paragraph}{0}
\setcounter{subparagraph}{0}
\setcounter{@ppsavesec}{0}
\setcounter{@ppsaveapp}{0}
\setcounter{vslineno}{0}
\setcounter{poemline}{0}
\setcounter{modulo@vs}{0}
\setcounter{verse}{0}
\setcounter{chrsinstr}{0}
\setcounter{newflo@tctr}{4}
\setcounter{@contsubnum}{0}
\setcounter{maxsecnumdepth}{1}
\setcounter{sheetsequence}{14}
\setcounter{lastsheet}{100}
\setcounter{lastpage}{92}
\setcounter{bvlinectr}{0}
\setcounter{cp@cntr}{0}
\setcounter{ism@mctr}{0}
\setcounter{xsm@mctr}{0}
\setcounter{csm@mctr}{0}
\setcounter{ksm@mctr}{0}
\setcounter{xksm@mctr}{0}
\setcounter{cksm@mctr}{0}
\setcounter{msm@mctr}{0}
\setcounter{xmsm@mctr}{0}
\setcounter{cmsm@mctr}{0}
\setcounter{bsm@mctr}{0}
\setcounter{workm@mctr}{0}
\setcounter{figure}{1}
\setcounter{lofdepth}{1}
\setcounter{lofdepth}{1}
\setcounter{table}{0}
\setcounter{lotdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{parentequation}{0}
\setcounter{r@tfl@t}{0}
\setcounter{NAT@ctr}{0}
\setcounter{Item}{0}
\setcounter{definition}{0}
\setcounter{lemma}{0}
\setcounter{property}{0}
\setcounter{theorem}{0}
\setcounter{remark}{0}
\setcounter{lofdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{section@level}{0}
}
\relax
\@writefile{lof}{\addvspace {10pt}}
\@writefile{lot}{\addvspace {10pt}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {1}Introduction}{1}{chapter.1}}
\newlabel{ch:intro}{{\M@TitleReference {1}{Introduction}}{1}{\relax }{chapter.1}{}}
\@writefile{toc}{\contentsline {section}{\numberline {1.1}About this Guide - approach and structure}{1}{section.1.1}}
\@writefile{toc}{\contentsline {section}{\numberline {1.2}What is Dynare?}{2}{section.1.2}}
\newlabel{fig:dyn}{{\M@TitleReference {1.2}{What is Dynare?}}{3}{What is Dynare?\relax }{section.1.2}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {1.1}{\ignorespaces Dynare, a bird's eyeview}}{3}{figure.1.1}}
\@writefile{toc}{\contentsline {section}{\numberline {1.3}Additional sources of help}{3}{section.1.3}}
\@writefile{toc}{\contentsline {section}{\numberline {1.4}Nomenclature}{4}{section.1.4}}
\@writefile{toc}{\contentsline {section}{\numberline {1.5}v4, what's new and backward compatibility}{5}{section.1.5}}
\@setckpt{ch-intro}{
\setcounter{page}{6}
\setcounter{equation}{0}
\setcounter{enumi}{0}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{storedpagenumber}{1}
\setcounter{part}{0}
\setcounter{chapter}{1}
\setcounter{section}{5}
\setcounter{subsection}{0}
\setcounter{subsubsection}{0}
\setcounter{paragraph}{0}
\setcounter{subparagraph}{0}
\setcounter{@ppsavesec}{0}
\setcounter{@ppsaveapp}{0}
\setcounter{vslineno}{0}
\setcounter{poemline}{0}
\setcounter{modulo@vs}{0}
\setcounter{verse}{0}
\setcounter{chrsinstr}{0}
\setcounter{poem}{0}
\setcounter{newflo@tctr}{4}
\setcounter{@contsubnum}{0}
\setcounter{maxsecnumdepth}{2}
\setcounter{sheetsequence}{14}
\setcounter{lastsheet}{96}
\setcounter{lastpage}{90}
\setcounter{bvlinectr}{0}
\setcounter{cp@cntr}{0}
\setcounter{ism@mctr}{0}
\setcounter{xsm@mctr}{0}
\setcounter{csm@mctr}{0}
\setcounter{ksm@mctr}{0}
\setcounter{xksm@mctr}{0}
\setcounter{cksm@mctr}{0}
\setcounter{msm@mctr}{0}
\setcounter{xmsm@mctr}{0}
\setcounter{cmsm@mctr}{0}
\setcounter{bsm@mctr}{0}
\setcounter{workm@mctr}{0}
\setcounter{figure}{1}
\setcounter{lofdepth}{1}
\setcounter{lofdepth}{1}
\setcounter{table}{0}
\setcounter{lotdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{book}{0}
\setcounter{pagenote}{0}
\setcounter{lofdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{parentequation}{0}
\setcounter{r@tfl@t}{0}
\setcounter{NAT@ctr}{0}
\setcounter{Item}{0}
\setcounter{memhycontfloat}{0}
\setcounter{definition}{0}
\setcounter{lemma}{0}
\setcounter{property}{0}
\setcounter{theorem}{0}
\setcounter{remark}{0}
\setcounter{section@level}{1}
}

View File

@ -9,7 +9,7 @@ This Guide will focus on the most common or useful features of the program, thus
This Guide is written mainly for an \textbf{advanced economist} - like a professor, graduate student or central banker - needing a powerful and flexible program to support and facilitate his or her research activities in a variety of fields. The sophisticated computer programmer, on the one hand, or the specialist of computational economics, on the other, may not find this Guide sufficiently detailed. \\
We recognize that the ``advanced economist'' may be either a beginning or intermediate user of Dynare. This Guide is written to accommodate both. If you're \textbf{new to Dynare}, we recommend starting with chapters \ref{ch:solbase} and \ref{ch:estbase}, which introduce the program's basic features to solve (including running impulse response functions) and estimate DSGE models. To do so, these chapters lead you through a complete hands-on example, which we recommend following from A to Z, in order to ``learn by doing''. Once you have read these two chapters, you will know the crux of Dynare's functionality and (hopefully!) feel comfortable using Dynare for your own work. At that point, though, you will probably find yourself coming back to the User Guide to skim over some of the content in the advanced chapters to iron out details and potential complications you may run into.\\
We recognize that the ``advanced economist'' may be either a beginning or intermediate user of Dynare. This Guide is written to accommodate both. If you're \textbf{new to Dynare}, we recommend starting with chapters \ref{ch:solbase} and \ref{ch:estbase}, which introduce the program's basic features to solve (including running impulse response functions) and estimate DSGE models, respectively. To do so, these chapters lead you through a complete hands-on example, which we recommend following from A to Z, in order to ``\textbf{learn by doing}''. Once you have read these two chapters, you will know the crux of Dynare's functionality and (hopefully!) feel comfortable using Dynare for your own work. At that point, though, you will probably find yourself coming back to the User Guide to skim over some of the content in the advanced chapters to iron out details and potential complications you may run into.\\
If you're instead an \textbf{intermediate user} of Dynare, you will most likely find the advanced chapters, \ref{ch:soladv} and \ref{ch:estadv}, more appropriate. These chapters cover more advanced features of Dynare and more complicated usage scenarios. The presumption is that you would skip around these chapters to focus on the topics most applicable to your needs and curiosity. Examples are therefore more concise and specific to each feature; these chapters read a bit more like a reference manual.\\
@ -19,8 +19,7 @@ Finally, besides breaking up content into short chapters, we've introduced two d
\begin{itemize}
\item \textbf{\textsf{TIP!}} introduces advice to help you work more efficiently with Dynare or solve common problems.
\item \textbf{\textsf{NOTE!}} is used to draw your attention to particularly important information you should keep in mind when using Dynare.
\end{itemize}
Long enough material following any of these markers will be presented in a box for additional emphasis and clarity.
\end{itemize}
\section{What is Dynare?}
@ -42,7 +41,7 @@ Each of these steps will become clear as you read through the User Guide, but fo
\begin{itemize}
\item compute the steady state of a model
\item compute the solution of deterministic models
\item compute the first and second order approximation to solutions of stochastic models (** third order coming up - when will this feature be coded?)
\item compute the first and second order approximation to solutions of stochastic models
\item estimate parameters of DSGE models using either a maximum likelihood or a Bayesian approach
\item compute optimal policies in linear-quadratic models
\end{itemize}
@ -63,15 +62,24 @@ While this User Guide tries to be as complete and thorough as possible, you will
To end this introduction and avoid confusion in what follows, it is worthwhile to agree on a few \textbf{definitions of terms}. Many of these are shared with the Reference Manual.
\begin{itemize}
\item \textbf{Integer} indicates an integer number.
\item \textbf{Double} indicates a double precision number. The following syntaxes are valid: 1.1e3, 1.1E3, 1.1d3, 1.1D3 (** check this)
\item \textbf{Double} indicates a double precision number. The following syntaxes are valid: 1.1e3, 1.1E3, 1.1E-3, 1.1d3, 1.1D3
\item \textbf{Expression} indicates a mathematical expression valid in the underlying language (e.g. Matlab).
\item \textbf{Variable name} indicates a variable name. \textbf{\textsf{NOTE!}} These must start with an alphabetical character and can only contain other alphabetical characters and digits, as well as underscores (\_). All other characters, including accents, are forbidden.
\item \textbf{Variable name} indicates a variable name. \textbf{\textsf{NOTE!}} These must start with an alphabetical character and can only contain other alphabetical characters and digits, as well as underscores (\_). All other characters, including accents, and \textbf{spaces}, are forbidden.
\item \textbf{Parameter name} indicates a parameter name which must follow the same naming conventions as above.
\item \textbf{Filename} indicates a file name valid in your operating system.
\item \textbf{Command} is an instruction to Dynare or other program when specified.
\item \textbf{Options} or optional arguments for a command are listed in square brackets \mbox{[ ]} unless otherwise noted. If, for instance, the option must be specified in parenthesis in Dynare, it will show up in the Guide as [(option)].
\item \textbf{\texttt{Typewritten text}} indicates text as it should appear in Dynare code.
\end{itemize}
\section{v4, what's new and backward compatibility}
The current version of Dynare - for which this guide is written - is version 4. With respect to version 3, this new version introduces several important features, as well as improvements, optimizations of routines and bug fixes. The major new features are the following:
\begin{itemize}
\item Analytical derivatives are now used everywhere (for instance, in the Newton algorithm for deterministic models and in the linearizations necessary to solve stochastic models). This increases computational speed significantly. The drawback is that Dynare can now handle only a limited set of functions, although in nearly all economic applications this should not be a constraint.
\item Variables and parameters are now kept in the order in which they are declared whenever displayed and when used internally by Dynare. Recall that in version 3, variables and parameters where at times in their order of declaration and at times in alphabetical order. \textbf{\textsf{NOTE!}} This may cause some problems of backward compatibility if you wrote programs to run off Dynare v3 output.
\item The names of many internal variables and the organization of output variables has changed. These are enumerated in details in the relevant chapters. The names of the files internally generated by Dynare have also changed. (** more on this when explaining internal file structure - TBD)
\item The syntax for the external steady state file has changed. This is covered in more details in chapter \ref{ch:solbase}, in section \ref{sec:findsteady}. \textbf{\textsf{NOTE!}} You will unfortunately have to slightly amend any old steady state files you may have written.
\item Speed. Several large-scale improvements have been implemented to speed up Dynare. This should be most noticeable when solving deterministic models, but also apparent in other functionality.
\end{itemize}

View File

@ -1,67 +1,71 @@
\relax
\@writefile{lof}{\addvspace {10pt}}
\@writefile{lot}{\addvspace {10pt}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {9}Optimal policy under commitment}{87}{chapter.9}}
\newlabel{ch:ramsey}{{9}{87}{\@empty \relax }{chapter.9}{}}
\@setckpt{ch-ramsey}{
\setcounter{page}{88}
\setcounter{equation}{0}
\setcounter{enumi}{4}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{storedpagenumber}{1}
\setcounter{part}{0}
\setcounter{chapter}{9}
\setcounter{section}{0}
\setcounter{subsection}{0}
\setcounter{subsubsection}{0}
\setcounter{paragraph}{0}
\setcounter{subparagraph}{0}
\setcounter{@ppsavesec}{0}
\setcounter{@ppsaveapp}{0}
\setcounter{vslineno}{0}
\setcounter{poemline}{0}
\setcounter{modulo@vs}{0}
\setcounter{verse}{0}
\setcounter{chrsinstr}{0}
\setcounter{newflo@tctr}{4}
\setcounter{@contsubnum}{0}
\setcounter{maxsecnumdepth}{1}
\setcounter{sheetsequence}{96}
\setcounter{lastsheet}{100}
\setcounter{lastpage}{92}
\setcounter{bvlinectr}{0}
\setcounter{cp@cntr}{0}
\setcounter{ism@mctr}{0}
\setcounter{xsm@mctr}{0}
\setcounter{csm@mctr}{0}
\setcounter{ksm@mctr}{0}
\setcounter{xksm@mctr}{0}
\setcounter{cksm@mctr}{0}
\setcounter{msm@mctr}{0}
\setcounter{xmsm@mctr}{0}
\setcounter{cmsm@mctr}{0}
\setcounter{bsm@mctr}{0}
\setcounter{workm@mctr}{0}
\setcounter{figure}{0}
\setcounter{lofdepth}{1}
\setcounter{lofdepth}{1}
\setcounter{table}{0}
\setcounter{lotdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{parentequation}{0}
\setcounter{r@tfl@t}{0}
\setcounter{NAT@ctr}{0}
\setcounter{Item}{63}
\setcounter{definition}{0}
\setcounter{lemma}{0}
\setcounter{property}{0}
\setcounter{theorem}{0}
\setcounter{remark}{0}
\setcounter{lofdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{section@level}{0}
}
\relax
\@writefile{lof}{\addvspace {10pt}}
\@writefile{lot}{\addvspace {10pt}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {9}Optimal policy under commitment}{85}{chapter.9}}
\newlabel{ch:ramsey}{{\M@TitleReference {9}{Optimal policy under commitment}}{85}{\relax }{chapter.9}{}}
\@setckpt{ch-ramsey}{
\setcounter{page}{86}
\setcounter{equation}{0}
\setcounter{enumi}{4}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{storedpagenumber}{1}
\setcounter{part}{0}
\setcounter{chapter}{9}
\setcounter{section}{0}
\setcounter{subsection}{0}
\setcounter{subsubsection}{0}
\setcounter{paragraph}{0}
\setcounter{subparagraph}{0}
\setcounter{@ppsavesec}{0}
\setcounter{@ppsaveapp}{0}
\setcounter{vslineno}{0}
\setcounter{poemline}{0}
\setcounter{modulo@vs}{0}
\setcounter{verse}{0}
\setcounter{chrsinstr}{0}
\setcounter{poem}{0}
\setcounter{newflo@tctr}{4}
\setcounter{@contsubnum}{0}
\setcounter{maxsecnumdepth}{2}
\setcounter{sheetsequence}{94}
\setcounter{lastsheet}{96}
\setcounter{lastpage}{90}
\setcounter{bvlinectr}{0}
\setcounter{cp@cntr}{0}
\setcounter{ism@mctr}{0}
\setcounter{xsm@mctr}{0}
\setcounter{csm@mctr}{0}
\setcounter{ksm@mctr}{0}
\setcounter{xksm@mctr}{0}
\setcounter{cksm@mctr}{0}
\setcounter{msm@mctr}{0}
\setcounter{xmsm@mctr}{0}
\setcounter{cmsm@mctr}{0}
\setcounter{bsm@mctr}{0}
\setcounter{workm@mctr}{0}
\setcounter{figure}{0}
\setcounter{lofdepth}{1}
\setcounter{lofdepth}{1}
\setcounter{table}{0}
\setcounter{lotdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{book}{0}
\setcounter{pagenote}{0}
\setcounter{lofdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{parentequation}{0}
\setcounter{r@tfl@t}{0}
\setcounter{NAT@ctr}{0}
\setcounter{Item}{62}
\setcounter{memhycontfloat}{0}
\setcounter{definition}{0}
\setcounter{lemma}{0}
\setcounter{property}{0}
\setcounter{theorem}{0}
\setcounter{remark}{0}
\setcounter{section@level}{1}
}

View File

@ -1,85 +1,88 @@
\relax
\@writefile{lof}{\addvspace {10pt}}
\@writefile{lot}{\addvspace {10pt}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {4}Solving DSGE models - advanced topics}{35}{chapter.4}}
\newlabel{ch:soladv}{{4}{35}{\@empty \relax }{chapter.4}{}}
\@writefile{toc}{\contentsline {section}{\numberline {4.1}Dynare features and functionality}{35}{section.4.1}}
\@writefile{toc}{\contentsline {subsection}{Other examples}{35}{section.4.1}}
\citation{CollardJuillard2003}
\@writefile{toc}{\contentsline {subsection}{Working with several correlated shocks}{36}{section.4.1}}
\@writefile{toc}{\contentsline {subsubsection}{The model}{36}{section.4.1}}
\@writefile{toc}{\contentsline {subsubsection}{The .mod file}{37}{section.4.1}}
\@writefile{toc}{\contentsline {subsection}{Finding, saving and viewing your output}{39}{section.4.1}}
\newlabel{sec:FindOut}{{4.1}{39}{\@empty \relax }{section.4.1}{}}
\@writefile{toc}{\contentsline {subsection}{Using loops to compare IRFs on the same graph}{39}{section.4.1}}
\@writefile{toc}{\contentsline {subsection}{Referring to external files}{39}{section.4.1}}
\@writefile{toc}{\contentsline {subsection}{Infinite eigenvalues}{40}{section.4.1}}
\@writefile{toc}{\contentsline {section}{\numberline {4.2}Files created by Dynare}{40}{section.4.2}}
\@writefile{toc}{\contentsline {section}{\numberline {4.3}Modeling tips}{40}{section.4.3}}
\@writefile{toc}{\contentsline {subsection}{Stationarizing your model}{40}{section.4.3}}
\citation{ClaridaGaliGertler1999}
\@writefile{toc}{\contentsline {subsection}{Expectations taken in the past}{41}{section.4.3}}
\@writefile{toc}{\contentsline {subsection}{Infinite sums}{41}{section.4.3}}
\@writefile{toc}{\contentsline {subsection}{Infinite sums with changing timing of expectations}{43}{section.4.3}}
\@setckpt{ch-soladv}{
\setcounter{page}{44}
\setcounter{equation}{0}
\setcounter{enumi}{7}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{storedpagenumber}{1}
\setcounter{part}{0}
\setcounter{chapter}{4}
\setcounter{section}{3}
\setcounter{subsection}{0}
\setcounter{subsubsection}{0}
\setcounter{paragraph}{0}
\setcounter{subparagraph}{0}
\setcounter{@ppsavesec}{0}
\setcounter{@ppsaveapp}{0}
\setcounter{vslineno}{0}
\setcounter{poemline}{0}
\setcounter{modulo@vs}{0}
\setcounter{verse}{0}
\setcounter{chrsinstr}{0}
\setcounter{newflo@tctr}{4}
\setcounter{@contsubnum}{0}
\setcounter{maxsecnumdepth}{1}
\setcounter{sheetsequence}{52}
\setcounter{lastsheet}{100}
\setcounter{lastpage}{92}
\setcounter{bvlinectr}{0}
\setcounter{cp@cntr}{0}
\setcounter{ism@mctr}{0}
\setcounter{xsm@mctr}{0}
\setcounter{csm@mctr}{0}
\setcounter{ksm@mctr}{0}
\setcounter{xksm@mctr}{0}
\setcounter{cksm@mctr}{0}
\setcounter{msm@mctr}{0}
\setcounter{xmsm@mctr}{0}
\setcounter{cmsm@mctr}{0}
\setcounter{bsm@mctr}{0}
\setcounter{workm@mctr}{0}
\setcounter{figure}{0}
\setcounter{lofdepth}{1}
\setcounter{lofdepth}{1}
\setcounter{table}{0}
\setcounter{lotdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{parentequation}{0}
\setcounter{r@tfl@t}{0}
\setcounter{NAT@ctr}{0}
\setcounter{Item}{23}
\setcounter{definition}{0}
\setcounter{lemma}{0}
\setcounter{property}{0}
\setcounter{theorem}{0}
\setcounter{remark}{0}
\setcounter{lofdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{section@level}{0}
}
\relax
\@writefile{lof}{\addvspace {10pt}}
\@writefile{lot}{\addvspace {10pt}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {4}Solving DSGE models - advanced topics}{35}{chapter.4}}
\newlabel{ch:soladv}{{\M@TitleReference {4}{Solving DSGE models - advanced topics}}{35}{\relax }{chapter.4}{}}
\@writefile{toc}{\contentsline {section}{\numberline {4.1}Dynare features and functionality}{35}{section.4.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1.1}Other examples}{35}{subsection.4.1.1}}
\citation{CollardJuillard2003}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1.2}Alternative, complete example}{36}{subsection.4.1.2}}
\@writefile{toc}{\contentsline {subsubsection}{The model}{36}{section*.5}}
\@writefile{toc}{\contentsline {subsubsection}{The .mod file}{37}{section*.6}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1.3}Finding, saving and viewing your output}{39}{subsection.4.1.3}}
\newlabel{sec:FindOut}{{\M@TitleReference {4.1.3}{Finding, saving and viewing your output}}{39}{Finding, saving and viewing your output\relax }{subsection.4.1.3}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1.4}Referring to external files}{40}{subsection.4.1.4}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1.5}Infinite eigenvalues}{40}{subsection.4.1.5}}
\@writefile{toc}{\contentsline {section}{\numberline {4.2}Files created by Dynare}{41}{section.4.2}}
\@writefile{toc}{\contentsline {section}{\numberline {4.3}Modeling tips}{41}{section.4.3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.3.1}Stationarizing your model}{41}{subsection.4.3.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.3.2}Expectations taken in the past}{41}{subsection.4.3.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.3.3}Infinite sums}{41}{subsection.4.3.3}}
\citation{ClaridaGaliGertler1999}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.3.4}Infinite sums with changing timing of expectations}{43}{subsection.4.3.4}}
\@setckpt{ch-soladv}{
\setcounter{page}{44}
\setcounter{equation}{0}
\setcounter{enumi}{7}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{storedpagenumber}{1}
\setcounter{part}{0}
\setcounter{chapter}{4}
\setcounter{section}{3}
\setcounter{subsection}{4}
\setcounter{subsubsection}{0}
\setcounter{paragraph}{0}
\setcounter{subparagraph}{0}
\setcounter{@ppsavesec}{0}
\setcounter{@ppsaveapp}{0}
\setcounter{vslineno}{0}
\setcounter{poemline}{0}
\setcounter{modulo@vs}{0}
\setcounter{verse}{0}
\setcounter{chrsinstr}{0}
\setcounter{poem}{0}
\setcounter{newflo@tctr}{4}
\setcounter{@contsubnum}{0}
\setcounter{maxsecnumdepth}{2}
\setcounter{sheetsequence}{52}
\setcounter{lastsheet}{96}
\setcounter{lastpage}{90}
\setcounter{bvlinectr}{0}
\setcounter{cp@cntr}{0}
\setcounter{ism@mctr}{0}
\setcounter{xsm@mctr}{0}
\setcounter{csm@mctr}{0}
\setcounter{ksm@mctr}{0}
\setcounter{xksm@mctr}{0}
\setcounter{cksm@mctr}{0}
\setcounter{msm@mctr}{0}
\setcounter{xmsm@mctr}{0}
\setcounter{cmsm@mctr}{0}
\setcounter{bsm@mctr}{0}
\setcounter{workm@mctr}{0}
\setcounter{figure}{0}
\setcounter{lofdepth}{1}
\setcounter{lofdepth}{1}
\setcounter{table}{0}
\setcounter{lotdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{book}{0}
\setcounter{pagenote}{0}
\setcounter{lofdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{parentequation}{0}
\setcounter{r@tfl@t}{0}
\setcounter{NAT@ctr}{0}
\setcounter{Item}{23}
\setcounter{memhycontfloat}{0}
\setcounter{definition}{0}
\setcounter{lemma}{0}
\setcounter{property}{0}
\setcounter{theorem}{0}
\setcounter{remark}{0}
\setcounter{section@level}{2}
}

View File

@ -9,8 +9,8 @@ Other examples of .mod files used to generate impulse response functions are ava
Also, don't forget to check occasionally the \href{http://www.cepremap.cnrs.fr/juillard/mambo/index.php?option=com_forum&Itemid=95}{Open Online Examples} page to see if any other user has posted an example that could help you in your work; or maybe you would like to post an example there yourself?
\subsection{Working with several correlated shocks}
Your model may have two or more shocks, and these may be correlated to each other. The example below illustrates how you would introduce this into Dynare. Actually, the example provided is somewhat more complete than strictly necessary. This is to give you an alternative, full-blown example to the one described in chapter \ref{ch:solbase}.
\subsection{Alternative, complete example}
The following example aims to give you an alternative example to the one in chapter \ref{ch:solbase}, to learn the workings of Dynare. It also aims to give you exposure to dealing with \textbf{several correlated shocks}. Your model may have two or more shocks, and these may be correlated to each other. The example below illustrates how you would introduce this into Dynare. Actually, the example provided is somewhat more complete than strictly necessary. This is to give you an alternative, full-blown example to the one described in chapter \ref{ch:solbase}.
\subsubsection{The model}
The model is a simplified standard RBC model taken from \citet{CollardJuillard2003} which served as the original User Guide for Dynare. \\
@ -21,7 +21,7 @@ The economy consists of an infinitely living representative agent who values con
\]
where, as usual, the discount factor $0<\beta<1$, the disutility of labor $\theta > 0$ and the labor supply elasticity $\psi \geq 0$. \\
A social planner maximizes this utility function subject to the budget constraint
A social planner maximizes this utility function subject to the resource constraint
\[
c_t + i_t = y_t
\]
@ -73,7 +73,7 @@ var u; stderr 0.009;\\
var e, u = phi*0.009*0.009;\\
end;}\\
\\
where the last line specifies the contemporaneous correlation between our two exogenous variables. (** does this mean every time you run your .mod file you will get a slightly different shock?) \\
where the last line specifies the contemporaneous correlation between our two exogenous variables. \\
Alternatively, you can also write: \\
\\
@ -88,7 +88,7 @@ So that you can gain experience by manipulating the entire model, here is the co
\\
\texttt{var y, c, k, a, h, b;\\
varexo e,u;\\
parameters beta, rho, beta, alpha, delta, theta, psi, tau;\\
parameters beta, rho, alpha, delta, theta, psi, tau;\\
alpha = 0.36;\\
rho = 0.95;\\
tau = 0.025;\\
@ -128,27 +128,30 @@ end;\\
stoch\_simul(periods=2100);}\\
\subsection{Finding, saving and viewing your output} \label{sec:FindOut}
Where is output stored? ** TBD, add a table summarizing what results exist and where they are stored in version 4. \\
Where is output stored? Most of the moments of interest are stored in global variable \texttt{oo\_} You can easily browse this global variable in Matlab by either calling it in the command line, or using the workspace interface. In global variable \texttt{oo\_} you will find the following (\textsf{\textbf{NOTE!}} variables will always appear in the order in which you declared them in the preamble block of your .mod file):
\begin{itemize}
\item \texttt{steady\_state}: the steady state of your variables
\item \texttt{mean}: the mean of your variables
\item \texttt{var}: the variance of your variables
\item \texttt{autocorr}: the various autocorrelation matrices of your variables. Each row of these matrices will correspond to a variables in time $t$, and columns correspond to the variables lagged 1, for the first matrix, then lagged 2 for the second matrix, and so on. Thus, the matrix of autocorrelations that is automatically displayed in the results after running \texttt{stoch\_simul} has the diagonal elements of each autocorrelation matrix running down each column.
\item \texttt{gamma\_y}: the matrices of autocovariances. \texttt{gamma\_y\{1\}} represents variances, while \texttt{gamma\_y\{2\}} represents autocovariances with a lag of 1 and so on. By default, Dynare will return autocovariances with a lag of 5. The last matrix (\texttt{gamma\_y\{7\}} in the default case) returns the \textbf{variance decomposition}, where each column captures the independent contribution of each shock to the variance of each variable.
\end{itemize}
Furthermore, if you decide to run impulse response functions, you will find a global variable \texttt{oo\_.irfs} comprising of vectors named \texttt{endogenous variable\_exogenous variable}, like \texttt{y\_e}, reporting the values of the endogenous variables corresponding to the impulse response functions, as a result of the independent impulse of each exogenous shock. \\
To save your simulated variables, you can add the following command at the end of your .mod file: \texttt{dynasave (FILENAME) [variable names separated by commas]} If no variable names are specified in the optional field, Dynare will save all endogenous variables. In Matlab, variables saved with the \texttt{dynasave} command can be retrieved by using the Matlab command \texttt{load -mat FILENAME}.
\subsection{Using loops to compare IRFs on the same graph}
** Comment the irf\_loop.mod e.g.
\subsection{Referring to external files}
You may find it convenient to refer to an external file, either to compute the steady state of your model, or when specifying shocks in an external file. The former is described in section \ref{sec:ssshock} of chapter \ref{ch:solbase} when discussing steady states. The advantage of using Matlab, say, to find your model's steady state was clear with respect to Dynare version 3, as the latter resorted to numerical approximations to find steady state values. But Dynare version 4 now uses the same analytical methods available in Matlab. For most usage scenarios, you should therefore do just as well to ask Dynare to compute your model's steady state (except, maybe, if you want to run loops, to vary your parameter values, for instance, in which case writing a Matlab program may be more handy). (** give more details? an example?)\\
You may find it convenient to refer to an external file, either to compute the steady state of your model, or when specifying shocks in an external file. The former is described in section \ref{sec:ssshock} of chapter \ref{ch:solbase} when discussing steady states. The advantage of using Matlab, say, to find your model's steady state was clear with respect to Dynare version 3, as the latter resorted to numerical approximations to find steady state values. But Dynare version 4 now uses the same analytical methods available in Matlab. For most usage scenarios, you should therefore do just as well to ask Dynare to compute your model's steady state (except, maybe, if you want to run loops, to vary your parameter values, for instance, in which case writing a Matlab program may be more handy).\\
But you may also be interested in the second possibility described above, namely of specifying shocks in an external file, to simulate a model based on shocks from a prior estimation, for instance. You could then retrieve the exogenous shocks from the oo\_ file by saving them in a file called datafile.mat. Finally, you could simulate a deterministic model with the shocks saved from the estimation by specifying the source file for the shocks, using the \\ \mbox{\texttt{shocks(shocks\_file = datafile.mat)}} command. (** how should the variables be ordered in this datafile?)
But you may also be interested in the second possibility described above, namely of specifying shocks in an external file, to simulate a model based on shocks from a prior estimation, for instance. You could then retrieve the exogenous shocks from the oo\_ file by saving them in a file called datafile.mat. Finally, you could simulate a deterministic model with the shocks saved from the estimation by specifying the source file for the shocks, using the \\ \mbox{\texttt{shocks(shocks\_file = datafile.mat)}} command.
But of course, this is a bit of a workaround, since you could also use the built-in commands in Dynare to generate impulse response functions from estimated shocks, as described in chapter \ref{ch:estbase}. \\
\subsection{Infinite eigenvalues}
If you use the command \texttt{check} in your .mod file, Dynare will report your system's eigenvalues and tell you if these meet the Blanchard-Kahn conditions. At that point, don't worry if you get infinite eigenvalues - these are are firmly grounded in the theory of generalized eigenvalues. They have no detrimental influence on the solution algorithm. As far as Blanchard-Kahn conditions are concerned infinite eigenvalues are counted as explosive roots of modulus larger than one. \\
\section{Files created by Dynare}
At times, you may get a message that there is an error in a file with a new name, or you may want to have a closer look at how Dynare actually solves your model - out of curiosity or maybe to do some customization of your own. To help address these issues, below is a brief description of which files are created by Dynare after you launch \texttt{simul} or \texttt{stoch\_simul}, what their purpose is and what they contain. \\
** Get this from Sebastien
At times, you may get a message that there is an error in a file with a new name, or you may want to have a closer look at how Dynare actually solves your model - out of curiosity or maybe to do some customization of your own. You may therefore find it helpful to get a brief overview of the internal files that Dynare generates and the function of each one. ** TBD
\section{Modeling tips}
@ -161,7 +164,7 @@ For deterministic models, the trick is to use only stationary variables in $t+1$
Note that in a stationary model, it is expected that variables will eventually go back to steady state after the initial shock. If you expect to see a growing curve for a variable, you are thinking about a growth model. Because growth models are nonstationary, it is easier to work with the stationarized version of such models. Again, if you know the trend, you can always add it back after the simulation of the stationary components of the variables.
\subsection{Expectations taken in the past}
For instance, to enter the term $\mathbb{E}_{t-1}y_t$, define $s_t=\mathbb{E}_t[y_{t+1}]$ and then use $s(-1)$ in your .mod file.
For instance, to enter the term $\mathbb{E}_{t-1}y_t$, define $s_t=\mathbb{E}_t[y_{t+1}]$ and then use $s(-1)$ in your .mod file. Note that $y_t$ in this case is not a variable in an equation, but an entire equation.
\subsection{Infinite sums}

View File

@ -1,105 +1,116 @@
\relax
\@writefile{lof}{\addvspace {10pt}}
\@writefile{lot}{\addvspace {10pt}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {3}Solving DSGE models - basics}{11}{chapter.3}}
\newlabel{ch:solbase}{{3}{11}{\@empty \relax }{chapter.3}{}}
\@writefile{toc}{\contentsline {section}{\numberline {3.1}An important distinction}{11}{section.3.1}}
\newlabel{sec:distcn}{{3.1}{11}{\@empty \relax }{section.3.1}{}}
\@writefile{toc}{\contentsline {subsection}{\textsf {NOTE!} Deterministic vs stochastic models}{12}{section.3.1}}
\newlabel{sec:detstoch}{{3.1}{12}{\@empty \relax }{section.3.1}{}}
\@writefile{toc}{\contentsline {section}{\numberline {3.2}Introducing an example}{13}{section.3.2}}
\@writefile{toc}{\contentsline {section}{\numberline {3.3}Dynare .mod file structure}{16}{section.3.3}}
\newlabel{fig:modstruct}{{3.3}{17}{\@empty \relax }{section.3.3}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {3.1}{\ignorespaces Structure of the .mod file}}{17}{figure.3.1}}
\@writefile{toc}{\contentsline {section}{\numberline {3.4}Filling out the preamble}{17}{section.3.4}}
\newlabel{sec:preamble}{{3.4}{17}{\@empty \relax }{section.3.4}{}}
\@writefile{toc}{\contentsline {section}{\numberline {3.5}Specifying the model}{18}{section.3.5}}
\newlabel{sec:modspe}{{3.5}{18}{\@empty \relax }{section.3.5}{}}
\@writefile{toc}{\contentsline {subsection}{Model in Dynare notation}{18}{section.3.5}}
\@writefile{toc}{\contentsline {subsection}{General conventions}{19}{section.3.5}}
\@writefile{toc}{\contentsline {subsection}{Notational conventions}{20}{section.3.5}}
\@writefile{toc}{\contentsline {subsection}{Timing conventions}{20}{section.3.5}}
\@writefile{toc}{\contentsline {subsection}{Conventions specifying non-predetermined variables}{20}{section.3.5}}
\@writefile{toc}{\contentsline {subsection}{Linear and log-linearized models}{21}{section.3.5}}
\@writefile{toc}{\contentsline {section}{\numberline {3.6}Specifying transitions (steady states and shocks)}{22}{section.3.6}}
\newlabel{sec:ssshock}{{3.6}{22}{\@empty \relax }{section.3.6}{}}
\@writefile{toc}{\contentsline {subsection}{Specifying steady states - introduction}{22}{section.3.6}}
\@writefile{toc}{\contentsline {subsection}{Finding a steady state}{23}{section.3.6}}
\@writefile{toc}{\contentsline {subsection}{Adding shocks - deterministic models}{24}{section.3.6}}
\@writefile{toc}{\contentsline {subsection}{Adding shocks - stochastic models}{26}{section.3.6}}
\@writefile{toc}{\contentsline {subsection}{Some useful details}{26}{section.3.6}}
\citation{Juillard1996}
\@writefile{toc}{\contentsline {section}{\numberline {3.7}Selecting a computation}{27}{section.3.7}}
\newlabel{sec:compute}{{3.7}{27}{\@empty \relax }{section.3.7}{}}
\@writefile{toc}{\contentsline {subsection}{For deterministic models}{27}{section.3.7}}
\@writefile{toc}{\contentsline {subsection}{For stochastic models}{27}{section.3.7}}
\citation{SchmittGrohe2004}
\citation{CollardJuillard2001a}
\@writefile{toc}{\contentsline {section}{\numberline {3.8}Executing the .mod file and interpreting results}{29}{section.3.8}}
\@writefile{toc}{\contentsline {subsection}{For stochastic models}{29}{section.3.8}}
\@writefile{toc}{\contentsline {subsection}{For deterministic models}{30}{Item.23}}
\@writefile{toc}{\contentsline {section}{\numberline {3.9}The complete .mod file}{31}{section.3.9}}
\@writefile{toc}{\contentsline {subsection}{The stochastic model}{31}{section.3.9}}
\@writefile{toc}{\contentsline {subsection}{The deterministic model (case of temporary shock)}{32}{section.3.9}}
\@setckpt{ch-solbase}{
\setcounter{page}{34}
\setcounter{equation}{0}
\setcounter{enumi}{7}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{1}
\setcounter{mpfootnote}{0}
\setcounter{storedpagenumber}{1}
\setcounter{part}{0}
\setcounter{chapter}{3}
\setcounter{section}{9}
\setcounter{subsection}{0}
\setcounter{subsubsection}{0}
\setcounter{paragraph}{0}
\setcounter{subparagraph}{0}
\setcounter{@ppsavesec}{0}
\setcounter{@ppsaveapp}{0}
\setcounter{vslineno}{0}
\setcounter{poemline}{0}
\setcounter{modulo@vs}{0}
\setcounter{verse}{0}
\setcounter{chrsinstr}{0}
\setcounter{newflo@tctr}{4}
\setcounter{@contsubnum}{0}
\setcounter{maxsecnumdepth}{1}
\setcounter{sheetsequence}{42}
\setcounter{lastsheet}{100}
\setcounter{lastpage}{92}
\setcounter{bvlinectr}{0}
\setcounter{cp@cntr}{0}
\setcounter{ism@mctr}{0}
\setcounter{xsm@mctr}{0}
\setcounter{csm@mctr}{0}
\setcounter{ksm@mctr}{0}
\setcounter{xksm@mctr}{0}
\setcounter{cksm@mctr}{0}
\setcounter{msm@mctr}{0}
\setcounter{xmsm@mctr}{0}
\setcounter{cmsm@mctr}{0}
\setcounter{bsm@mctr}{0}
\setcounter{workm@mctr}{0}
\setcounter{figure}{1}
\setcounter{lofdepth}{1}
\setcounter{lofdepth}{1}
\setcounter{table}{0}
\setcounter{lotdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{parentequation}{0}
\setcounter{r@tfl@t}{0}
\setcounter{NAT@ctr}{0}
\setcounter{Item}{23}
\setcounter{definition}{0}
\setcounter{lemma}{0}
\setcounter{property}{0}
\setcounter{theorem}{0}
\setcounter{remark}{0}
\setcounter{lofdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{section@level}{0}
}
\relax
\@writefile{lof}{\addvspace {10pt}}
\@writefile{lot}{\addvspace {10pt}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {3}Solving DSGE models - basics}{9}{chapter.3}}
\newlabel{ch:solbase}{{\M@TitleReference {3}{Solving DSGE models - basics}}{9}{\relax }{chapter.3}{}}
\@writefile{toc}{\contentsline {section}{\numberline {3.1}A fundamental distinction}{9}{section.3.1}}
\newlabel{sec:distcn}{{\M@TitleReference {3.1}{A fundamental distinction}}{9}{A fundamental distinction\relax }{section.3.1}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1.1}\textsf {NOTE!} Deterministic vs stochastic models}{10}{subsection.3.1.1}}
\newlabel{sec:detstoch}{{\M@TitleReference {3.1.1}{\textsf {NOTE!} Deterministic vs stochastic models}}{10}{\textsf {NOTE!} Deterministic vs stochastic models\relax }{subsection.3.1.1}{}}
\@writefile{toc}{\contentsline {section}{\numberline {3.2}Introducing an example}{11}{section.3.2}}
\newlabel{fig:modstruct}{{\M@TitleReference {3.3}{Dynare .mod file structure}}{15}{Dynare .mod file structure\relax }{section.3.3}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {3.1}{\ignorespaces Structure of the .mod file}}{15}{figure.3.1}}
\@writefile{toc}{\contentsline {section}{\numberline {3.3}Dynare .mod file structure}{15}{section.3.3}}
\@writefile{toc}{\contentsline {section}{\numberline {3.4}Filling out the preamble}{15}{section.3.4}}
\newlabel{sec:preamble}{{\M@TitleReference {3.4}{Filling out the preamble}}{15}{Filling out the preamble\relax }{section.3.4}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4.1}The deterministic case}{16}{subsection.3.4.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4.2}The stochastic case}{16}{subsection.3.4.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4.3}Comments on your first lines of Dynare code}{16}{subsection.3.4.3}}
\@writefile{toc}{\contentsline {section}{\numberline {3.5}Specifying the model}{17}{section.3.5}}
\newlabel{sec:modspe}{{\M@TitleReference {3.5}{Specifying the model}}{17}{Specifying the model\relax }{section.3.5}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.5.1}Model in Dynare notation}{17}{subsection.3.5.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.5.2}General conventions}{18}{subsection.3.5.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.5.3}Notational conventions}{19}{subsection.3.5.3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.5.4}Timing conventions}{19}{subsection.3.5.4}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.5.5}Conventions specifying non-predetermined variables}{19}{subsection.3.5.5}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.5.6}Linear and log-linearized models}{20}{subsection.3.5.6}}
\@writefile{toc}{\contentsline {section}{\numberline {3.6}Specifying steady states and/or initial values}{20}{section.3.6}}
\newlabel{sec:ssshock}{{\M@TitleReference {3.6}{Specifying steady states and/or initial values}}{20}{Specifying steady states and/or initial values\relax }{section.3.6}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.6.1}Stochastic models and steady states}{21}{subsection.3.6.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.6.2}Deterministic models and initial values}{22}{subsection.3.6.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.6.3}Finding a steady state}{22}{subsection.3.6.3}}
\newlabel{sec:findsteady}{{\M@TitleReference {3.6.3}{Finding a steady state}}{22}{Finding a steady state\relax }{subsection.3.6.3}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.6.4}Checking system stability}{24}{subsection.3.6.4}}
\@writefile{toc}{\contentsline {section}{\numberline {3.7}Adding shocks}{24}{section.3.7}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.7.1}Deterministic models - temporary shocks}{24}{subsection.3.7.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.7.2}Deterministic models - permanent shocks}{25}{subsection.3.7.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.7.3}Stochastic models}{26}{subsection.3.7.3}}
\citation{Juillard1996}
\@writefile{toc}{\contentsline {section}{\numberline {3.8}Selecting a computation}{27}{section.3.8}}
\newlabel{sec:compute}{{\M@TitleReference {3.8}{Selecting a computation}}{27}{Selecting a computation\relax }{section.3.8}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.8.1}For deterministic models}{27}{subsection.3.8.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.8.2}For stochastic models}{27}{subsection.3.8.2}}
\citation{SchmittGrohe2004}
\citation{CollardJuillard2001a}
\@writefile{toc}{\contentsline {section}{\numberline {3.9}The complete .mod file}{30}{section.3.9}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.9.1}The stochastic model}{30}{subsection.3.9.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.9.2}The deterministic model (case of temporary shock)}{31}{subsection.3.9.2}}
\@writefile{toc}{\contentsline {section}{\numberline {3.10}File execution and results}{32}{section.3.10}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.10.1}Results - stochastic models}{32}{subsection.3.10.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.10.2}Results - deterministic models}{33}{subsection.3.10.2}}
\@setckpt{ch-solbase}{
\setcounter{page}{35}
\setcounter{equation}{0}
\setcounter{enumi}{7}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{1}
\setcounter{mpfootnote}{0}
\setcounter{storedpagenumber}{1}
\setcounter{part}{0}
\setcounter{chapter}{3}
\setcounter{section}{10}
\setcounter{subsection}{2}
\setcounter{subsubsection}{0}
\setcounter{paragraph}{0}
\setcounter{subparagraph}{0}
\setcounter{@ppsavesec}{0}
\setcounter{@ppsaveapp}{0}
\setcounter{vslineno}{0}
\setcounter{poemline}{0}
\setcounter{modulo@vs}{0}
\setcounter{verse}{0}
\setcounter{chrsinstr}{0}
\setcounter{poem}{0}
\setcounter{newflo@tctr}{4}
\setcounter{@contsubnum}{0}
\setcounter{maxsecnumdepth}{2}
\setcounter{sheetsequence}{43}
\setcounter{lastsheet}{96}
\setcounter{lastpage}{90}
\setcounter{bvlinectr}{0}
\setcounter{cp@cntr}{0}
\setcounter{ism@mctr}{0}
\setcounter{xsm@mctr}{0}
\setcounter{csm@mctr}{0}
\setcounter{ksm@mctr}{0}
\setcounter{xksm@mctr}{0}
\setcounter{cksm@mctr}{0}
\setcounter{msm@mctr}{0}
\setcounter{xmsm@mctr}{0}
\setcounter{cmsm@mctr}{0}
\setcounter{bsm@mctr}{0}
\setcounter{workm@mctr}{0}
\setcounter{figure}{1}
\setcounter{lofdepth}{1}
\setcounter{lofdepth}{1}
\setcounter{table}{0}
\setcounter{lotdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{book}{0}
\setcounter{pagenote}{0}
\setcounter{lofdepth}{1}
\setcounter{lotdepth}{1}
\setcounter{parentequation}{0}
\setcounter{r@tfl@t}{0}
\setcounter{NAT@ctr}{0}
\setcounter{Item}{23}
\setcounter{memhycontfloat}{0}
\setcounter{definition}{0}
\setcounter{lemma}{0}
\setcounter{property}{0}
\setcounter{theorem}{0}
\setcounter{remark}{0}
\setcounter{section@level}{2}
}

View File

@ -2,10 +2,12 @@
This chapter covers everything that leads to, and stems from, the solution of DSGE models; a vast terrain. That is to say that the term ``solution'' in the title of the chapter is used rather broadly. You may be interested in simply finding the solution functions to a set of first order conditions stemming from your model, but you may also want to go a bit further. Typically, you may be interested in how this system behaves in response to shocks, whether temporary or permanent. Likewise, you may want to explore how the system comes back to its steady state or moves to a new one. This chapter covers all these topics. But instead of skipping to the topic closest to your needs, we recommend that you read this chapter chronologically, to learn basic Dynare commands and the process of writing a proper .mod file - this will serve as a base to carry out any of the above computations.
\section{An important distinction} \label{sec:distcn}
Before speaking of Dynare, it is important recognize a distinction in model types. This distinction will appear throughout the chapter; in fact, it is so fundamental, that we considered writing separate chapters altogether. But the amount of common material - Dynare commands and syntax - is notable and writing two chapters would have been overly repetitive. Enough suspense; here is the important distinction: \textbf{is your model stochastic or deterministic?}\\
\section{A fundamental distinction} \label{sec:distcn}
Before speaking of Dynare, it is important to recognize a distinction in model types. This distinction will appear throughout the chapter; in fact, it is so fundamental, that we considered writing separate chapters altogether. But the amount of common material - Dynare commands and syntax - is notable and writing two chapters would have been overly repetitive. Enough suspense; here is the important question: \textbf{is your model stochastic or deterministic?}\\
The distinction hinges on \textbf{whether future shocks are known}. In deterministic models, the occurrence of all future shocks is known exactly at the time of computing the model's solution. In stochastic models, instead, only the distribution of future shocks is known. Thus, deterministic models can be solved exactly. Stochastic models must be approximated. Intuitively, if an agent has perfect foresight, she can specify today what each of her precise actions will be in the future. But when the future has a random component to it, the best the agent can do is specify a decision rule for the future: what will her optimal action be contingent on each possible realization of a shock. It is therefore much harder to solve a stochastic model than a deterministic one: in the latter case we look for a series of numbers that match a set of given equations, whereas in the former, we search for a function which, to complicate things, may be non-linear and thus needs to be approximated. In control theory, the latter is usually called a ``closed loop'' solution, and the former an ``open loop''.\\
The distinction hinges on \textbf{whether future shocks are known}. In deterministic models, the occurrence of all future shocks is known exactly at the time of computing the model's solution. In stochastic models, instead, only the distribution of future shocks is known. Let's consider a shock to a model's innovation only in period 1. In a deterministic context, agents will take their decisions knowing that future values of the innovations will be zero in all periods to come. In a stochastic context, agents will take their decisions knowing that the future value of innovations are random but will have zero mean. This isn't the same thing because of Jensen's inequality. Of course, if you consider only a first order linear approximation of the stochastic model, or a linear model, the two cases become practically the same, due to certainty equivalence. A second order approximation will instead lead to very different results, as the variance of shocks will matter. \\
The solution method for each of these model types differs significantly. In deterministic models, a highly accurate solution can be found by numerical methods. The solution is nothing more than a series of numbers that match a given set of equations. Intuitively, if an agent has perfect foresight, she can specify today - at the time of making her decision - what each of her precise actions will be in the future. In a stochastic environment, instead, the best the agent can do is specify a decision, policy or feedback rule for the future: what will her optimal actions be contingent on each possible realization of shocks. In this case, we therefore search for a function satisfying the model's first order conditions. To complicate things, this function may be non-linear and thus needs to be approximated. In control theory, solutions to deterministic models are usually called ``closed loop'' solutions, and those to stochastic models are referred to as ``open loop''.\\
Because this distinction will resurface again and again throughout the chapter, but also because it has been a source of significant confusion in the past, the following gives some additional details.
@ -32,9 +34,9 @@ Because this distinction will resurface again and again throughout the chapter,
\section{Introducing an example}
The goal of this first section is to introduce a simple example. Future sections will aim to code this example into Dynare and analyze its salient features under the influence of shocks - both in a stochastic and a deterministic environment. Note that as a general rule, the examples in the basic chapters, \ref{ch:solbase} and \ref{ch:estbase}, are kept as bare as possible, with just enough features to help illustrate Dynare commands and functionalities. More complex examples are instead presented in the advanced chapters.\\
The model introduced here is a basic RBC model with monopolistic competition, used widely in the literature and taken, in its aspect presented below, from notes available on Jesus Fernandez-Villaverde's very instructive \href{http://www.econ.upenn.edu/~jesusfv/}{website}; this is a good place to look for additional information on any of the following model set-up and discussion.\\
The model introduced here is a basic RBC model with monopolistic competition, used widely in the literature. Its particular notation adopted below is drawn mostly from notes available on Jesus Fernandez-Villaverde's very instructive \href{http://www.econ.upenn.edu/~jesusfv/}{website}; this is a good place to look for additional information on any of the following model set-up and discussion. Note throughout this model description that the use of \textbf{expectation} signs is really only relevant in a stochastic setting, as per the earlier discussion. We will none-the-less illustrate both the stochastic and the deterministic settings on the basis of this example. Thus, when thinking of the latter, you'll have to use a bit of imagination (on top of that needed to think you have perfect foresight!) to ignore the expectation signs.\\
Households maximize consumption, $c_t$ and leisure, $1-l_t$, where $l_t$ is labor input, according to the following utility function
Households maximize utility over consumption, $c_t$ and leisure, $1-l_t$, where $l_t$ is labor input, according to the following utility function
\[
\mathbb{E}_t \sum_{t=0}^{\infty} \beta \left[ \log c_t + \psi \log(1-l_t) \right]
\]
@ -48,7 +50,7 @@ The above equation can be seen as an accounting identity, with total expenditure
Maximization of the household problem with respect to consumption, leisure and capital stock, yields the Euler equation in consumption, capturing the intertemporal tradeoff mentioned above, and the labor supply equation linking labor positively to wages and negatively to consumption (the wealthier, the more leisure due to the decreasing marginal utility of consumption). These equation are
\[
\frac{1}{c_t}=\beta \frac{1}{c_{t+1}} \left( 1 + r_{t+1} - \delta \right)
\frac{1}{c_t}=\beta \mathbb{E}_t \left[ \frac{1}{c_{t+1}} \left( 1 + r_{t+1} - \delta \right) \right]
\]
and
\[
@ -114,15 +116,16 @@ It is convenient to think of the .mod file as containing four distinct blocks, i
\begin{itemize}
\item \textbf{preamble}: lists variables and parameters
\item \textbf{model}: spells out the model
\item \textbf{transition}: gives indications to find the steady state and defines the shocks to the system
\item \textbf{steady state or initial value}: gives indications to find the steady state of a model, or the starting point for simulations or impulse response functions based on the model's solution.
\item \textbf{shocks}: defines the shocks to the system
\item \textbf{computation}: instructs Dynare to undertake specific operations (e.g. forecasting, estimating impulse response functions)
\end{itemize}
Our exposition below will structured according to each of these blocks.
\begin{figure} \label{fig:modstruct}
\begin{center}
\includegraphics[width=1.0\textwidth]{P_ModStruct3}
\includegraphics[width=1.0\textwidth]{P_ModStruct5}
\end{center}
\caption[Structure of the .mod file]{The .mod file contains four logically distinct parts.}
\caption[Structure of the .mod file]{The .mod file contains five logically distinct parts.}
\end{figure}
\section{Filling out the preamble} \label{sec:preamble}
@ -132,7 +135,23 @@ The preamble generally involves three commands that tell Dynare what are the mod
\item \texttt{varexo} starts the list of exogenous variables that will be shocked.
\item \texttt{parameters} starts the list of parameters and assigns values to each.
\end{itemize}
In the case of our example, here's what the \textbf{preamble would look like}:\\
In the case of our example, let's differentiate between the stochastic and deterministic cases. First, we lay these out, then we discuss them.
\subsection{The deterministic case}
The model is inherited exactly as specified in the earlier description, except that we no longer need the $e_t$ variable, as we can make $z_t$ directly exogenous. Thus, the \textbf{preamble would look like}:\\
\\
\texttt{var y c k i l y\_l w r;\\
varexo z;\\
parameters beta psi delta alpha sigma epsilon;\\
alpha = 0.33;\\
beta = 0.99;\\
delta = 0.023;\\
psi = 1.75;\\
sigma = (0.007/(1-alpha));\\
epsilon = 10;}\\
\subsection{The stochastic case}
In this case, we go back to considering the law of motion for technology, consisting of an exogenous shock, $e_t$. With respect to the above, we therefore adjust the list of endogenous and exogenous variables, and add the parameter $\rho$. Here's what the \textbf{preamble would look like}:\\
\\
\texttt{var y c k i l y\_l w r z;\\
varexo e;\\
@ -142,10 +161,16 @@ beta = 0.99;\\
delta = 0.023;\\
psi = 1.75;\\
rho = 0.95; \\
sigma = (0.007\/(1-alpha));\\
sigma = (0.007/(1-alpha));\\
epsilon = 10;}\\
As you can tell, writing a .mod file is really quite straightforward. Two quick comments: \textsf{\textbf{NOTE!}} Remember that each instruction of the .mod file must be terminated by a semicolon (;), although a single instruction can span two lines if you need extra space (just don't put a semicolon at the end of the first line). \textsf{\textbf{TIP!}} You can also comment out any line by starting the line with two forward slashes (//), or comment out an entire section by starting the section with /* and ending with */. For example:\\
\subsection{Comments on your first lines of Dynare code}
As you can tell, writing a .mod file is really quite straightforward. Two quick comments:\\
\textsf{\textbf{NOTE!}} Remember that each instruction of the .mod file must be terminated by a semicolon (;), although a single instruction can span two lines if you need extra space (just don't put a semicolon at the end of the first line).\\
\textsf{\textbf{TIP!}} You can also comment out any line by starting the line with two forward slashes (//), or comment out an entire section by starting the section with /* and ending with */. For example:\\
\\
\texttt{var y c k i l y\_l w r z;\\
varexo e;\\
@ -163,7 +188,7 @@ beta = 0.99;\\
delta = 0.023;\\
psi = 1.75;\\
rho = 0.95; \\
sigma = (0.007\/(1-alpha));\\
sigma = (0.007/(1-alpha));\\
epsilon = 10;}\\
\\
@ -171,7 +196,7 @@ A final \textsf{\textbf{TIP!}}: Dynare accepts standard Matlab expressions in an
\section{Specifying the model} \label{sec:modspe}
\subsection{Model in Dynare notation}
One of the beauties of Dynare is that you can \textbf{input your model's equations naturally}, almost as if you were writing them in an academic paper. This greatly facilitates the sharing of your Dynare files, as your colleagues will be able to understand your code in no-time. There are just a few conventions to follow. Let's first have a look at our \textbf{model in Dynare notation}, and then go through the various Dynare input conventions. What you can already try to do is glance at the model block below and see if you can recognize the equations in the earlier example. See how easy it is to read Dynare code? \\
One of the beauties of Dynare is that you can \textbf{input your model's equations naturally}, almost as if you were writing them in an academic paper. This greatly facilitates the sharing of your Dynare files, as your colleagues will be able to understand your code in no-time. There are just a few conventions to follow. Let's first have a look at our \textbf{model in Dynare notation}, and then go through the various Dynare input conventions. What you can already try to do is glance at the model block below and see if you can recognize the equations from the earlier example. See how easy it is to read Dynare code? \\
\\
\texttt{model;\\
(1/c) = beta*(1/c(+1))*(1+r(+1)-delta);\\
@ -179,7 +204,7 @@ One of the beauties of Dynare is that you can \textbf{input your model's equatio
c+i = y;\\
y = (k(-1)$\hat{}$alpha)*(exp(z)*l)$\hat{}$(1-alpha);\\
w = y*((epsilon-1)/epsilon)*(1-alpha)/l;\\
r = y*((epsilon-1)/epsilon)*alpha/k;\\
r = y*((epsilon-1)/epsilon)*alpha/k(-1);\\
i = k-(1-delta)*k(-1);\\
y\_l = y/l;\\
z = rho*z(-1)+e;\\
@ -187,6 +212,8 @@ end;}\\
Just in case you need a hint or two to recognize these equations, here's a brief description: the first equation is the Euler equation in consumption. The second the labor supply function. The third the accounting identity. The fourth is the production function. The fifth and sixth are the marginal cost equal to markup equations. The seventh is the investment equality. The eighth an identity that may be useful and the last the equation of motion of technology.
\textsf{\textbf{NOTE!}} that the above model specification corresponds to the \textbf{stochastic case}; indeed, notice that the law of motion for technology is included, as per our discussion of the preamble. The corresponding model for the \textbf{deterministic casce} would simply loose the last equation.
\subsection{General conventions}
The above example illustrates the use of a few important commands and conventions to translate a model into a Dynare-readable .mod file.
\begin{itemize}
@ -201,12 +228,12 @@ The above example illustrates the use of a few important commands and convention
\begin{itemize}
\item Variables entering the system with a time $t$ subscript are written plainly. For example, $x_t$ would be written $x$.
\item Variables entering the system with a time $t-n$ subscript are written with $(-n)$ following them. For example, $x_{t-2}$ would be written $x(-2)$ (incidentally, this would count as two backward looking variables).
\item In the same way, variables entering the system with a time $t+n$ subscript are written with $(+n)$ following them. For example, $x_{t+2}$ would be written $x(+2)$. Writing $x(2)$ is also allowed, but this notation makes it harder to count the number of forward looking variables; more on this below \ldots
\item In the same way, variables entering the system with a time $t+n$ subscript are written with $(+n)$ following them. For example, $x_{t+2}$ would be written $x(+2)$. Writing $x(2)$ is also allowed, but this notation makes it slightly harder to count by hand the number of forward looking variables (a useful measure to check); more on this below \ldots
\end{itemize}
\subsection{Timing conventions}
\begin{itemize}
\item In Dynare, the timing of each variable reflects when that variable is decided. For instance, our capital stock is not decided today, but yesterday (recall that it is a function of yesterday's investment and capital stock); it is what we call in the jargon a \textbf{predetermined} variable. Thus, eventhough in the example presented above we wrote $k_{t+1}=i_t + (1-\delta)k_t$, we would write it in Dynare as \texttt{k=i+(1-delta)*k(-1)}.
\item In Dynare, the timing of each variable reflects when that variable is decided. For instance, our capital stock is not decided today, but yesterday (recall that it is a function of yesterday's investment and capital stock); it is what we call in the jargon a \textbf{predetermined} variable. Thus, eventhough in the example presented above we wrote $k_{t+1}=i_t + (1-\delta)k_t$, as in many papers, we would translate this equation into Dynare as \texttt{k=i+(1-delta)*k(-1)}.
\item As another example, consider that in some wage negociation models, wages used during a period are set the period before. Thus, in the equation for wages, you can write wage in period $t$ (when they are set), but in the labor demand equation, wages should appear with a one period lag.
\item A slightly more roundabout way to explain the same thing is that for stock variables, you must use a ``stock at the end of the period'' concept. It is investment during period $t$ that sets stock at the end of period $t$. Be careful, a lot of papers use the ``stock at the beginning of the period'' convention, as we did (on purpose to highlight this distinction!) in the setup of the example model above.
\end{itemize}
@ -215,36 +242,49 @@ The above example illustrates the use of a few important commands and convention
\begin{itemize}
\item A (+1) next to a variable tells Dynare to count the occurrence of that variable as a jumper or forward-looking or non-predetermined variable.
\item \textbf{Blanchard-Kahn} conditions are met only if the number of non-predetermined variables equals the number of eigenvalues greater than one. If this condition is not met, Dynare will put up a warning.
\item Note that a variable may occur both as predetermined and non-predetermined. For instance, consumption could appear with a lead in the Euler equation, but also with a lag in a habit formation equation. In this case, the second order difference equation would have two eigenvalues, one needing to be greater and the other smaller than one for stability.
\item Note that a variable may occur both as predetermined and non-predetermined. For instance, consumption could appear with a lead in the Euler equation, but also with a lag in a habit formation equation, if you had one. In this case, the second order difference equation would have two eigenvalues, one needing to be greater and the other smaller than one for stability.
\end{itemize}
\subsection{Linear and log-linearized models}
There are two other variants of the system's equations which Dynare accommodates. First, the \textbf{linear model} and second, the \textbf{model in exp-logs}. In the first case, all that is necessary is to write the term \texttt{(linear)} next to the command \texttt{model}. Our example, with just the equation for $y_l$ for illustration, would look like:\\
\\
\texttt{model (linear);\\
y*\_l=y* - l*;\\
yy\_l=yy - ll;\\
end;}\\
\\
where a star next to a variable means difference from steady state.\\
where repeating a letter for a variable means difference from steady state.\\
Otherwise, you may be interested to have Dynare take Taylor series expansions in logs rather than in levels; this turns out to be a very useful option when estimating models with unit roots, as we will see in chapter \ref{ch:estbase}. If so, simply rewrite your equations by taking the exponential and logarithm of each variable. The Dynare input convention makes this very easy to do. Our example would need to be re-written as follows (just shown for the first two equations)\\
\\
\texttt{model;\\
(1/exp(c')) = beta*(1/exp(c'(+1)))*(1+exp(r'(+1))-delta);\\
psi*exp(c')/(1-exp(l')) = exp(w');\\
(1/exp(cc)) = beta*(1/exp(cc(+1)))*(1+exp(rr(+1))-delta);\\
psi*exp(cc)/(1-exp(ll)) = exp(ww);\\
end;}\\
\\
where a prime next to a variable means log of that variable, so that the level of a variable is given by $exp(variable')$.
where, this time, repeating a letter for a variable means log of that variable, so that the level of a variable is given by $exp(repeated variable)$.
\section{Specifying transitions (steady states and shocks)} \label{sec:ssshock}
A ``transition'' usually entails two things: starting from somewhere and ending up somewhere else! In the more mathematical language of modern economics, this usually corresponds to an original steady state and a shock, and at times also a final (different) steady state. The combination of steady states and shocks will vary according to whether you're dealing with a deterministic or a stochastic model (remember the difference? if not, have a quick look at section \ref{sec:distcn} above). We will make this clear by introducing appropriate subsection headings below. \\
\section{Specifying steady states and/or initial values} \label{sec:ssshock}
Material in this section has created much confusion in the past. But with some attention to the explanations below, you should get through unscathed. Let's start by emphasizing the uses of this section of the .mod file. First, recall that stochastic models need to be linearized. Thus, they need to have a steady state. One of the functions of this section is indeed to provide these steady state values, or approximations of values. Second, irrespective of whether you're working with a stochastic or deterministic model, you may be interested to start your simulations or impulse response functions from either a steady state, or another given point. This section is also useful to specify this starting value. Let's see in more details how all this works.\\
\subsection{Specifying steady states - introduction}
To specify steady states, the appropriate commands are \texttt{initval}, \texttt{endval} or, more rarely, \texttt{histval} which is covered only in the \href{http://www.cepremap.cnrs.fr/juillard/mambo/index.php?option=com_content&task=view&id=51&Itemid=84}{Reference Manual}. Here, we first dwell on the \texttt{initval} command and later come back to the \texttt{endval} command which is used only in certain circumstances. \\
In passing, though, note that the relevant commands in this section are \texttt{initval}, \texttt{endval} or, more rarely, \texttt{histval} which is covered only in the \href{http://www.cepremap.cnrs.fr/juillard/mambo/index.php?option=com_content&task=view&id=51&Itemid=84}{Reference Manual}. The first two are instead covered in what follows. \\
The \texttt{initval} command is used to declare your model's starting values, which actually don't necessarily need to be steady state values. This opens the door to several possibilities. You can provide exact or approximate steady state values, or you can simply specify an arbitrary point from which to start your simulations. Let's be a little more concrete and analyze each of these cases.\\
\subsection{Stochastic models and steady states}
In a stochastic setting, your model will need to be linearized before it is solved. To do so, Dynare needs to know your model's steady state (more details on finding a steady state, as well as tips to do so more efficiently, are provided in section \ref{sec:findsteady} below). You can either enter exact steady state values into your .mod file, or just approximations and let Dynare find the exact steady state. In either case, these values are entered in the \texttt{initval} block, as in the following fashion: \\
\\
\texttt{initval;\\
k = 9;\\
c = 0.7;\\
l = 0.3;\\
w = 2.0;\\
r = 0;\\
z = 0; \\
e = 0;\\
end;}
\\
\textbf{If the command \texttt{initival} is followed by \texttt{steady}}, Dynare will understand that simulations or impulse response functions should begin from the steady state. In addition, Dynare will check to see if the values you provided exactly match or only approximate the steady state. In the latter case, Dynare will replace your guesstimates with the model's true steady state values. In our example, this would look like:\\
Then, by using the command \texttt{steady}, you can control whether you want to start your simulations or impulse response functions from the steady state, or from the exact values you specified in the \texttt{initval} block. Adding \texttt{steady} just after your \texttt{initval} block will instruct Dynare to consider your initial values as mere approximations and start simulations or impulse response functions from the exact steady state. On the contrary, if you don't add the command \texttt{steady}, your simulations or impulse response functions will start from your initial values, even if Dynare will have calculated your model's exact steady state for the purpose of linearization. \\
For the case in which you would like simulations and impulse response functions to begin at the steady state, the above block would be expanded to yield:\\
\\
\texttt{initval;\\
k = 9;\\
@ -255,34 +295,44 @@ The \texttt{initval} command is used to declare your model's starting values, wh
z = 0; \\
e = 0;\\
end;\\
\\
steady;}
\\
Note that the \texttt{initval} block is closed with \texttt{end}. Within the block you should list values for all your variables - endogenous and exogenous (even if the latter is not required for stochastic models, but you may want to get in the habit of doing so anyhow).\\
\textbf{If the command \texttt{initival} is not followed by \texttt{steady}}, Dynare will start the simulations or impulse response function from whatever values you provide. This means that if you provided exact steady state values, Dynare will analyze how shocks will move your system away from steady state. But if you provided other values, Dynare will calculate the steady state anyhow, to be used when linearizing the model as in the case of a stochastic model, but will begin simulations or impulse response functions from the values you entered. \textsf{\textbf{TIP!}} If you're dealing with a stochastic model, remember that its linear approximation is good only in the vicinity of the steady state, thus we strongly recommend that you start your simulations from a steady state; this means either using the command \texttt{steady} or entering exact steady state values. \\
\textsf{\textbf{TIP!}} If you're dealing with a stochastic model, remember that its linear approximation is good only in the vicinity of the steady state, thus it is strongly recommended that you start your simulations from a steady state; this means either using the command \texttt{steady} or entering exact steady state values. \\
\subsection{Finding a steady state}
\subsection{Deterministic models and initial values}
Deterministic models do not need to be linearized in order to be solved. Thus, technically, you do not need to provide a steady state for these model. But practically, most researchers are still interested to see how a model reacts to shocks when originally in steady state. In the deterministic case, the \texttt{initval} block serves very similar functions as described above. If you wanted to shock your model starting from a steady state value, you would enter approximate (or exact) steady state values in the \texttt{initval} block, followed by the command \texttt{steady}. Otherwise, if you wanted to begin your solution path from an arbitrary point, you would enter those values in your \texttt{initval} block and not use the \texttt{steady} command. An illustration of the \texttt{initval} block in the deterministic case appears further below. \\
The difficulty in the above, of course, is calculating the actual steady state values. Doing so borders on a form of art, and luck is unfortunately part of the equation. Yet, the following \textsf{\textbf{TIPS!}} may help.\\
\subsection{Finding a steady state} \label{sec:findsteady}
The difficulty in the above, of course, is calculating actual steady state values. Doing so borders on a form of art, and luck is unfortunately part of the equation. Yet, the following \textsf{\textbf{TIPS!}} may help.\\
As mentioned above, Dynare can help in finding your model's steady state by calling the appropriate Matlab functions. But it is usually only successful if the initial values you entered are close to the true steady state. If you have trouble finding the steady state of your model, you can begin by playing with the \textbf{options following the \texttt{steady} command}. These are:
\begin{itemize}
\item \texttt{solve\_algo = 0}: uses Matlab Optimization Toolbox FSOLVE
\item \texttt{solve\_algo = 1}: uses DynareÕs own nonlinear equation solver
\item \texttt{solve\_algo = 2}: splits the model into recursive blocks and solves each block in turn. This is the default option if none are specified.
\item ** =3 uses Sims solver. Is this still in version 4?
\item \texttt{solve\_algo = 2}: splits the model into recursive blocks and solves each block in turn.
\item \texttt{solve\_algo = 3}: uses the Sims solver. This is the default option if none are specified.
\end{itemize}
For complicated models, finding good numerical initial values for the endogenous variables is the trickiest part of finding the equilibrium of that model. Often, it is better to start with a smaller model and add new variables one by one.\\
For complicated models, finding suitable initial values for the endogenous variables is the trickiest part of finding the equilibrium of that model. Often, it is better to start with a smaller model and add new variables one by one.\\
But even for simpler models, you may still run into difficulties in finding your steady state. If so, another option is to \textbf{enter your model in linear terms}. In this case, variables would be expressed in percent deviations from steady state. Thus, their initial values would all be zero. Unfortunately, if any of your original (non-linear) equations involve sums (a likely fact), your linearized equations will include ratios of steady state values, which you would still need to calculate. Yet, you may be left needing to calculate fewer steady state values than in the original, non-linear, model. \\
Alternatively, you could also use an \textbf{external program to calculate exact steady state values}. For instance, you could write an external Maple file and then enter the steady state solution by hand in Dynare. But of course, this procedure could be time consuming and bothersome, especially if you want to alter parameter values (and thus steady states) to undertake robustness checks. In that case, you could write a Matlab program to find your model's steady state. Doing so has two clear advantages: first, Matlab is able to find steady states analytically - a procedure that can be more effective than numerical estimation. And second, you can incorporate a Matlab program directly into your .mod file so that running loops with different parameter values, for instance, becomes seamless. When doing so, your matlab (.m) file should have the same name as your .mod file, followed by \texttt{\_steadystate} For instance, if your .mod file is called \texttt{example.mod}, your Matlab file should be called \texttt{example\_steadystate.m} Note that Dynare will automatically check the directory where you've saved your .mod file to see if such a Matlab file exists. If so, it will use that file to find steady state values regardless of whether you've provided initial values in your .mod file or used the command \texttt{steady}. (** provide example of .m file below)\\
Alternatively, you could also use an \textbf{external program to calculate exact steady state values}. For instance, you could write an external \textbf{Maple} file and then enter the steady state solution by hand in Dynare. But of course, this procedure could be time consuming and bothersome, especially if you want to alter parameter values (and thus steady states) to undertake robustness checks. \\
The alternative is to write a \textbf{Matlab} program to find your model's steady state. Doing so has the clear advantages of being able to incorporate your Matlab program directly into your .mod file so that running loops with different parameter values, for instance, becomes seamless. \textsf{\textbf{NOTE!}} When doing so, your matlab (.m) file should have the same name as your .mod file, followed by \texttt{\_steadystate} For instance, if your .mod file is called \texttt{example.mod}, your Matlab file should be called \texttt{example\_steadystate.m} and should be saved in the same directory as your .mod file. Dynare will automatically check the directory where you've saved your .mod file to see if such a Matlab file exists. If so, it will use that file to find steady state values regardless of whether you've provided initial values in your .mod file. \\
Because Matlab does not work with analytical expressions, though (unless you're working with a particular toolbox), you need to do a little work to write your steady state program. It is not enough to simply input the equations as you've written them in your .mod file and ask Matlab to solve the system. You will instead need to write your steady state program as if you were solving for the steady state by hand. That is, you need to input your expressions sequentially, whereby each left-hand side variable is written in terms of known parameters or variables already solved in the lines above. For example, the steady state file corresponding to the above example, in the stochastic case, would be: (** add example file) \\
\subsection{Checking system stability}
\textsf{\textbf{TIP!}} A handy command that you can add after the \texttt{initval} or \texttt{endval} block (following the \texttt{steady} command if you decide to add one) is the \texttt{check} command. This \textbf{computes and displays the eigenvalues of your system} which are used in the solution method. As mentioned earlier, a necessary condition for the uniqueness of a stable equilibrium in the neighborhood of the steady state is that there are
as many eigenvalues larger than one in modulus as there are forward looking variables in the system. If this condition is not met, Dynare will tell you that the Blanchard-Kahn conditions are not satisfied (whether or not you insert the \texttt{check} command). \\
\subsection{Adding shocks - deterministic models}
\section{Adding shocks}
\begin{comment}
\begin{figure} \label{fig:shockmodel}
@ -293,19 +343,21 @@ Alternatively, you could also use an \textbf{external program to calculate exact
\end{figure}
\end{comment}
When working with a deterministic model, you have the choice of introducing both temporary and permanent shocks. One thing to note, though, is that a deterministic model is written somewhat differently than our earlier example. The only difference is that we no longer need the $e_t$ variable, as we can make $z_t$ directly exogenous. That is, we can replace $e_t$ with $z_t$ in the \texttt{varexo} instruction line, and delete $z_t$ from the \texttt{var} line. In the model block we can delete the last equation corresponding to the motion of technology. This is because in a deterministic model, the shock affects the exogenous variable directly. Let's see how \ldotsÊ\\
\subsection{Deterministic models - temporary shocks}
When working with a deterministic model, you have the choice of introducing both temporary and permanent shocks. The distinction is that under a temporary shock, the model eventually comes back to steady state, while under a permanent shock, the model reaches a new steady state. In both cases, though, the shocks are entirely expected, as explained in our original discussion on stochastic and deterministic models. \\
To work with a \textbf{temporary shock}, you are free to set the duration and level of the shock. To specify a shock that lasts 9 periods on $e_t$, for instance, you would write:\\
To work with a \textbf{temporary shock}, you are free to set the duration and level of the shock. To specify a shock that lasts 9 periods on $z_t$, for instance, you would write:\\
\\
\texttt{shocks;\\
var z;
var z;\\
periods 1:9;\\
values 0.1;\\
end;}\\
Given the above instructions, Dynare would replace the value of $z_t$ specified in the \texttt{initval} block with the value of 0.1 entered above. If variables were in logs, this would have corresponded to a 10\% shock. Note that you can also use the \texttt{mshock} command which multiplies the initial value of an exogenous variable by the \texttt{mshock} value (** is this feature still in version 4?). Finally, note that we could have entered future periods in the shocks block, such as \texttt{periods 5:10}, in order to simulate an \textbf{expected temporary} shock. You could also increase the terminal period to the maximum scale of the simulation, in order to introduce an \textbf{expected permanent} shock. (** is this true?)\\
Given the above instructions, Dynare would replace the value of $z_t$ specified in the \texttt{initval} block with the value of 0.1 entered above. If variables were in logs, this would have corresponded to a 10\% shock. Note that you can also use the \texttt{mshocks} command which multiplies the initial value of an exogenous variable by the \texttt{mshocks} value. Finally, note that we could have entered future periods in the shocks block, such as \texttt{periods 5:10}, in order to study the anticipatory behavior of agents in response to future shocks.\\
To study the effects of a \textbf{permanent shock} hitting the economy today, such as a structural change in your model, you would not specify actual ``shocks'', but would simply tell the system to which steady state values you would like it to move to and let Dynare calculate the transition path. To do so, you would use the \texttt{endval} block following the usual \texttt{initval} block. For instance, you may specify all values to remain common between the two blocks, except for the value of technology which presumably changes permanently. The corresponding instructions would be:\\
\subsection{Deterministic models - permanent shocks}
To study the effects of a \textbf{permanent shock} hitting the economy today, such as a structural change in your model, you would not specify actual ``shocks'', but would simply tell the system to which (steady state) values you would like it to move and let Dynare calculate the transition path. To do so, you would use the \texttt{endval} block following the usual \texttt{initval} block. For instance, you may specify all values to remain common between the two blocks, except for the value of technology which you may presume changes permanently. The corresponding instructions would be:\\
\\
\texttt{initval;\\
k = 9;\\
@ -327,9 +379,17 @@ endval;\\
end;\\
steady;}\\
\\
where \texttt{steady} can also be added to the \texttt{endval} block. Doing so has the same effect as mentioned earlier, namely of computing the steady state value for endogenous variables using the information given in the \texttt{endval} block. Specifically, the values given for endogenous variables are used as initial guess for computation, and the values given for exogenous variables are kept constant over time. In our example case, we make use of the second \texttt{steady} since the terminal steady state values are bound to be somewhat different from those in the original steady state after changing the value of technology.\\
where \texttt{steady} can also be added to the \texttt{endval} block, and serves the same functionality as described earlier (namely, of telling Dynare to start and/ or end at a steady state close to the values you entered). In our example, we make use of the second \texttt{steady} since the actual terminal steady state values are bound to be somewhat different from those we entered, which are but the initial values for all variables except for technology.\\
\subsection{Adding shocks - stochastic models}
In the above example, the value of technology would move to 0.1 in period 1 (tomorrow) and thereafter. \textsf{\textbf{TIP!}} If you instead wanted to study the effects of a permanent but future shock, you would have to add a \texttt{shocks} block after the \texttt{endval} block to ``undo'' the first several periods of the permanent shock. For instance, suppose you wanted the value of technology to move to 0.1, but only in period 10. Then you would follow the above \texttt{endval} block with:\\
\\
\texttt{shocks;\\
var z;\\
periods 1:9;\\
values 0;\\
end;}\\
\subsection{Stochastic models}
Recall from our earlier description of stochastic models that shocks are only allowed to be temporary. A permanent shock cannot be accommodated due to the need to stationarize the model around a steady state. Furthermore, shocks can only hit the system today, as the expectation of future shocks must be zero. With that in mind, we can however make the effect of the shock propagate slowly throughout the economy by introducing a ``latent shock variable'' such as $e_t$ in our example, that affects the model's true exogenous variable, $z_t$ in our example, which is itself an $AR(1)$, exactly as in the model we introduced from the outset. In that case, though, we would declare $z_t$ as an endogenous variable and $e_t$ as an exogenous variable, as we did in the preamble of the .mod file in section \ref{sec:preamble}. Supposing we wanted to add a shock with variance $\sigma^2$, where $\sigma$ is determined in the preamble block, we would write: \\
\\
@ -338,23 +398,23 @@ var e = sigma $\widehat{}$ 2;\\
end;}\\
\\
\subsection{Some useful details}
Two last things to note: first, you can actually \textbf{mix in deterministic shocks} in stochastic models by using the commands \texttt{varexo\_det} and listing some shocks as lasting more than one period in the \texttt{shocks} block. For information on how to do so, please see the \href{http://www.cepremap.cnrs.fr/juillard/mambo/index.php?option=com_content&task=view&id=51&Itemid=84}{Reference Manual}.\\
Second, a handy command that you can add after the \texttt{initval} or \texttt{endval} block (following the \texttt{steady} command if you decide to add one) is the \texttt{check} command. This \textbf{computes and displays the eigenvalues of your system} which are used in the solution method. As mentioned earlier, a necessary condition for the uniqueness of a stable equilibrium in the neighborhood of the steady state is that there are
as many eigenvalues larger than one in modulus as there are forward looking variables in the system. If this condition is not met, Dynare will tell you that the Blanchard-Kahn conditions are not satisfied (whether or not you insert the \texttt{check} command). \\
\textsf{\textbf{TIP!}} You can actually \textbf{mix in deterministic shocks} in stochastic models by using the commands \texttt{varexo\_det} and listing some shocks as lasting more than one period in the \texttt{shocks} block. For information on how to do so, please see the \href{http://www.cepremap.cnrs.fr/juillard/mambo/index.php?option=com_content&task=view&id=51&Itemid=84}{Reference Manual}. This can be particularly useful if you're studying the effects of anticipated shocks in a stochastic model. For instance, you may be interested in what happens to your monetary model if agents began expecting higher inflation, or a depreciation of your currency. \\
\section{Selecting a computation} \label{sec:compute}
So far, we have written an instructive .mod file, but what should Dynare do with it? What are we interested in? In most cases, it will be impulse response functions (IRFs) due to the external shocks. Let's see which are the appropriate commands to give to Dynare. Again, we will distinguish between deterministic and stochastic models. \\
\subsection{For deterministic models}
In the deterministic case, all you need to do is add the command \texttt{simul} at the bottom of your .mod file. Note that the command takes the option \mbox{\texttt{[ (periods=INTEGER) ] }} The command \texttt{Simul} triggers the computation of a deterministic simulation of the model for the number of periods set in the option. To do so, it uses a Newton method to solve simultaneously all the equations for every period (see \citet{Juillard1996} for details). The simulated variables are available in global matrix y\_ in which variables are arranged row by row, in alphabetical order. \\
In the deterministic case, all you need to do is add the command \texttt{simul} at the bottom of your .mod file. Note that the command takes the option \mbox{\texttt{[ (periods=INTEGER) ] }} The command \texttt{simul} triggers the computation a numerical simulation of the trajectory of the model's solution for the number of periods set in the option. To do so, it uses a Newton method to solve simultaneously all the equations for every period (see \citet{Juillard1996} for details). Note that unless you use the \texttt{endval} command, the algorithm makes the simplifying assumption that the system is back to equilibrium after the specified number of periods. Thus, you must specify a large enough number of periods such that increasing it further doesn't change the simulation for all practical purpose. In the case of a temporary shock, for instance, the trajectory will basicaly describe how the system gets back to equilibrium after being perturbed from the shocks you entered.\\
\subsection{For stochastic models}
In the more common case of stochastic models, the command \texttt{stoch\_simul} is appropriate. This command instructs Dynare to compute a Taylor approximation of the decision and transition functions for the model (the equations listing current values of the endogenous variables of the model as a function of the previous state of the model and current shocks), impulse response
functions and various descriptive statistics (moments, variance decomposition, correlation and autocorrelation coefficients).\footnote{For correlated shocks, the variance decomposition is computed as in the VAR literature through a Cholesky
decomposition of the covariance matrix of the exogenous variables. When the shocks are correlated, the variance
decomposition depends upon the order of the variables in the varexo command. (** make sure it depends on the order of variable declaration and not the alphabetical order. Also, is it possible to declare the correlation between shocks in a triangular representation?).} If you're interested to peer a little further into what exactly is going on behind the scenes of Dynare's computations, have a look at Chapter \ref{ch:solbeh}. Here instead, we focus on the application of the command and reproduce below the table of options that can be added to \texttt{stoch\_simul}. (** maybe just include a subset and refer to Ref Man for complete set? ie is the following useful as is, or too long?) \\
decomposition depends upon the order of the variables in the varexo command.}\\
Impulse response functions are the expected future path of the endogenous variables conditional on a shock in period 1.\textsf{\textbf{TIP!}} If you linearize your model up to a first order, impulse response functions are simply the algebraic forward iteration of your model's policy or decision rule. If you instead linearize to a second order, impulse response functions will be the result of actual simulations of future shocks from the distribution you specified. But future shocks will not have a significant impact on your results, since they get averaged between each Monte Carlo trial and in the limit should be zero, given their mean of zero. In this case, Dynare will return the actual sample moments from the simulations. For first order linearizations, Dynare will instead report theoretical moments. In both cases, the return to steady state is asymptotic, \textsf{\textbf{TIP!}} thus you should make sure to specify sufficient periods in your IRFs such that you actually see your graphs return to steady state. Details on implementing this appear below.\\
If you're interested to peer a little further into what exactly is going on behind the scenes of Dynare's computations, have a look at Chapter \ref{ch:solbeh}. Here instead, we focus on the application of the command and reproduce below the most common options that can be added to \texttt{stoch\_simul}. For a complete list of options, please see the \href{http://www.cepremap.cnrs.fr/juillard/mambo/index.php?option=com_content&task=view&id=51&Itemid=84}{Reference Manual}. \\
\textbf{Options following the \texttt{stoch\_simul} command:}
\begin{itemize}
@ -366,51 +426,27 @@ statistics (default = 100).
\item hp\_ngrid = INTEGER: number of points in the grid for the discreet Inverse Fast Fourier Transform used in the
HP filter computation. It may be necessary to increase it for highly autocorrelated processes (default = 512).
\item irf = INTEGER: number of periods on which to compute the IRFs (default = 40). Setting IRF=0, suppresses the
plotting of IRFÕs.
plotting of IRFÕs.
\item relative\_irf requests the computation of normalized IRFs in percentage of the standard error of each shock.
\item nocorr: doesnÕt print the correlation matrix (printing is the default).
\item nofunctions: doesnÕt print the coefficients of the approximated solution (printing is the default).
\item nomoments: doesnÕt print moments of the endogenous variables (printing them is the default).
\item noprint: cancel any printing; usefull for loops.
\item order = 1 or 2 : order of Taylor approximation (default = 2), unless you're working with a linear model in which case the order is automatically set to 1.
\item periods = INTEGER: specifies the number of periods to use in simulations (default = 0).
\item periods = INTEGER: specifies the number of periods to use in simulations (default = 0).
\item qz\_criterium = INTEGER or DOUBLE: value used to split stable from unstable eigenvalues in reordering the
Generalized Schur decomposition used for solving 1st order problems (default = 1.000001).
\item replic = INTEGER: number of simulated series used to compute the IRFs (default = 1 if order = 1, and 50
otherwise).
\item simul\_seed = INTEGER or DOUBLE or (EXPRESSION): specifies a seed for the random generator so as to obtain the
\item simul\_seed = INTEGER or DOUBLE or (EXPRESSION): specifies a seed for the random number generator so as to obtain the
same random sample at each run of the program. Otherwise a different sample is used for each run (default: seed
not specified). (** give more explanations here?)
not specified). If you use the option \texttt{period} after \texttt{stoch\_simul}, and have linearized your model to the second order, Dynare will actually undertake Monte Carlo simulations to generate moments of your variables. Because of the simulation, results are bound to be slightly different each time you run your program, except if you fix the seed for the random number generator. \textsf{\textbf{TIP!}} If you do decide to fix the seed, you should at least try to run your program without using \texttt{simul\_seed}, just to check the robustness of your results.
\end{itemize}
Going back to our good old example, suppose we are interested in printing all the various measures of moments of our variables, want to see impulse response functions for all variables, are basically happy with all default options and want to carry out simulations over a good number of periods. We would then end our .mod file with the following command:\\
Going back to our good old example, suppose we were interested in printing all the various measures of moments of our variables, want to see impulse response functions for all variables, are basically happy with all default options and want to carry out simulations over a good number of periods. We would then end our .mod file with the following command:\\
\\
\texttt{stoch\_simul(periods=2100);}\\
\section{Executing the .mod file and interpreting results}
To see this all come to life, let's run our .mod file, which is conveniently installed by default in the Dynare ``examples'' directory (the .mod file corresponding to the stochastic model is called ExSolStoch.mod and that corresponding to the deterministic model is called ExSolDet.mod). \\
\textbf{To run a .mod file}, navigate within Matlab to the directory where the example .mod files are stored. You can do this by clicking in the ``current directory'' window of Matlab, or typing the path directly in the top white field of Matlab. Once there, all you need to do is place your cursor in the Matlab command window and type, for instance, \texttt{dynare ExSolStoch;} to execute your .mod file. \\
Running these .mod files should take at most 30 seconds. As a result, you should get two forms of output - tabular in the Matlab command window and graphical in one or more pop-up windows. Let's review these results.\\
\subsection{For stochastic models}
\textbf{The tabular results} can be summarized as follows:
\begin{enumerate}
\item \textbf{Model summary:} a count of the various variable types in your model (endogenous, jumpers, etc...).
\item \textbf{Eigenvalues} should be displayed, and you should see a confirmation of the Blanchard-Kahn conditions if you used the command \texttt{check} in your .mod file.
\item \textbf{Matrix of covariance of exogenous shocks:} this should square with the values of the shock variances and co-variances you provided in the .mod file.
\item \textbf{Policy and transition functions:} Solving the rational exectation model, $\mathbb{E}_t[f(y_{t+1},y_t,y_{t-1},u_t)]=0$ , means finding an unkown function, $y_t = g(y_{t-1},u_t)$ that could be plugged into the original model and satisfy the implied restrictions (the first order conditions). A first order approximation of this function can be written as $y_t = \bar{y} + g_y \hat{y}_{t-1} + g_u u_t$, with $\hat{y}_t = y_t-\bar{y}$ and $\bar{y}$ being the steadystate value of $y$, and where $g_x$ is the partial derivative of the $g$ function with respect to variable $x$. In other words, the function $g$ is a time recursive (approximated) representation of the model that can generate timeseries that will approximatively satisfy the rational expectation hypothesis contained in the original model. In Dynare, the table ``Policy and Transition function'' contains the elements of $g_y$ and $g_u$. Details on the policy and transition function can be found in Chapter \ref{ch:estadv}.
\item \textbf{Moments of simulated variables:} up to the fourth moments.
\item \textbf{Correlation of simulated variables:} these are the contemporaneous correlations, presented in a table.
\item \textbf{Autocorrelation of simulated variables:} up to the fifth lag, as specified in the options of \texttt{stoch\_simul}.
\end{enumerate}
\textbf{The graphical results}, instead, show the actual impulse response functions for each of the endogenous variables, given that they actually moved. These can be especially useful in visualizing the shape of the transition functions and the extent to which each variable is affected. \textsf{\textbf{TIP!}} If some variables do not return to their steady state, either check that you have included enough periods in your simulations, or make sure that your model is stationary, i.e. that your steady state actually exists and is stable. If not, you should detrend your variables and rewrite your model in terms of those variables.
\subsection{For deterministic models}
Automatically displayed results are much more scarce in the case of deterministic models. If you entered \texttt{steady}, you will get a list of your steady state results. Eigenvalues will also be displayed and you should receive a statement that the rank condition has been satisfied, if all goes well! (** this is despite not having entered \texttt{check}?) Finally, you will see some intermediate output: the errors at each iteration of the Newton solver used to estimate the solution to your model. \textsf{\textbf{TIP!}} You should see these errors decrease upon each iteration; if not, your model will probably not converge. If so, you may want to try to increase the periods for the transition to the new steady state (the number of simulations periods). But more often, it may be a good idea to revise your equations. Of course, although Dynare does not display a rich set of statistics and graphs corresponding to the simulated output, it does not mean that you cannot create these by hand from Matlab. To do so, you should start by looking at section \ref{sec:FindOut} of chapter \ref{ch:soladv} on finding, saving and viewing your output.
\section{The complete .mod file}
For completion's sake, and for the pleasure of seeing our work bear its fruits, here are the complete .mod files corresponding to our example for the deterministic and stochastic case. These can be found in the example folder of your Dynare installation under: \texttt{RBC\_Monop\_JFV.mod} for stochastic models and \texttt{RBC\_Monop\_Det.mod} for deterministic models.
@ -433,7 +469,7 @@ model;\\
c+i = y;\\
y = (k(-1)$\hat{}$alpha)*(exp(z)*l)$\hat{}$(1-alpha);\\
w = y*((epsilon-1)/epsilon)*(1-alpha)/l;\\
r = y*((epsilon-1)/epsilon)*alpha/k;\\
r = y*((epsilon-1)/epsilon)*alpha/k(-1);\\
i = k-(1-delta)*k(-1);\\
y\_l = y/l;\\
z = rho*z(-1)+e;\\
@ -463,12 +499,11 @@ stoch\_simul(periods=2100);}\\
\texttt{var y c k i l y\_l w r ;\\
varexo z;\\
parameters beta psi delta alpha rho sigma epsilon;\\
parameters beta psi delta alpha sigma epsilon;\\
alpha = 0.33;\\
beta = 0.99;\\
delta = 0.023;\\
psi = 1.75;\\
rho = 0.95; \\
sigma = (0.007\/(1-alpha));\\
epsilon = 10;\\
\\
@ -478,7 +513,7 @@ model;\\
c+i = y;\\
y = (k(-1)$\hat{}$alpha)*(exp(z)*l)$\hat{}$(1-alpha);\\
w = y*((epsilon-1)/epsilon)*(1-alpha)/l;\\
r = y*((epsilon-1)/epsilon)*alpha/k;\\
r = y*((epsilon-1)/epsilon)*alpha/k(-1);\\
i = k-(1-delta)*k(-1);\\
y\_l = y/l;\\
end;\\
@ -504,6 +539,32 @@ end;\\
\\
simul(periods=2100);}\\
\section{File execution and results}
To see this all come to life, let's run our .mod file, which is conveniently installed by default in the Dynare ``examples'' directory (the .mod file corresponding to the stochastic model is called RBC\_Monop\_JFV.mod and that corresponding to the deterministic model is called RBC\_Monop\_Det.mod). (** note, this may not be the case when testing the beta version of Matlab version 4) \\
\textbf{To run a .mod file}, navigate within Matlab to the directory where the example .mod files are stored. You can do this by clicking in the ``current directory'' window of Matlab, or typing the path directly in the top white field of Matlab. Once there, all you need to do is place your cursor in the Matlab command window and type, for instance, \texttt{dynare ExSolStoch;} to execute your .mod file. \\
Running these .mod files should take at most 30 seconds. As a result, you should get two forms of output - tabular in the Matlab command window and graphical in one or more pop-up windows. Let's review these results.\\
\subsection{Results - stochastic models}
\textbf{The tabular results} can be summarized as follows:
\begin{enumerate}
\item \textbf{Model summary:} a count of the various variable types in your model (endogenous, jumpers, etc...).
\item \textbf{Eigenvalues} should be displayed, and you should see a confirmation of the Blanchard-Kahn conditions if you used the command \texttt{check} in your .mod file.
\item \textbf{Matrix of covariance of exogenous shocks:} this should square with the values of the shock variances and co-variances you provided in the .mod file.
\item \textbf{Policy and transition functions:} Solving the rational exectation model, $\mathbb{E}_t[f(y_{t+1},y_t,y_{t-1},u_t)]=0$ , means finding an unkown function, $y_t = g(y_{t-1},u_t)$ that could be plugged into the original model and satisfy the implied restrictions (the first order conditions). A first order approximation of this function can be written as $y_t = \bar{y} + g_y \hat{y}_{t-1} + g_u u_t$, with $\hat{y}_t = y_t-\bar{y}$ and $\bar{y}$ being the steadystate value of $y$, and where $g_x$ is the partial derivative of the $g$ function with respect to variable $x$. In other words, the function $g$ is a time recursive (approximated) representation of the model that can generate timeseries that will approximatively satisfy the rational expectation hypothesis contained in the original model. In Dynare, the table ``Policy and Transition function'' contains the elements of $g_y$ and $g_u$. Details on the policy and transition function can be found in Chapter \ref{ch:estadv}.
\item \textbf{Moments of simulated variables:} up to the fourth moments.
\item \textbf{Correlation of simulated variables:} these are the contemporaneous correlations, presented in a table.
\item \textbf{Autocorrelation of simulated variables:} up to the fifth lag, as specified in the options of \texttt{stoch\_simul}.
\end{enumerate}
\textbf{The graphical results}, instead, show the actual impulse response functions for each of the endogenous variables, given that they actually moved. These can be especially useful in visualizing the shape of the transition functions and the extent to which each variable is affected. \textsf{\textbf{TIP!}} If some variables do not return to their steady state, either check that you have included enough periods in your simulations, or make sure that your model is stationary, i.e. that your steady state actually exists and is stable. If not, you should detrend your variables and rewrite your model in terms of those variables.
\subsection{Results - deterministic models}
Automatically displayed results are much more scarce in the case of deterministic models. If you entered \texttt{steady}, you will get a list of your steady state results. If you entered \texttt{check}, eigenvalues will also be displayed and you should receive a statement that the rank condition has been satisfied, if all goes well! Finally, you will see some intermediate output: the errors at each iteration of the Newton solver used to estimate the solution to your model. \textsf{\textbf{TIP!}} You should see these errors decrease upon each iteration; if not, your model will probably not converge. If so, you may want to try to increase the periods for the transition to the new steady state (the number of simulations periods). But more often, it may be a good idea to revise your equations. Of course, although Dynare does not display a rich set of statistics and graphs corresponding to the simulated output, it does not mean that you cannot create these by hand from Matlab. To do so, you should start by looking at section \ref{sec:FindOut} of chapter \ref{ch:soladv} on finding, saving and viewing your output.