Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • giovanma/dynare
  • giorgiomas/dynare
  • Vermandel/dynare
  • Dynare/dynare
  • normann/dynare
  • MichelJuillard/dynare
  • wmutschl/dynare
  • FerhatMihoubi/dynare
  • sebastien/dynare
  • lnsongxf/dynare
  • rattoma/dynare
  • CIMERS/dynare
  • FredericKarame/dynare
  • SumuduK/dynare
  • MinjeJeon/dynare
  • camilomrch/dynare
  • DoraK/dynare
  • avtishin/dynare
  • selma/dynare
  • claudio_olguin/dynare
  • jeffjiang07/dynare
  • EthanSystem/dynare
  • stepan-a/dynare
  • wjgatt/dynare
  • JohannesPfeifer/dynare
  • gboehl/dynare
  • chskcau/dynare-doc-fixes
27 results
Select Git revision
Show changes
Showing
with 1055 additions and 12385 deletions
......@@ -79,7 +79,7 @@ p.footer {
</ul>
</div>
<h2>AIM Solver Subsystem<a name="1"></a></h2>
<p>The AIM subsystem in the AIM subdirectory of the main Dynare matlab directory contains Matlab functions necessary for using
<p>The AIM subsystem in the AIM subdirectory of the main Dynare matlab directory contains MATLAB functions necessary for using
Gary Anderson's AIM 1st order solver as an alternative to Dynare's default mjdgges solver (see <a href="http://www.federalreserve.gov/Pubs/oss/oss4/aimindex.html">http://www.federalreserve.gov/Pubs/oss/oss4/aimindex.html</a> ).
</p>
<p>It cosists of:</p>
......@@ -92,7 +92,7 @@ p.footer {
</div>
<div>
<ul>
<li>A subset of Matlab routines from Gary Anderson's own AIM package needed to compute and solve system passed on and returned
<li>A subset of MATLAB routines from Gary Anderson's own AIM package needed to compute and solve system passed on and returned
by dynAIMsolver1 whose names start with SP.. of which <b>SPAmalg.m</b> is the main driver:
</li>
</ul>
......@@ -215,7 +215,7 @@ p.footer {
can produce ~ one order closer results to the Dynare solutiion
then when if plain jacobia_ is passed,
i.e. diff &lt; e-14 for aa and diff &lt; *e-13 for jacobia_ if Q' is used.</pre><p>GP July 2008</p>
<p>part of DYNARE, copyright Dynare Team (1996-2008) Gnu Public License.</p>
<p>part of Dynare, copyright Dynare Team (1996-2008) Gnu Public License.</p>
<p class="footer"><br>
Published with MATLAB&reg; 7.1<br></p>
</div>
......@@ -225,7 +225,7 @@ p.footer {
%% AIM Solver Subsystem
% The AIM subsystem in the AIM subdirectory of the main Dynare matlab
% directory contains Matlab functions necessary for using
% directory contains MATLAB functions necessary for using
% Gary Anderson's AIM 1st order solver as an alternative to Dynare's default mjdgges solver (see http://www.federalreserve.gov/Pubs/oss/oss4/aimindex.html ).
%
% It cosists of:
......@@ -236,7 +236,7 @@ p.footer {
% gu=dr.hgu from the AIM outputs. ("1" in the title is for 1st order
% solver).
%
% * A subset of Matlab routines from Gary Anderson's own AIM package needed to compute
% * A subset of MATLAB routines from Gary Anderson's own AIM package needed to compute
% and solve system passed on and returned by dynAIMsolver1 whose names start with SP..
% of which *SPAmalg.m* is the main driver:
%
......@@ -394,10 +394,10 @@ p.footer {
%
% GP July 2008
%
% part of DYNARE, copyright Dynare Team (1996-2008)
% part of Dynare, copyright Dynare Team (1996-2008)
% Gnu Public License.
##### SOURCE END #####
-->
</body>
</html>
\ No newline at end of file
</html>
......@@ -111,7 +111,7 @@ demia/Economics/Dynare%20DSGE/V4/doc/AIM/Dynare%20AIM%20use%20Doc.html#11=
<H2>AIM Solver Subsystem<A name=3D1></A></H2>
<P>The AIM subsystem in the AIM subdirectory of the main Dynare matlab =
directory=20
contains Matlab functions necessary for using Gary Anderson's AIM 1st =
contains MATLAB functions necessary for using Gary Anderson's AIM 1st =
order=20
solver as an alternative to Dynare's default mjdgges solver (see <A=20
href=3D"http://www.federalreserve.gov/Pubs/oss/oss4/aimindex.html">http:/=
......@@ -129,7 +129,7 @@ AIM outputs.=20
("1" in the title is for 1st order solver). </LI></UL></DIV>
<DIV>
<UL>
<LI>A subset of Matlab routines from Gary Anderson's own AIM package =
<LI>A subset of MATLAB routines from Gary Anderson's own AIM package =
needed to=20
compute and solve system passed on and returned by dynAIMsolver1 whose =
names=20
......@@ -328,7 +328,7 @@ forward looking models, passing into dynAIMsolver aa =3D{Q'|1}*jacobia_
i.e. diff &lt; e-14 for aa and diff &lt; *e-13 for jacobia_ if Q' =
is used.</PRE>
<P>GP July 2008</P>
<P>part of DYNARE, copyright Dynare Team (1996-2008) Gnu Public =
<P>part of Dynare, copyright Dynare Team (1996-2008) Gnu Public =
License.</P>
<P class=3Dfooter><BR>Published with MATLAB=C2=AE 7.1<BR></P></DIV><!--=0A=
##### SOURCE BEGIN #####=0A=
......@@ -336,7 +336,7 @@ License.</P>
%% AIM Solver Subsystem
% The AIM subsystem in the AIM subdirectory of the main Dynare matlab
% directory contains Matlab functions necessary for using
% directory contains MATLAB functions necessary for using
% Gary Anderson's AIM 1st order solver as an alternative to Dynare's =
default mjdgges solver (see =
http://www.federalreserve.gov/Pubs/oss/oss4/aimindex.html ).=20
......@@ -351,7 +351,7 @@ subsystem.=20
% gu=3Ddr.hgu from the AIM outputs. ("1" in the title is for 1st order
% solver).
%
% * A subset of Matlab routines from Gary Anderson's own AIM package =
% * A subset of MATLAB routines from Gary Anderson's own AIM package =
needed to compute
% and solve system passed on and returned by dynAIMsolver1 whose names =
start with SP..=20
......@@ -544,7 +544,7 @@ used. =20
%
% GP July 2008 =20
%
% part of DYNARE, copyright Dynare Team (1996-2008)
% part of Dynare, copyright Dynare Team (1996-2008)
% Gnu Public License.
=0A=
##### SOURCE END #####=0A=
......
......@@ -30,7 +30,7 @@
\subsection*{AIM Solver Subsystem}
\begin{par}
The AIM subsystem in the AIM subdirectory of the main Dynare matlab directory contains Matlab functions necessary for using Gary Anderson's AIM 1st order solver as an alternative to Dynare's default mjdgges solver (see \begin{verbatim}http://www.federalreserve.gov/Pubs/oss/oss4/aimindex.html\end{verbatim} ).
The AIM subsystem in the AIM subdirectory of the main Dynare matlab directory contains MATLAB functions necessary for using Gary Anderson's AIM 1st order solver as an alternative to Dynare's default mjdgges solver (see \begin{verbatim}http://www.federalreserve.gov/Pubs/oss/oss4/aimindex.html\end{verbatim} ).
\end{par} \vspace{1em}
\begin{par}
It cosists of:
......@@ -41,7 +41,7 @@ It cosists of:
\end{itemize}
\begin{itemize}
\setlength{\itemsep}{-1ex}
\item A subset of Matlab routines from Gary Anderson's own AIM package needed to compute and solve system passed on and returned by dynAIMsolver1 whose names start with SP.. of which \textbf{SPAmalg.m} is the main driver:
\item A subset of MATLAB routines from Gary Anderson's own AIM package needed to compute and solve system passed on and returned by dynAIMsolver1 whose names start with SP.. of which \textbf{SPAmalg.m} is the main driver:
\end{itemize}
\begin{itemize}
\setlength{\itemsep}{-1ex}
......@@ -235,7 +235,7 @@ Dynare use:
GP July 2008
\end{par} \vspace{1em}
\begin{par}
part of DYNARE, copyright Dynare Team (1996-2008) Gnu Public License.
part of Dynare, copyright Dynare Team (1996-2008) Gnu Public License.
\end{par} \vspace{1em}
......
SUBDIRS = preprocessor macroprocessor userguide parallel internals gsa dseries-and-reporting
info_TEXINFOS = dynare.texi
if HAVE_TEXI2HTML
if HAVE_LATEX2HTML
html-local: dynare.html
dynare.html: dynare.texi
rm -rf dynare.html
mkdir -p dynare.html
cd dynare.html && $(TEXI2HTML) --l2h --split section --prefix index ../dynare.texi
endif
endif
PDF_TARGETS =
if HAVE_PDFLATEX
PDF_TARGETS += guide.pdf bvar-a-la-sims.pdf
if HAVE_BIBTEX
PDF_TARGETS += dr.pdf
endif
endif
pdf-local: $(PDF_TARGETS)
EXTRA_DIST = guide.tex guide.bbl bibmad.sty bvar-a-la-sims.tex dr.tex dr.bib dynare.plots
guide.pdf: guide.tex guide.bbl bibmad.sty
$(PDFLATEX) guide
$(PDFLATEX) guide
bvar-a-la-sims.pdf: bvar-a-la-sims.tex
$(PDFLATEX) bvar-a-la-sims
$(PDFLATEX) bvar-a-la-sims
dr.pdf: dr.tex
$(PDFLATEX) dr
$(BIBTEX) dr
$(PDFLATEX) dr
$(PDFLATEX) dr
clean-local:
# Do not delete guide.bbl which is not autogenerated
rm -f *~ *.pdf *.log *.aux *.out *.blg dr.bbl
\message{harvard bibliography,}
\def\@hiteml[#1]#2#3#4{\item[]\if@filesw%
{ \def\protect##1{\string ##1\space}\immediate%
\write\@auxout{\string\harvardcite{#4}{#2}{#1}{#3}}}\fi%
\protect\hspace*{-\labelwidth}\protect\hspace*{-\labelsep}\ignorespaces}
\def\@hitem#1#2#3{\item[]\if@filesw%
{ \def\protect##1{\string ##1\space}\immediate%
\write\@auxout{\string\harvardcite{#3}{#1}{#1}{#2}}}\fi%
\protect\hspace*{-\labelwidth}\protect\hspace*{-\labelsep}\ignorespaces}
\def\harvarditem{\@ifnextchar [{\@hiteml}{\@hitem}}
\def\harvardcite#1#2#3#4{
\global\@namedef{bhf@#1}{#2}
\global\@namedef{bha@#1}{#3}
\global\@namedef{bhy@#1}{#4}\global\@namedef{b@#1}{\csname bhf@#1\endcsname}
}
\def\citeasnoun{\@ifnextchar [{\@tempswatrue\@citex}{\@tempswafalse\@citex[]}}
\def\cite{\@ifnextchar [{\@tempswatrue\@citexasnoun}
{\@tempswafalse\@citexasnoun[]}
}
\def\citeyear{\@ifnextchar [{\@tempswatrue\@citexyear}
{\@tempswafalse\@citexyear[]}
}
\def\citename{\@ifnextchar [{\@tempswatrue\@citexname}
{\@tempswafalse\@citexname[]}
}
% \def\@enamedef#1{\expandafter\edef\csname #1\endcsname}
% Previous line should be replaced by the following to prevent
% problems with the NFSS. Solution by Bernd Raichle.
\def\@enamedef#1{\expandafter\def\csname #1\expandafter\endcsname\expandafter}
\def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
\def\@citea{}\@cite{\@for\@citeb:=#2\do
{\@citea\def\@citea{\@hisep\penalty\@m\ }\@ifundefined
{b@\@citeb}{{\bf ?}\@warning
{Citation `\@citeb' on page \thepage \space undefined}}%
{{\csname b@\@citeb\endcsname\@hysep\csname bhy@\@citeb\endcsname}%
\global\@enamedef{b@\@citeb}{\csname bha@\@citeb\endcsname}}%
}}{#1}}
\def\@citexasnoun[#1]#2{%
\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi%
\@citeasnoun{{\@ifundefined%
{b@#2}%
{[{\bf ?}\@warning{Citation `#2' on page \thepage \space undefined}}%
{{\csname b@#2\endcsname\ [\csname bhy@#2\endcsname}%
\global\@namedef{b@#2}{\csname bha@#2\endcsname}}%
}}{#1}}
\def\@citexname[#1]#2{%
\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi%
\@citename{{\@ifundefined%
{b@#2}%
{{\bf ?}\@warning{Citation `#2' on page \thepage \space undefined}}%
{{\csname bhf@#2\endcsname}}%
}}{#1}}
\def\@citexyear[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
\def\@citeayear{}\@cite{\@for\@citebyear:=#2\do
{\@citeayear\def\@citeayear{\@hisep\penalty\@m\ }\@ifundefined
{b@\@citebyear}{{\bf ?}\@warning
{Citation `\@citebyear' on page \thepage \space undefined}}%
{{\csname bhy@\@citebyear\endcsname}%
}%
}}{#1}}
\gdef\hysep@agsm{\ }\gdef\hisep@agsm{,}%
\gdef\hysep@dcu{, }\gdef\hisep@dcu{;}%
\let\@hysep\hysep@agsm \let\@hisep\hisep@agsm
\def\citationstyle#1{%
\global\@namedef{@hysep}{\csname hysep@#1\endcsname}%
\global\@namedef{@hisep}{\csname hisep@#1\endcsname}}
%DEFAULT DEFINITIONS
\def\@cite#1#2{({#1\if@tempswa , #2\fi})}
\def\@citeasnoun#1#2{{#1\if@tempswa , #2\fi]}}
\def\@citename#1#2{{#1\if@tempswa \ (#2)\fi}}
% CHANGE \end{document} - to handle double definitions
\def\enddocument{\@checkend{document}\clearpage\begingroup
\if@filesw \immediate\closeout\@mainaux
\def\global\@namedef##1##2{}\def\newlabel{\@testdef r}%
\def\bibcite{\@testdef b}%
\def\harvardcite{\@testbibh}\@tempswafalse \makeatletter\input \jobname.aux
\if@tempswa \@warning{Label(s) may have changed. Rerun to get
cross-references right}\fi\fi\endgroup\deadcycles\z@\@@end}
\def\@testbibh #1#2#3{
\def\@tempa{#2}\expandafter
\ifx \csname bhf@#1\endcsname \@tempa
\def\@tempa{#3}\expandafter
\ifx \csname bha@#1\endcsname \@tempa
\else \@tempswatrue
\fi
\else
\@tempswatrue
\fi
}
%
\ No newline at end of file
......@@ -11,29 +11,29 @@
\begin{document}
\title{BVAR models ``\`a la Sims'' in Dynare\thanks{Copyright \copyright~2007--2011 S\'ebastien
Villemot. Permission is granted to copy, distribute and/or modify
\title{BVAR models ``\`a la Sims'' in Dynare\thanks{Copyright \copyright~2007--2015 S\'ebastien
Villemot; \copyright~2016--2017 S\'ebastien
Villemot and Johannes Pfeifer. Permission is granted to copy, distribute and/or modify
this document under the terms of the GNU Free Documentation
License, Version 1.3 or any later version published by the Free
Software Foundation; with no Invariant Sections, no Front-Cover
Texts, and no Back-Cover Texts. A copy of the license can be found
at: \url{http://www.gnu.org/licenses/fdl.txt}
at: \url{https://www.gnu.org/licenses/fdl.txt}
\newline
\indent Many thanks to Christopher Sims for providing his BVAR
MATLAB\textregistered~routines, to St\'ephane Adjemian and Michel Juillard
MATLAB\textsuperscript{\textregistered}~routines, to St\'ephane Adjemian and Michel Juillard
for their helpful support, and to Marek Jaroci\'nski for reporting a bug.
}}
\author{S\'ebastien Villemot\thanks{Paris School of Economics and
CEPREMAP. E-mail:
\href{mailto:sebastien@dynare.org}{\texttt{sebastien@dynare.org}}.}}
\date{First version: September 2007 \hspace{1cm} This version: August 2012}
CEPREMAP.} \and Johannes Pfeifer\thanks{University of the Bundeswehr Munich. E-mail: \href{mailto:johannes.pfeifer@unibw.de}{\texttt{johannes.pfeifer@unibw.de}}.}}
\date{First version: September 2007 \hspace{1cm} This version: May 2017}
\maketitle
\begin{abstract}
Dynare incorporates routines for Bayesian VAR models estimation, using a
flavor of the so-called ``Minnesota priors,''. These routines can be used
flavor of the so-called ``Minnesota priors.'' These routines can be used
alone or in parallel with a DSGE estimation. This document describes their
implementation and usage.
\end{abstract}
......@@ -169,7 +169,7 @@ $$\left[
$$\left[
\begin{array}{cc}
0 & 0 \\
0 & 0
0 & 0
\end{array}
\right]
=
......@@ -435,10 +435,11 @@ p(Y^+ | X^+) & = & \frac{\int (2\pi)^{-\frac{T^+\cdot ny}{2}} f(\Phi,\Sigma | \d
\section{Dynare commands}
\label{dynare-commands}
Dynare incorporates two commands related to BVAR models \`a la Sims:
Dynare incorporates three commands related to BVAR models \`a la Sims:
\begin{itemize}
\item \texttt{bvar\_density} for computing marginal density,
\item \texttt{bvar\_forecast} for forecasting (and RMSE computation).
\item \texttt{bvar\_forecast} for forecasting (and RMSE computation),
\item \texttt{bvar\_irf} for computing Impulse Response Functions.
\end{itemize}
\subsection{Common options}
......@@ -499,16 +500,18 @@ The syntax for computing the marginal density is:
The options are those described above.
The command will actually compute the marginal density for several models: first for the model with one lag, then with two lags, and so on up to \textit{max\_number\_of\_lags} lags.
The command will actually compute the marginal density for several models: first for the model with one lag, then with two lags, and so on up to \textit{max\_number\_of\_lags} lags. Results will be stored in a \textit{max\_number\_of\_lags} by 1 vector \texttt{oo\_.bvar.log\_marginal\_data\_density}. The command will also store the prior and posterior information into \textit{max\_number\_of\_lags} by 1 cell arrays \texttt{oo\_.bvar.prior} and \texttt{oo\_.bvar.posterior}.
\subsection{Forecasting}
The syntax for computing (out-of-sample) forecasts is:
\medskip
\texttt{bvar\_forecast(}\textit{options\_list}\texttt{) }\textit{max\_number\_of\_lags}\texttt{;}
\texttt{bvar\_forecast(}\textit{options\_list}\texttt{) }\textit{number\_of\_lags}\texttt{;}
\medskip
In contrast to the \texttt{bvar\_density}, you need to specify the actual lag length used, not the maximum lag length. Typically, the actual lag length should be based on the results from the \texttt{bvar\_density} command.
The options are those describe above, plus a few ones:
\begin{itemize}
\item \texttt{forecast}: the number of periods over which to compute forecasts after the end of the sample (no default)
......@@ -539,6 +542,42 @@ Most results are stored for future use:
\item if RMSE has been computed, results are in \texttt{oo\_.bvar.forecast.rmse}.
\end{itemize}
\subsection{Impulse Response Functions}
The syntax for computing impulse response functions is:
\medskip
\texttt{bvar\_irf(}\textit{number\_of\_lags},\textit{identification\_scheme}\texttt{);}
\medskip
The \textit{identification\_scheme} option has two potential values
\begin{itemize}
\item \texttt{'Cholesky'}: uses a lower triangular factorization of the covariance matrix (default),
\item \texttt{'SquareRoot'}: uses the Matrix square root of the covariance matrix (\verb+sqrtm+ matlab's routine).
\end{itemize}
Keep in mind that the first factorization of the covariance matrix is sensible to the ordering of the variables (as declared in the mod file with \verb+var+). This is not the case of the second factorization, but its structural interpretation is, at best, unclear (the Matrix square root of a covariance matrix, $\Sigma$, is the unique symmetric matrix $A$ such that $\Sigma = AA$).\newline
If you want to change the length of the IRFs plotted by the command, you can put\\
\medskip
\texttt{options\_.irf=40;}\\
\medskip
before the \texttt{bvar\_irf}-command. Similarly, to change the coverage of the highest posterior density intervals to e.g. 60\% you can put the command\\
\medskip
\texttt{options\_.bvar.conf\_sig=0.6;}\\
\medskip
there.\newline
The mean, median, variance, and confidence intervals for IRFs are saved in \texttt{oo\_.bvar.irf}
\section{Examples}
This section presents two short examples of BVAR estimations. These examples and the associated datafile (\texttt{bvar\_sample.m}) can be found in the \texttt{tests/bvar\_a\_la\_sims} directory of the Dynare v4 subversion tree.
......@@ -555,6 +594,8 @@ bvar_density(datafile = bvar_sample, first_obs = 20, bvar_prior_flat,
bvar_prior_train = 10) 8;
bvar_forecast(forecast = 10, bvar_replic = 10000, nobs = 200) 8;
bvar_irf(8,'Cholesky');
\end{verbatim}
Note that you must declare twice the variables used in the estimation: first with a \texttt{var} statement, then with a \texttt{varobs} statement. This is necessary to have a syntactically correct \texttt{mod} file.
......
@techreport{adjemian/al:2011,
author = {Adjemian, St\'ephane and Bastani, Houtan and Juillard, Michel and Mihoubi, Ferhat and Perendia, George and Ratto, Marco and Villemot, S\'ebastien},
title = {Dynare: Reference Manual, Version 4},
institution = {CEPREMAP},
year = {2011},
type = {Dynare Working Papers},
number = {1}
% Encoding: UTF-8
@TechReport{adjemian/al:2011,
author = {Adjemian, St\'ephane and Bastani, Houtan and Juillard, Michel and Karam\'e, Fr\'ederic and Maih, Junior and Mihoubi, Ferhat and Mutschler, Willi and Perendia, George and Pfeifer, Johannes and Ratto, Marco and Villemot, S\'ebastien},
institution = {CEPREMAP},
title = {Dynare: Reference Manual Version 4},
year = {2011},
number = {1},
type = {Dynare Working Papers},
}
@article{blanchard/kahn:1980,
author = {Blanchard, Olivier Jean and Kahn, Charles M.},
title = {The Solution of Linear Difference Models under Rational Expectations},
journal = {Econometrica},
year = 1980,
volume = {48},
number = {5},
pages = {1305-11},
month = {July},
keywords = { Macromodels Yield curve Persistence},
abstract = {Many have questioned the empirical relevance of the Calvo-Yun model. This paper adds a term structure to three widely studied macroeconomic models (Calvo-Yun, hybrid and Svensson). We back out from observations on the yield curve the underlying macroeconomic model that most closely matches the level, slope and curvature of the yield curve. With each model we trace the response of the yield curve to macroeconomic shocks. We assess the fit of each model against the observed behaviour of interest rates and find limited support for the Calvo-Yun model in terms of fit with the observed yield curve, we find some support for the hybrid model but the Svensson model performs best.},
url = {http://ideas.repec.org/a/ecm/emetrp/v48y1980i5p1305-11.html}
@Article{blanchard/kahn:1980,
author = {Blanchard, Olivier Jean and Kahn, Charles M.},
journal = {Econometrica},
title = {The Solution of Linear Difference Models under Rational Expectations},
year = {1980},
month = {7},
number = {5},
pages = {1305-11},
volume = {48},
abstract = {Many have questioned the empirical relevance of the Calvo-Yun model. This paper adds a term structure to three widely studied macroeconomic models (Calvo-Yun, hybrid and Svensson). We back out from observations on the yield curve the underlying macroeconomic model that most closely matches the level, slope and curvature of the yield curve. With each model we trace the response of the yield curve to macroeconomic shocks. We assess the fit of each model against the observed behaviour of interest rates and find limited support for the Calvo-Yun model in terms of fit with the observed yield curve, we find some support for the hybrid model but the Svensson model performs best.},
doi = {10.2307/1912186},
keywords = {Macromodels Yield curve Persistence},
}
@article{klein:2000,
author = {Klein, Paul},
title = {Using the generalized Schur form to solve a multivariate linear rational expectations model},
journal = {Journal of Economic Dynamics and Control},
year = 2000,
volume = {24},
number = {10},
pages = {1405-1423},
month = {September},
keywords = {},
abstract = {},
url = {http://ideas.repec.org/a/eee/dyncon/v24y2000i10p1405-1423.html}
@Article{klein:2000,
author = {Klein, Paul},
journal = {Journal of Economic Dynamics and Control},
title = {Using the generalized {Schur} form to solve a multivariate linear rational expectations model},
year = {2000},
month = {September},
number = {10},
pages = {1405-1423},
volume = {24},
doi = {10.1016/s0165-1889(99)00045-7},
}
@article{schmitt-grohe/uribe:2004,
author = {Schmitt-Groh\'{e}, Stephanie and Ur\'{i}be, Martin},
title = {Solving dynamic general equilibrium models using a second-order approximation to the policy function},
journal = {Journal of Economic Dynamics and Control},
year = 2004,
volume = {28},
number = {4},
pages = {755-775},
month = {January},
keywords = {},
url = {http://ideas.repec.org/a/eee/dyncon/v28y2004i4p755-775.html}
@Article{schmitt-grohe/uribe:2004,
author = {Schmitt-Groh\'{e}, Stephanie and Ur\'{i}be, Martin},
journal = {Journal of Economic Dynamics and Control},
title = {Solving dynamic general equilibrium models using a second-order approximation to the policy function},
year = {2004},
month = {January},
number = {4},
pages = {755-775},
volume = {28},
doi = {10.1016/s0165-1889(03)00043-5},
}
@article{sims:2001,
author = {Sims, Christopher A},
title = {Solving Linear Rational Expectations Models},
journal = {Computational Economics},
year = 2002,
volume = {20},
number = {1-2},
pages = {1-20},
month = {October},
keywords = {},
abstract = {},
url = {http://ideas.repec.org/a/kap/compec/v20y2002i1-2p1-20.html}
@Article{sims:2001,
author = {Sims, Christopher A},
journal = {Computational Economics},
title = {Solving Linear Rational Expectations Models},
year = {2002},
month = {October},
number = {1-2},
pages = {1-20},
volume = {20},
doi = {10.1023/A:1020517101123},
}
@incollection{uhlig:1999,
author = {Uhlig, Harald},
title = {A toolkit for analysing nonlinear dynamic stochastic models easily},
booktitle = {Computational Methods for the Study of Dynamic Economics},
publisher = {Oxford University Press},
year = {1999},
editor = {Marimon, Ramon and Scott, Androw},
pages = {30-61}
@InCollection{uhlig:1999,
author = {Uhlig, Harald},
booktitle = {Computational Methods for the Study of Dynamic Economies},
publisher = {Oxford University Press},
address = {Oxford},
title = {A toolkit for analysing nonlinear dynamic stochastic models easily},
year = {1999},
editor = {Marimon, Ramon and Scott, Andrew},
pages = {30-61},
}
@techreport{kamenik:2003,
@techreport{kamenik:2004,
author = {Kamenik, Ondra},
title = {Solution of Specialized Sylvester Equation},
institution = {Manuscript},
year = {2003}
year = {2004}
}
@article{collard/juillard:2001:compecon,
author = {Collard, Fabrice and Juillard, Michel},
title = {A Higher-Order Taylor Expansion Approach to Simulation of Stochastic Forward-Looking Models with an Application to a Nonlinear Phillips Curve Model},
journal = {Computational Economics},
year = {2001},
volume = {17},
number = {2-3},
pages = {125-39},
month = {June},
keywords = {},
url = {http://ideas.repec.org/a/kap/compec/v17y2001i2-3p125-39.html}
@Article{collard/juillard:2001:compecon,
author = {Collard, Fabrice and Juillard, Michel},
journal = {Computational Economics},
title = {A Higher-Order {Taylor} Expansion Approach to Simulation of Stochastic Forward-Looking Models with an Application to a Nonlinear {Phillips} Curve Model},
year = {2001},
month = {6},
number = {2-3},
pages = {125-139},
volume = {17},
doi = {10.1023/A:1011624124377},
}
@book{golub/van-loan:1996,
author = {Golub, Gene H. and Van Loan, Charles F.},
title = {Matrix Computations},
publisher = {The John Hopkins University Press},
year = {1996},
edition = {third}
@Book{golub/van-loan:1996,
author = {Golub, Gene H. and Van Loan, Charles F.},
publisher = {The John Hopkins University Press},
title = {Matrix Computations},
year = {2013},
address = {Baltimore},
edition = {4},
}
@Comment{jabref-meta: databaseType:bibtex;}
......@@ -3,7 +3,7 @@
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{hyperref}
\hypersetup{breaklinks=true,pagecolor=white,colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue}
\hypersetup{breaklinks=true,colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue}
\usepackage{natbib}
\usepackage{fullpage}
......@@ -21,7 +21,7 @@
License, Version 1.3 or any later version published by the Free
Software Foundation; with no Invariant Sections, no Front-Cover
Texts, and no Back-Cover Texts. A copy of the license can be found
at: \url{http://www.gnu.org/licenses/fdl.txt}
at: \url{https://www.gnu.org/licenses/fdl.txt}
\newline
The author acknowledges funding through the Seventh Framework Programme
for Research (FP7) of the European Commission's Socio-economic Sciences and
......@@ -36,7 +36,7 @@
computing the first order approximated solution of a nonlinear rational
expectations model. The core of the algorithm is a generalized Schur
decomposition (also known as the QZ decomposition), as advocated by several
authors in the litterature. The contribution of the present paper is to focus
authors in the literature. The contribution of the present paper is to focus
on implementation details that make the algorithm more generic and more
efficient, especially for large models.
......@@ -62,12 +62,8 @@ detail the algorithm implemented in Dynare for computing the first order
approximated solution of nonlinear rational expectations models.\footnote{This
algorithm is available using the \texttt{stoch\_simul} command of Dynare. The
original implementation of this algorithm was done by Michel Juillard, using
MATLAB, and is available in the \texttt{matlab/dr1.m} file which is
distributed with Dynare. Another implementation was done by the author, in
C++, in the \texttt{DecisionRules} class, in the
\texttt{mex/sources/estimation} directory of the source tree. The notations
used in the present paper are closer to the C++ implementation than to the
MATLAB implementation.}
MATLAB, and is available in the \texttt{matlab/dyn\_first\_order\_solver.m} file which is
distributed with Dynare.}
This algorithm is based on a generalized Schur decomposition---also known as
the QZ decomposition---and is therefore essentially a variation on the
......@@ -653,7 +649,7 @@ equation is:
\end{equation*}
In the general case, this equation is a specialized Sylvester equation, which
can be solved using the algorithm proposed by
\citet{kamenik:2003}\footnote{This paper is distributed with Dynare, in the
\citet{kamenik:2004}\footnote{This paper is distributed with Dynare, in the
\texttt{sylvester.pdf} file under the documentation directory.}.
\bibliographystyle{elsarticle-harv}
......
if HAVE_PDFLATEX
if HAVE_BEAMER
pdf-local: dseriesReporting.pdf
endif
endif
SRC = dseriesReporting.tex
EXTRA_DIST = $(SRC)
dseriesReporting.pdf: $(SRC)
$(PDFLATEX) dseriesReporting
$(PDFLATEX) dseriesReporting
clean-local:
rm -f dseriesReporting.pdf *.toc *.aux *.log *.nav *.snm *.vrb *.out *~
\documentclass[10pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{color}
\usepackage{amsmath}
\usepackage{epsf}
\usepackage{graphicx}
\usepackage{wasysym}
\usepackage{tikz}
\usepackage{tikz, hyperref, alltt}
\usetikzlibrary{positioning,shapes,shadows,arrows}
\tikzstyle{abstract}=[rectangle, rounded corners, draw=black, anchor=north, fill=blue!10, text centered, minimum height={height("Gp")+2pt}, minimum width=3cm, font=\footnotesize]
\definecolor{links}{HTML}{0000CC}
\hypersetup{colorlinks,linkcolor=,urlcolor=links}
\mode<handout>
{
\usepackage{pgfpages}
......@@ -24,24 +20,23 @@
\usetheme{CambridgeUS}
}
\title{Dynare Time Series \& Reporting}
\author{Houtan Bastani}
\institute{CEPREMAP}
\date{13 June 2014}
\AtBeginSection[]
{
\begin{frame}
\frametitle{Outline}
\tableofcontents[currentsection]
\tableofcontents[currentsection, hideothersubsections]
\end{frame}
}
\setbeamerfont{frametitle}{family=\rmfamily,series=\bfseries,size={\fontsize{10}{10}}}
\setbeamertemplate{frametitle continuation}[from second]
\tikzstyle{abstract}=[rectangle, rounded corners, draw=black, anchor=north, fill=blue!10, text centered, minimum height={height("Gp")+2pt}, minimum width=3cm, font=\footnotesize]
\title{Dynare Time Series \& Reporting}
\author[Houtan Bastani]{Houtan Bastani\newline\href{mailto:houtan@dynare.org}{houtan@dynare.org}}
\institute{CEPREMAP}
\date{11 June 2015}
\newcommand{\myitem}{\item[$\bullet$]}
\begin{document}
......@@ -54,11 +49,8 @@
\tableofcontents
\end{frame}
%
% DSERIES
% DATES
%
\section{Time Series}
......@@ -66,10 +58,96 @@
\begin{frame}[fragile,t]
\frametitle{Overview}
\begin{itemize}
\item Provide support for time series in Dynare
\item Introduced in Dynare 4.4
\item Currently only used for reporting.
\item Use will increase with time (\textit{e.g.,} to be included in new estimation code)
\myitem Provide support for time series (\texttt{dseries})
\begin{itemize}
\myitem Based on an implementation for handling dates (\texttt{dates})
\end{itemize}
\myitem Beta version in Dynare 4.4. Mature version ready in Dynare 4.5
\myitem Currently only used for reporting, though use will increase with time
(\textit{e.g.,} to be included in new estimation code)
\myitem Compatible with all setups that are supported by Dynare
\begin{itemize}
\myitem Windows, Mac OS X, Linux
\myitem MATLAB 7.5 (R2007b) or later, Octave
\end{itemize}
\myitem Must run \texttt{dynare} or \texttt{dynare\_config} at least once in the current MATLAB/Octave session before use
\myitem More complete information is included in the Dynare manual
\end{itemize}
\end{frame}
\subsection{A Programming Note}
\begin{frame}[fragile,t]
\frametitle{A Programming Note (1/3)}
\begin{itemize}
\myitem Time series and dates (and reporting) are implemented as MATLAB/Octave classes
\myitem Inplace modification of instantiated objects not supported. Let me explain \dots
\begin{itemize}
\myitem A class is a template for defining objects, defining their member
variables and methods.
\begin{itemize}
\myitem \textit{e.g.,} The \texttt{dates} class defines 2 member
variables--\texttt{freq} and \texttt{time}--and many
methods (analogous to functions)
\end{itemize}
\myitem An object is an instance of a specific class. For exemplary
purposes, imagine an object \texttt{X}, which is an instantiation of the
class ``Integer''. The object has value \texttt{1}:
\begin{verbatim}
>> X
X =
1
\end{verbatim}
\myitem You can call any method defined for the integer class on integer
object \texttt{X}. Imagine such a method is called
\texttt{multiplyByTwo()}.
\myitem In most object-oriented
languages, writing \texttt{X.multiplyByTwo();} will change the value
contained in \texttt{X} to \texttt{2}
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{A Programming Note (2/3)}
\begin{itemize}
\item[] \begin{itemize}
\myitem But! For MATLAB/Octave's implementation of classes this is not the
case as it does not support inplace modification
\begin{verbatim}
>> X.multiplyByTwo()
ans =
2
>> X
X =
1
\end{verbatim}
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{A Programming Note (3/3)}
\begin{itemize}
\item[] \begin{itemize}
\myitem To get the desired change, you must overwrite \texttt{X}
\begin{verbatim}
>> X = X.multiplyByTwo()
X =
2
\end{verbatim}
\myitem Keep this in mind when using Dynare dates, time series, and reporting
\end{itemize}
\end{itemize}
\end{frame}
......@@ -78,10 +156,10 @@
\begin{frame}[fragile,t]
\frametitle{Syntax}
\begin{itemize}
\item Two components of a time series:
\myitem Two components of a time series:
\begin{itemize}
\item A time component. In Dynare: \texttt{dates}
\item A data component mapped to time. In Dynare: \texttt{dseries}
\myitem A time component. In Dynare: \texttt{dates}
\myitem A data component mapped to time. In Dynare: \texttt{dseries}
\end{itemize}
\end{itemize}
\end{frame}
......@@ -90,84 +168,455 @@
\begin{frame}[fragile,t]
\frametitle{\texttt{dates} Syntax}
\begin{itemize}
\item The \texttt{dates} command creates an object that represents at least one date at a given frequency
\begin{itemize}
\item Yearly: \texttt{`Y', `y', 1}
\item Quarterly: \texttt{`Q', `q', 4}
\item Monthly: \texttt{`M', `m', 12}
\item Weekly: \texttt{`W', `w', 52}
\end{itemize}
\item It has two slightly different syntaxes
\begin{itemize}
\item One for inclusion in \texttt{.m} files
\item One for inclusion in \texttt{.mod} files (simplified, taking advantage of the preprocessor)
\end{itemize}
\item Minimal restrictions on dates. Can be
\myitem The \texttt{dates} command creates an object that represents zero or more dates at a given frequency
\myitem A \texttt{dates} object contains 3 members (fields):
\begin{itemize}
\item Negative
\item Empty
\item Noncontiguous
\myitem{\textbf{\texttt{freq}}}: 1, `y' (Annual); 4, `q' (Quarterly); 12, `m' (Monthly); 52, `w' (Weekly)
\myitem{\textbf{\texttt{time}}}: A \texttt{<<No of dates>>$\times$2} matrix; the 1\textsuperscript{st} col is the year and the 2\textsuperscript{nd} col is the period
\end{itemize}
\myitem \texttt{dates} members cannot be modified. Thus, this is not allowed
\begin{alltt}
>> dd.freq = 12;
\end{alltt}
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{Creating a new \texttt{dates} object}
\frametitle{Creating a new \texttt{dates} object in MATLAB/Octave}
\begin{itemize}
\item A single date:
\begin{itemize}
\item In a \texttt{.m} file: \texttt{t = dates(`1999y');}
\item In a \texttt{.mod} file: \texttt{t = 1999y;}
\end{itemize}
\item A date range:
\begin{itemize}
\item In a \texttt{.m} file: \texttt{t = dates(`1999y'):dates(`2020y');}
\item In a \texttt{.mod} file: \texttt{t = 1999y:2020y;}
\end{itemize}
\myitem{A single date}
\begin{alltt}
>> t = dates(`1999y');
\end{alltt}
\myitem{Multiple dates}
\begin{alltt}
>> t = dates(`1999q1', `2020q2', `-190q3');
\end{alltt}
Notice that noncontiguous and negative dates are possible
\myitem Can also create \texttt{dates} programatically
\begin{alltt}
>> t = dates(4, [1990; 1990; 1978], [1; 2; 3])
t = <dates: 1990Q1, 1990Q2, 1978Q3>
\end{alltt}
\myitem Can specify an empty \texttt{dates}\dots
\begin{alltt}
>> qq = dates(`Q');
>> qq = dates(4);
\end{alltt}
\myitem \dots and use it to instantiate new \texttt{dates}
\begin{alltt}
>> t = qq(1990, 1);
t = <dates: 1990Q1>
\end{alltt}
\begin{alltt}
>> t = qq([1990; 1990; 1978], [1; 2; 3])
t = <dates: 1990Q1, 1990Q2, 1978Q3>
\end{alltt}
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{Modifying \texttt{dates}}
\frametitle{Creating a new \texttt{dates} object in a \texttt{.mod} file}
\begin{itemize}
\item \texttt{append}: appends a date to the date
\myitem The preprocessor allows for syntax simplification when
\texttt{dates} are in \texttt{.mod} files
\myitem{A single date} \texttt{t = 1999y;}
\begin{alltt}
\(\Rightarrow\) t = dates(`1999y');
\end{alltt}
\myitem{Multiple dates} \texttt{t = [1999q1 2020q2 1960q3];}
\begin{alltt}
\(\Rightarrow\) t = [dates(`1999q1') dates(`2020q2') dates(`1960q3')];
\end{alltt}
\myitem NB: This can cause problems when dates are included in strings. \textit{e.g.,}
\begin{alltt}
disp(`In 1999q1, ...')
\end{alltt}
would be transformed into
\begin{alltt}
disp(`In dates(`1999q1'), ...')
\end{alltt}
\myitem To fix this, simply prefix any date that you don't want transformed by the preprocessor with a `\texttt{\$}': \texttt{disp(`In \$1999q1, ...')}
\begin{alltt}
\(\Rightarrow\) disp(`In 1999q1, ...')
\end{alltt}
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{Collections and Ranges of \texttt{dates} in a \texttt{.mod} file}
\begin{itemize}
\myitem A collection of \texttt{dates}
\begin{alltt}
a = 1990Q1; b = 1957Q1; c = -52Q1;
d = [a b c];
\(\Rightarrow\) d = <dates: 1990Q1, 1957Q1, -52Q1>
\end{alltt}
\myitem A Range of \texttt{dates}
\begin{alltt}
a = 1990Q3:1991Q2
\(\Rightarrow\) a = <dates: 1990Q3, 1990Q4, 1991Q1, 1991Q2>
\end{alltt}
\myitem A set of regularly-spaced \texttt{dates}
\begin{alltt}
a = 1990Q3:2:1991Q2
\(\Rightarrow\) a = <dates: 1990Q3, 1991Q1, 1991Q3>
\end{alltt}
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{Comparing \texttt{dates}}
\begin{itemize}
\myitem The following comparison operators are supported: $==$, $\backsim=$, $<$, $\leq$, $>$, and $\geq$
\myitem Compared objects must have the same frequency
\myitem Compared objects must have the same number of elements (except for singletons)
\myitem Returns the result of an element-wise comparison
\myitem Let \texttt{a=[1999W1 2020W3]}, \texttt{b=1999W1}, and \texttt{c=[1888w1 2020w3]}. Then
\begin{alltt}
>> a == b >> a > b >> c < a
ans = ans = ans =
1 0 1
0 1 0
\end{alltt}
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{Arithmetic Operations on \texttt{dates}}
\begin{itemize}
\myitem The unary \texttt{+} and \texttt{-} operators
\begin{alltt}
>> a = dates(`1999q4');
>> +a \(\Rightarrow\) ans = 2000q1
>> -a \(\Rightarrow\) ans = 1999q3
>> ++-+a \(\Rightarrow\) ans = 2000q2
\end{alltt}
\myitem The binary \texttt{+} and \texttt{-} operators
\begin{itemize}
\item \texttt{t.append(dates(`2021y'));}
\myitem Objects must have the same frequency
\myitem Objects must have the same number of elements (except for singletons)
\myitem \texttt{1999q4 + 2} $\Rightarrow$ \texttt{ans = 2000q2}
\myitem \texttt{1999w4 + 2} $\Rightarrow$ \texttt{ans = 1999w6}
\myitem \texttt{1999m4 - 2} $\Rightarrow$ \texttt{ans = 1999m2}
\myitem \texttt{1999m4 - 1999m2} $\Rightarrow$ \texttt{ans = 2}
\myitem \texttt{1999m4 + 1999m2} $\Rightarrow$ \texttt{ans = <dates: 1999M4, 1999M2>}
\end{itemize}
\item \texttt{pop}:
\item \texttt{sort}:
\myitem The binary \texttt{*} operator
\begin{alltt}
>> a*3
ans = <dates: 1999Q4, 1999Q4, 1999Q4>
\end{alltt}
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{Getting info about \texttt{dates}}
\frametitle{Set Operations on \texttt{dates}}
\begin{itemize}
\item \texttt{double}: returns a floating point representation of the date
\myitem Let \texttt{a = [1990Q1:1991Q1 1990Q1]; b = [1990Q3:1991Q3];}
\myitem \texttt{intersect}: returns the intersection of the arguments
\begin{alltt}
>> intersect(a, b)
ans = <dates: 1990Q3, 1990Q4, 1991Q1>
\end{alltt}
\myitem \texttt{setdiff}: returns dates present in first arg but not in second
\begin{alltt}
>> setdiff(a, b)
ans = <dates: 1990Q1, 1990Q2>
\end{alltt}
\myitem \texttt{union}: returns the union of two sets (repititions removed)
\begin{alltt}
union(a, b)
ans = <dates: 1990Q1, 1990Q2, ..., 1991Q2, 1991Q3>
\end{alltt}
\myitem \texttt{unique()}: removes repititions from set (keeps last unique value)
\begin{alltt}
>> a.unique()
ans = <dates: 1990Q2, 1990Q3, 1990Q4, 1991Q1, 1990Q1>
\end{alltt}
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{Misc \texttt{dates} operations}
\begin{itemize}
\myitem Can index a \texttt{dates} object
\begin{alltt}
>> a = dates(`2000y'):dates(`2009y');
>> a(1)
ans = <dates: 2000Y>
>> a(1:3)
ans = <dates: 2000Y, 2001Y, 2002Y>
>> a([1,4,5])
ans = <dates: 2000Y, 2003Y, 2004Y>
\end{alltt}
\myitem{\textbf{\texttt{pop()}}}: Remove last element
\begin{alltt}
>> a.pop()
ans = <dates: 2000Y, 2001Y, ..., 2007Y, 2008Y>
\end{alltt}
\myitem{\textbf{\texttt{char()}}}: Return string representation
\begin{alltt}
>> a(1).char()
ans = 2000Y
\end{alltt}
\myitem More in the Dynare manual
\end{itemize}
\end{frame}
%
% DSERIES
%
\subsubsection{\texttt{dseries} Syntax}
\begin{frame}[fragile,t]
\frametitle{\texttt{dseries} Syntax}
\begin{itemize}
\myitem A \texttt{dseries} is composed of zero or more individual time series
\myitem All time series in a \texttt{dseries} must have the same frequency
\myitem A \texttt{dseries} runs from the earliest date to the latest date,
with \texttt{NaN}'s inserted to pad the shorter series
\myitem A \texttt{dseries} object contains 4 members:
\begin{itemize}
\item \texttt{t.double;}
\myitem{\textbf{\texttt{data}}}: The data points
\myitem{\textbf{\texttt{dates}}}: The \texttt{dates} of the sample
\myitem{\textbf{\texttt{name}}}: Names of the variables
\myitem{\textbf{\texttt{tex}}}: \LaTeX\ names of the variables
\end{itemize}
\item \texttt{freq}: returns the frequency
\myitem \texttt{dseries} members cannot be modified
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{Creating a new \texttt{dseries} object (1/2)}
Load data directly
\begin{itemize}
\myitem Syntax:
\begin{alltt}
ts = dseries(DATA, INITIAL_PERIOD, NAMES, TEX_NAMES)
\end{alltt}
\myitem \textit{e.g.,} 2 variables, `MyVar1' and `MyVar2', with
3 annual observations starting in 1999:
\small{
\begin{alltt}
>> ts = dseries([1 2;3 4;5 6], `1999y', ...
\{`MyVar1', `MyVar2'\}, \{`MyVar\_1', 'MyVar\_2'\});
ts is a dseries object:
| MyVar1 | MyVar2
1999Y | 1 | 2
2000Y | 3 | 4
2001Y | 5 | 6
\end{alltt}}
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{Creating a new \texttt{dseries} object (2/2)}
Load series from CSV/spreadsheet (\texttt{.csv, .xls}) or MATLAB file (\texttt{.m, .mat})
\begin{itemize}
\myitem Syntax:
\begin{alltt}
>> ts = dseries(FILENAME);
\end{alltt}
\myitem File format (\texttt{.csv, .xls}): dates (optional) in first column (using the
standard format: 1990Q1 for quarterly data, 1990Y for annual data, \dots) and variable
names (optional) in the first row
\myitem File format (\texttt{.m, .mat}): variables \texttt{INIT\_\_},
\texttt{NAMES\_\_}, and \texttt{TEX\_\_} are optional. More info in the
manual. Data are vectors.
\begin{alltt}
INIT__ = `1999q1';
NAMES__ = \{`cons'\};
cons = randn(100,1);
\end{alltt}
\end{itemize}
Create an empty time series. Useful for renaming dseries.
\begin{itemize}
\myitem \texttt{tseries = dseries();}
\myitem \texttt{ts = tseries(randn(3,2));}
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{Creating subsamples from a \texttt{dseries}}
\begin{itemize}
\myitem Let \texttt{ts} be a \texttt{dseries} with $3$ variables and 5
observations from \texttt{2000Y} to \texttt{2004Y}
\begin{alltt}
ts=dseries(randn(5,3), `2000y')
\end{alltt}
\myitem To obtain a subsample from \texttt{2001Y} to \texttt{2003Y}
\begin{alltt}
ts(2001Y:2003Y)
\end{alltt}
\myitem Can also use integer indices (in a roundabout way)
\begin{alltt}
start = find(ts.dates==2001Y);
ts(ts.dates(start:end));
\end{alltt}
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{Extracting variables from a \texttt{dseries}}
\begin{itemize}
\myitem Let
\begin{alltt}
>> ts = dseries(randn(5,6), `2000q1', ...
\{`GDP_US', `GDP_FR', `GDP_JA', ...
`CPI_US', `CPI_FR', `CPI_JA'\});
\end{alltt}
\myitem We can extract one variable using syntax like
\begin{alltt}
>> ts.GDP_US
\end{alltt}
\myitem To get all the \texttt{GDP} variables
\begin{alltt}
>> ts\{`GDP_US', `GDP_FR', `GDP_JA'\}
\end{alltt}
\myitem A shorter way to do the same thing
\begin{alltt}
>> ts\{`GDP_@US,FR,JA@'\}
\end{alltt}
\myitem To get \texttt{GDP} \& \texttt{CPI} (NB: max 2 implicit loops)
\begin{alltt}
>> ts\{`@GDP,CPI@_@US,FR,JA@'\}
\end{alltt}
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{Applying methods to \texttt{dseries}}
\begin{itemize}
\myitem Suppose \texttt{ts} is as above. Then, to apply a method
(\textit{e.g.,} \texttt{log()}) to \texttt{GDP}:
\begin{alltt}
ts\{`GDP_@US,FR,JA@'\}=ts\{`GDP_@US,FR,JA@'\}.log()
\end{alltt}
\myitem To apply a method to a subsample of all the variables:
\begin{alltt}
ts(2000Q2:2000Q4) = ts(2000Q2:2000Q4).log()
\end{alltt}
\myitem To apply a method to a subsample of some of the variables:
\begin{alltt}
ts(2000Q2:2000Q4)\{`GDP_@US,FR,JA@'\} = ...
ts(2000Q2:2000Q4)\{`GDP_@US,FR,JA@'\}.log()
\end{alltt}
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{Merging \texttt{dseries}}
\begin{itemize}
\myitem Suppose that \verb+ts+ and \verb+ds+ are two \texttt{dseries} objects
with the same variables observed on different time ranges. These
\texttt{dseries} objects can be merged using the following syntax:
\begin{verbatim}
vs = [ts; ds];
\end{verbatim}
\myitem Suppose that \verb+ts+ and \verb+ds+ are two \texttt{dseries} objects
with different variables observed on the same or different time ranges. These
\texttt{dseries} objects can be merged using the following syntax:
\begin{verbatim}
vs = [ts, ds];
\end{verbatim}
If \verb+ts+ and \verb+ds+ are not defined over the same time range,
the time range of \verb+vs+ will be the union of \verb+ts.dates+ and
\verb+ds.dates+, \verb+NaN+s will be added for the missing observations.
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{Arithmetic Operations on \texttt{dseries}}
\begin{itemize}
\myitem The binary operators \texttt{+}, \texttt{-}, \texttt{*},
\texttt{/}, and \texttt{\string^} perform element-wise arithmetic operations on
\texttt{dseries}
\myitem They can be used with two \texttt{dseries} or one \texttt{dseries}
and a real number
\myitem Two \texttt{dseries} can have different date ranges. Non overlapping dates will be filled with \texttt{NaNs}
\myitem Take addition for example
\begin{itemize}
\item \texttt{t.freq;}
\myitem Let
\begin{alltt}
>> ts0 = dseries(ones(2,2)*2, `2000W1', \{`MyVar1', `MyVar2'\});
>> ts1 = dseries(ones(3,2)*3, `2000W2', \{`YrVar1', `YrVar2'\});
>> ds = ts0.MyVar1;
\end{alltt}
\myitem \texttt{ts0+3} will add \texttt{3} to every element in \texttt{ts0}
\myitem \texttt{ts0+[3 4]} will add \texttt{3} to every element in \texttt{ts0.MyVar1} and \texttt{4} to every element in \texttt{ts0.MyVar2}
\myitem \texttt{ts0+ts1} will add \texttt{ts0.MyVar1} to \texttt{ts1.YrVar1} and \texttt{ts0.MyVar2} to \texttt{ts1.YrVar2}. Only \texttt{2000W2} will contain the value \texttt{5} for both variables. All other points will contain \texttt{NaN}
\myitem \texttt{ts0+ds} will add \texttt{ds} to \texttt{ts0.MyVar1} and \texttt{ts0.MyVar2}. All values will contain \texttt{4}
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{Comparing \texttt{dates}}
\frametitle{Leads and Lags with \texttt{dseries} (1/2)}
\begin{itemize}
\item
\myitem Let
\begin{alltt}
>> ts = dseries([1:4]');
\end{alltt}
\myitem Then
\begin{alltt}
>> ts.lead() >> ts.lag()
ans is a dseries object: ans is a dseries object:
| lead(Variable_1,1) | lag(Variable_1,1)
1Y | 2 1Y | NaN
2Y | 3 2Y | 1
3Y | 4 3Y | 2
4Y | NaN 4Y | 3
\end{alltt}
\end{itemize}
\end{frame}
\subsubsection{\texttt{dseries} Syntax}
\begin{frame}[fragile,t]
\frametitle{Leads and Lags with \texttt{dseries} (2/2)}
\begin{itemize}
\myitem You can lead/lag a \texttt{dseries} by more than one period
\begin{itemize}
\myitem \texttt{ts.lead(k)} where $k\in\mathbb{Z}$
\myitem \texttt{ts.lag(k)} where $k\in\mathbb{Z}$
\end{itemize}
\myitem A shorthand syntax is available as well
\begin{itemize}
\myitem Lead: \texttt{ts(k)} where $k\in\mathbb{Z}$
\myitem Lag: \texttt{ts(-k)} where $k\in\mathbb{Z}$
\end{itemize}
\end{itemize}
\end{frame}
\subsection{Examples}
%
......@@ -175,34 +624,76 @@
%
\section{Reporting}
\subsection{Overview}
\begin{frame}
\begin{frame}[fragile,t]
\frametitle{Overview}
\begin{itemize}
\item Introduced in Dynare 4.4
\item Introduce reporting functionality to Dynare
\myitem Beta version in Dynare 4.4. Mature version ready in Dynare 4.5
\myitem Introduce reporting functionality to Dynare
\begin{itemize}
\myitem Input: \texttt{dseries}
\myitem Output: \LaTeX\ report \& compiled \texttt{.pdf}
\end{itemize}
\myitem Graphs and Tables are modular
\begin{itemize}
\item Input: \texttt{dseries}
\item Output: \LaTeX\ report \& compiled \texttt{.pdf}
\item[$\Rightarrow$] Can easily be included in another document
\end{itemize}
\item Graphs and Tables are modular
\myitem Graphs are produced in Ti$k$Z/PGFPlots (standard in a \TeX\ distribution)
\begin{itemize}
\item Can easily be included in another document
\myitem Scales well
\myitem Formating follows that of enclosing document
\end{itemize}
\item Graphs are produced in Ti$k$Z
\myitem Dynare provides a subset of the many Ti$k$Z options
\begin{itemize}
\item Scales well
\item Formating follows that of enclosing document
\myitem You can easily modify the Ti$k$Z graph if the option you want is not in Dynare
\end{itemize}
\myitem Works with MATLAB \& Octave
\myitem Works much faster than similar softawre
\myitem NB: Must install a \LaTeX\ distribution to compile reports
\begin{itemize}
\myitem On Windows use MiKTeX: \url{http://miktex.org}
\myitem On Mac OS X use MacTeX: \url{http://tug.org/mactex}
\myitem On Linux use \TeX\ Live: available from your package manager
\end{itemize}
\item Works with Matlab \& Octave
\item Works approximately 5 times faster than Iris reporting
\end{itemize}
\end{frame}
\begin{frame}
\begin{frame}[fragile,t]
\frametitle{How Reporting Works}
\begin{itemize}
\myitem Reports are created command by command
\begin{itemize}
\myitem Hence the order of commands matters
\end{itemize}
\myitem All reporting commands act on the previously added object until an object of greater or equal hierarchy is added (see next slide)
\begin{itemize}
\myitem \textit{e.g.,} Once you add a \texttt{Page} to your report with the \texttt{addPage()} command, every \texttt{Section} you add via the \texttt{addSection()} command will be placed on this page. Only when you add another \texttt{Page} will items go on a new page.
\myitem This will become more clear with an example
\end{itemize}
\myitem Options to reporting commands are passed in option name/value pairs
\begin{itemize}
\myitem \textit{e.g.,} \texttt{addPage(`title', \{`Page Title', `Page Subtitle'\})}
\end{itemize}
\end{itemize}
\end{frame}
\tikzstyle{abstract}=[rectangle, draw=black, rounded corners, fill=blue!10, drop shadow,
text centered, anchor=north, text=black, text width=2.6cm]
\tikzstyle{comment}=[rectangle, draw=black, rounded corners, fill=green!10, drop shadow,
text centered, anchor=north, text=black, text width=2.6cm]
\tikzstyle{line}=[-, thick]
\begin{frame}[fragile,t]
\frametitle{Reporting Class Hierarchy}
\centering {
\begin{itemize}
\myitem Class names on the top half of the box, constructor names on the bottom
\myitem Arrows represent what the new object can be added to; objects in green are treated a bit differently (explained below)
\end{itemize}
\begin{center}
\footnotesize{
\begin{tikzpicture}[
node distance = .45cm,
node distance = .25cm,
auto,
line/.style={->, >=stealth'},
]
......@@ -221,22 +712,30 @@
\textbf{Section}
\nodepart{second}\texttt{addSection(...);}
};
\node (Vspace) [abstract, rectangle split, rectangle split parts=2, below=of Section]
\node (Spacer) [rectangle split, rectangle split parts=2, opacity=0, below=of Section]
{
\textbf{Vspace}
\nodepart{second}\texttt{addVspace(...);}
};
\node (Graph) [abstract, rectangle split, rectangle split parts=2, left=of Vspace]
\node (Graph) [abstract, rectangle split, rectangle split parts=2, left=of Spacer, xshift=.25cm]
{
\textbf{Graph}
\nodepart{second}\texttt{addGraph(...);}
};
\node (Table) [abstract, rectangle split, rectangle split parts=2, right=of Vspace, text height=]
\node (Table) [abstract, rectangle split, rectangle split parts=2, right=of Spacer, xshift=-.25cm, text height=]
{
\textbf{Table}
\nodepart{second}\texttt{addTable(...);}
};
\node (Series) [abstract, rectangle split, rectangle split parts=2, below=of Vspace]
\node (Vspace) [comment, rectangle split, rectangle split parts=2, left=of Graph]
{
\textbf{Vspace}
\nodepart{second}\texttt{addVspace(...);}
};
\node (Paragraph) [comment, rectangle split, rectangle split parts=2, right=of Table]
{
\textbf{Paragraph}
\nodepart{second}\texttt{addParagraph(...);}
};
\node (Series) [abstract, rectangle split, rectangle split parts=2, below=of Spacer]
{
\textbf{Series}
\nodepart{second}\texttt{addSeries(...);}
......@@ -245,16 +744,201 @@
\draw [line] (Series) to node { } (Graph);
\draw [line] (Table) to node { } (Section);
\draw [line] (Graph) to node { } (Section);
\draw [line] (Vspace) to node { } (Section);
\draw [line] (Paragraph.north) to node { } (Section.east);
\draw [line] (Vspace.north) to node { } (Section.west);
\draw [line] (Section) to node { } (Page);
\draw [line] (Page) to node { } (Report);
\end{tikzpicture}
}
\end{tikzpicture}}
\end{center}
\end{frame}
\subsection{Syntax}
\begin{frame}[fragile,t]
\frametitle{Reporting Syntax (1/3)}
\begin{itemize}
\myitem \texttt{report(\ldots)}: Create a report
\begin{itemize}
\myitem \textbf{Options}: \texttt{compiler}, \texttt{showDate}, \texttt{fileName}, \texttt{margin}, \texttt{marginUnit}, \ldots
\begin{alltt}
>> rep = report(`title', `Dynare Summer School 2014', ...
`fileName', `myDynareReport.tex');
\end{alltt}
\end{itemize}
\myitem \texttt{addPage(\ldots)}: Add a page to the \texttt{Report}
\begin{itemize}
\myitem \textbf{Options}: \texttt{footnote}, \texttt{orientation}, \texttt{paper}, \texttt{title}, \texttt{titleFormat}
\begin{alltt}
>> rep = rep.addPage(`title', \{`Page Title', `Page Subtitle'\}, ...
`titleFormat', \{`\textbackslash{}large\textbackslash{}bfseries', `\textbackslash{}large'\});
\end{alltt}
\end{itemize}
\myitem \texttt{addSection(\ldots)}: Add a section to the current \texttt{Page}
\begin{itemize}
\myitem You can think of a section as a matrix. As graphs and/or tables are added to a section, it fills up from left to right. Once you have added \texttt{cols} objects, a new row is started.
\myitem \textbf{Options}: \texttt{cols}, \texttt{height}
\begin{alltt}
>> rep = rep.addSection(`cols', 3);
\end{alltt}
\end{itemize}
\end{itemize}
\end{frame}
\subsection{Examples}
\begin{frame}[fragile,t]
\frametitle{Reporting Syntax (2/3)}
\begin{itemize}
\myitem \texttt{addVspace(\ldots)}: Add a vertical space to the current \texttt{Section}.
\begin{itemize}
\myitem If the row has been completely filled in, this adds space between this row and the next row. If not, this adds space at the end of the \texttt{Section} and closes it; in other words, in this situation if you want to add more graphs, you'd have to create a new \texttt{Section} first.
\myitem \textbf{Options}: \texttt{hline}, \texttt{number}
\begin{alltt}
>> rep = rep.addVspace(`hline', 2, `number', 3);
\end{alltt}
\end{itemize}
\myitem \texttt{addParagraph(\ldots)}: Add text to the current \texttt{Section}
\begin{itemize}
\myitem To add anything other than a paragraph (or multiple paragraphs) to a \texttt{Section}, you must add a new \texttt{Section} to the page
\myitem \textbf{Options}: \texttt{balancedCols}, \texttt{cols}, \texttt{heading}, \texttt{index}, \texttt{text}
\begin{alltt}
>> rep = rep.addParagraph(`text', `Lorem ipsum\textbackslash{}ldots\textbackslash{}newline');
\end{alltt}
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{Reporting Syntax (3/3)}
\begin{itemize}
\myitem \texttt{addGraph(\ldots)}: Add a graph to the current \texttt{Section}
\begin{itemize}
\myitem \textbf{Options}: \texttt{data}, \texttt{graphDirName}, \texttt{graphName}, \texttt{graphSize}, \texttt{height}, \ldots
\begin{alltt}
>> rep = rep.addGraph(`title', `Headline Inflation (y/y)', ...
`xrange', dates(`2007q1'):dates(`2013q4'), ...
`shade', dates(`2010q1'):dates(`2013q4'), ...
`showZeroline', true);
\end{alltt}
\end{itemize}
\myitem \texttt{addTable(\ldots)}: Add a table to the current \texttt{Section}
\begin{itemize}
\myitem \textbf{Options}: \texttt{data}, \texttt{showHlines}, \texttt{precision}, \texttt{range}, \texttt{seriesToUse}, \ldots
\begin{alltt}
>> rep = rep.addTable(`title', \{`Real GDP Growth',`subtitle 1'\}, ...
`range', dates(`2007y'):dates(`2014y'), ...
`vlineAfter', dates(`2011y'));
\end{alltt}
\end{itemize}
\myitem \texttt{addSeries(\ldots)}: Add a series to the current \texttt{Graph} or \texttt{Table}
\begin{itemize}
\myitem \textbf{Options}: \texttt{data}, \texttt{graphHline}, \texttt{graphLegendName}, \texttt{graphLineColor}, \ldots
\begin{alltt}
>> rep = rep.addSeries(`data', db\_q.LRPOIL\_WORLD, ...
`graphLineColor', `blue', ...
`graphLineWidth', 1.5, ...
`graphMarker', `triangle*');
\end{alltt}
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{Output}
To create a report:
\begin{itemize}
\myitem \texttt{write()}: Writes the report to a \LaTeX\ file
\myitem \texttt{compile(\ldots)}: Compiles the report, creating a \texttt{.pdf} file
\begin{itemize}
\myitem \textbf{Options}: \texttt{compiler}
\end{itemize}
\end{itemize}
Report Output
\begin{itemize}
\myitem Unless you pass the \texttt{fileName} option to \texttt{report(\ldots)}, the report will be located in your working directory with the name \texttt{report.tex}. The compiled version will be called \texttt{report.pdf}.
\myitem Unless you pass the \texttt{graphDirName} or \texttt{graphName} options to \texttt{addGraph(\ldots)}, your graphs will be in a subdirectory of your working directory called \texttt{tmpRepDir}. The default name will take the form \texttt{graph\_pg9\_sec1\_row1\_col5.tex}
\myitem The same holds for the tables (substituting `table' for `graph' above).
\myitem Thus you can easily modify these files and include them in another report.
\end{itemize}
\end{frame}
\section{Putting it All Together}
\begin{frame}[fragile=singleslide,t]
\frametitle{Create Report of IRFs from \texttt{example1.mod} (1/3)}
\begin{itemize}
\myitem \texttt{example1.mod} is located in the Dynare \texttt{examples} directory
\myitem The lines below can be added at the end of that file.
\end{itemize}
\begin{block}{Create \texttt{dseries} from IRFs}
\begin{verbatim}
shocke = dseries();
shocku = dseries();
@#define endovars=["y", "c", "k", "a", "h", "b"]
@#for var in endovars
shocke = [shocke dseries(@{var}_e, 2014q3, `@{var}')];
shocku = [shocku dseries(@{var}_u, 2014q3, `@{var}')];
@#endfor
\end{verbatim}
\end{block}
\end{frame}
\begin{frame}[fragile=singleslide,t]
\frametitle{Create Report of IRFs from \texttt{example1.mod} (2/3)}
\begin{block}{Populate Report}
\small{
\begin{verbatim}
r = report();
@#for shock in ["e", "u"]
r = r.addPage(`title',{`Dseries/Report Example',`Shock @{shock}'},...
`titleFormat', {`\Large\bfseries', `\large\bfseries'});
r = r.addSection(`cols', 2);
@# for var in endovars
r = r.addGraph(`data', shock@{shock}.@{var}, `title', `@{var}', ...
`showGrid', false, `yTickLabelPrecision', 2, ...
`yTickLabelZeroFill', false, ...
`showZeroLine', true, `zeroLineColor', 'red');
@# endfor
r = r.addVspace(`number', 2);
r = r.addSection(`cols', 1);
r = r.addTable(`range', 2022q1:2024q1, `precision', 5);
@# for var in endovars
r = r.addSeries(`data', shock@{shock}.@{var});
@# endfor
@#endfor
\end{verbatim}
}
\end{block}
\end{frame}
\begin{frame}[fragile=singleslide,t]
\frametitle{Create Report of IRFs from \texttt{example1.mod} (3/3)}
\begin{block}{Compile Report}
\small{
\begin{verbatim}
r.write();
r.compile();
\end{verbatim}
}
\end{block}
\begin{block}{Output Files}
\small{
\begin{verbatim}
>> ls report.*
report.aux report.log report.pdf report.synctex.gz report.tex
>> ls tmpRepDir/
graph_pg1_sec1_row1_col1.tex graph_pg2_sec1_row1_col1.tex
graph_pg1_sec1_row1_col2.tex graph_pg2_sec1_row1_col2.tex
graph_pg1_sec1_row2_col1.tex graph_pg2_sec1_row2_col1.tex
graph_pg1_sec1_row2_col2.tex graph_pg2_sec1_row2_col2.tex
graph_pg1_sec1_row3_col1.tex graph_pg2_sec1_row3_col1.tex
graph_pg1_sec1_row3_col2.tex graph_pg2_sec1_row3_col2.tex
table_pg1_sec2_row1_col1.tex table_pg2_sec2_row1_col1.tex
\end{verbatim}
}
\end{block}
\end{frame}
\end{document}
Source diff could not be displayed: it is too large. Options to address this: view the blob.
if HAVE_PDFLATEX
if HAVE_BIBTEX
pdf-local: gsa.pdf
endif
endif
SRC = gsa.tex marco.bib
EXTRA_DIST = $(SRC)
gsa.pdf: $(SRC)
$(PDFLATEX) gsa
$(BIBTEX) gsa
$(PDFLATEX) gsa
$(PDFLATEX) gsa
clean-local:
rm -f *.pdf *.log *.aux *.toc *.lof *.blg *.bbl *.out *~
......@@ -4,15 +4,15 @@
\documentclass[12pt,a4paper]{article}
\usepackage{amssymb,amsmath}
\usepackage[dvips]{graphicx}
\usepackage{natbib}
\usepackage{psfrag}
\usepackage{setspace}
\usepackage{rotating}
\usepackage{hyperref}
\hypersetup{breaklinks=true,pagecolor=white,colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue}
\hypersetup{breaklinks=true,colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue}
%\singlespacing (interlinea singola)
%\onehalfspacing (interlinea 1,5)
%\doublespacing (interlinea doppia)
\usepackage{doi,natbib}
%\bibpunct{(}{)}{;}{a}{,}{,}
......@@ -22,19 +22,19 @@
\begin{document}
% ----------------------------------------------------------------
\title{Sensitivity Analysis Toolbox for DYNARE\thanks{Copyright \copyright~2012 Dynare
\title{Sensitivity Analysis Toolbox for Dynare\thanks{Copyright \copyright~2012-2024 Dynare
Team. Permission is granted to copy, distribute and/or modify
this document under the terms of the GNU Free Documentation
License, Version 1.3 or any later version published by the Free
Software Foundation; with no Invariant Sections, no Front-Cover
Texts, and no Back-Cover Texts. A copy of the license can be found
at: \url{http://www.gnu.org/licenses/fdl.txt}}}
at: \url{https://www.gnu.org/licenses/fdl.txt}}}
\author{Marco Ratto\\
European Commission, Joint Research Centre \\
TP361, IPSC, \\21027 Ispra
TP581\\21027 Ispra
(VA) Italy\\
\texttt{marco.ratto@jrc.ec.europa.eu}
\texttt{Marco.Ratto@ec.europa.eu}
\thanks{The author gratefully thanks Christophe Planas, Kenneth Judd, Michel Juillard,
Alessandro Rossi, Frank Schorfheide and the participants to the
Courses on Global Sensitivity Analysis for Macroeconomic
......@@ -52,21 +52,21 @@ helpful suggestions.}}
%-----------------------------------------------------------------------
\begin{abstract}
\noindent The Sensitivity Analysis Toolbox for DYNARE is a set of
\noindent The Sensitivity Analysis Toolbox for Dynare is a set of
MATLAB routines for the analysis of DSGE models with global
sensitivity analysis. The routines are thought to be used within
the DYNARE v4 environment.
the Dynare 6 environment.
\begin{description}
\item \textbf{Keywords}: Stability Mapping , Reduced form solution, DSGE models,
Monte Carlo filtering, Global Sensitivity Analysis.
Monte Carlo filtering, Global Sensitivity Analysis.
\end{description}
\end{abstract}
\newpage
% ----------------------------------------------------------------
\section{Introduction} \label{s:intro}
The Sensitivity Analysis Toolbox for DYNARE is a collection of
The Sensitivity Analysis Toolbox for Dynare is a collection of
MATLAB routines implemented to answer the following questions: (i)
Which is the domain of structural coefficients assuring the
stability and determinacy of a DSGE model? (ii) Which parameters
......@@ -81,20 +81,18 @@ described in \cite{Ratto_CompEcon_2008}.
\section{Use of the Toolbox}
The DYNARE parser now recognizes sensitivity analysis commands.
The Dynare parser now recognizes sensitivity analysis commands.
The syntax is based on a single command:
\vspace{0.5cm}
\verb"dynare_sensitivity(option1=<opt1_val>,option2=<opt2_val>,...)"
\verb"sensitivity(option1=<opt1_val>,option2=<opt2_val>,...)"
\vspace{0.5cm} \noindent with a list of options described in the
next section.
With respect to the previous version of the toolbox, in order to
work properly, the sensitivity analysis Toolbox \emph{no longer}
needs that the DYNARE estimation environment is set-up.
Therefore, \verb"dynare_sensitivity" is the only command to run to
In order to work properly, the sensitivity analysis Toolbox does not need
a Dynare estimation environment to be set up. Rather, \verb"sensitivity"
is the only command to run to
make a sensitivity analysis on a DSGE model\footnote{Of course,
when the user needs to perform the mapping of the fit with a
posterior sample, a Bayesian estimation has to be performed
......@@ -208,16 +206,17 @@ a multivariate normal MC sample, with covariance matrix based on
the inverse Hessian at the optimum: this analysis is useful when
ML estimation is done (i.e. no Bayesian estimation);
\item when \verb"ppost=1" the Toolbox analyses
the RMSE's for the posterior sample obtained by DYNARE's
the RMSE's for the posterior sample obtained by Dynare's
Metropolis procedure.
\end{enumerate}
The use of cases 2. and 3. requires an estimation step beforehand!
The use of cases 2. and 3. require an estimation step beforehand!
To facilitate the sensitivity analysis after estimation, the
\verb"dynare_sensitivity" command also allows to indicate some
options of \verb"dynare_estimation". These are:
\verb"sensitivity" command also allows to indicate some
options of \verb"estimation". These are:
\begin{itemize}
\item \verb"datafile"
\item \verb"diffuse_filter"
\item \verb"mode_file"
\item \verb"first_obs"
\item \verb"lik_init"
......@@ -278,10 +277,10 @@ identifiable.
\end{tabular}
\vspace{1cm}
\noindent For example, the following commands in the DYNARE model file
\noindent For example, the following commands in the Dynare model file
\vspace{1cm}
\noindent\verb"dynare_sensitivity(identification=1, morris=2);"
\noindent\verb"sensitivity(identification=1, morris=2);"
\vspace{1cm}
\noindent trigger the identification analysis using \cite{Iskrev2010,Iskrev2011}, jointly with the mapping of the acceptable region.
......@@ -293,75 +292,75 @@ Sensitivity analysis results are saved on the hard-disk of the
computer. The Toolbox uses a dedicated folder called \verb"GSA",
located in \\
\\
\verb"<DYNARE_file>\GSA", \\
\verb"<Dynare_file>\GSA", \\
\\
where \verb"<DYNARE_file>.mod" is the name of the DYNARE model
where \verb"<Dynare_file>.mod" is the name of the Dynare model
file.
\subsection{Binary data files}
A set of binary data files is saved in the \verb"GSA" folder:
\begin{description}
\item[]\verb"<DYNARE_file>_prior.mat": this file stores
\item[]\verb"<Dynare_file>_prior.mat": this file stores
information about the analyses performed sampling from the prior
ranges, i.e. \verb"pprior=1" and \verb"ppost=0";
\item[]\verb"<DYNARE_file>_mc.mat": this file stores
\item[]\verb"<Dynare_file>_mc.mat": this file stores
information about the analyses performed sampling from
multivariate normal, i.e. \verb"pprior=0" and \verb"ppost=0";
\item[]\verb"<DYNARE_file>_post.mat": this file stores information
\item[]\verb"<Dynare_file>_post.mat": this file stores information
about analyses performed using the Metropolis posterior sample,
i.e. \verb"ppost=1".
\end{description}
\begin{description}
\item[]\verb"<DYNARE_file>_prior_*.mat": these files store
\item[]\verb"<Dynare_file>_prior_*.mat": these files store
the filtered and smoothed variables for the prior MC sample,
generated when doing RMSE analysis (\verb"pprior=1" and
\verb"ppost=0");
\item[]\verb"<DYNARE_file>_mc_*.mat": these files store
\item[]\verb"<Dynare_file>_mc_*.mat": these files store
the filtered and smoothed variables for the multivariate normal MC
sample, generated when doing RMSE analysis (\verb"pprior=0" and
\verb"ppost=0").
\end{description}
\subsection{Stability analysis}
Figure files \verb"<DYNARE_file>_prior_*.fig" store results for
Figure files \verb"<Dynare_file>_prior_*.fig" store results for
the stability mapping from prior MC samples:
\begin{description}
\item[]\verb"<DYNARE_file>_prior_stab_SA_*.fig": plots of the Smirnov
test analyses confronting the cdf of the sample fulfilling
Blanchard-Kahn conditions with the cdf of the rest of the sample;
\item[]\verb"<DYNARE_file>_prior_stab_indet_SA_*.fig": plots of the Smirnov
test analyses confronting the cdf of the sample producing
indeterminacy with the cdf of the original prior sample;
\item[]\verb"<DYNARE_file>_prior_stab_unst_SA_*.fig": plots of the Smirnov
test analyses confronting the cdf of the sample producing unstable
(explosive roots) behaviour with the cdf of the original prior
\item[]\verb"<Dynare_file>_prior_stab_SA_*.fig": plots of the Smirnov
test analyses confronting the CDF of the sample fulfilling
Blanchard-Kahn conditions with the CDF of the rest of the sample;
\item[]\verb"<Dynare_file>_prior_stab_indet_SA_*.fig": plots of the Smirnov
test analyses confronting the CDF of the sample producing
indeterminacy with the CDF of the original prior sample;
\item[]\verb"<Dynare_file>_prior_stab_unst_SA_*.fig": plots of the Smirnov
test analyses confronting the CDF of the sample producing unstable
(explosive roots) behaviour with the CDF of the original prior
sample;
\item[]\verb"<DYNARE_file>_prior_stable_corr_*.fig": plots of
\item[]\verb"<Dynare_file>_prior_stable_corr_*.fig": plots of
bivariate projections of the sample fulfilling Blanchard-Kahn
conditions;
\item[]\verb"<DYNARE_file>_prior_indeterm_corr_*.fig": plots of
\item[]\verb"<Dynare_file>_prior_indeterm_corr_*.fig": plots of
bivariate projections of the sample producing indeterminacy;
\item[]\verb"<DYNARE_file>_prior_unstable_corr_*.fig": plots of
\item[]\verb"<Dynare_file>_prior_unstable_corr_*.fig": plots of
bivariate projections of the sample producing instability;
\item[]\verb"<DYNARE_file>_prior_unacceptable_corr_*.fig": plots of
\item[]\verb"<Dynare_file>_prior_unacceptable_corr_*.fig": plots of
bivariate projections of the sample producing unacceptable
solutions, i.e. either instability or indeterminacy or the
solution could not be found (e.g. the steady state solution could
not be found by the solver).
\end{description}
Similar conventions apply for \verb"<DYNARE_file>_mc_*.fig" files,
Similar conventions apply for \verb"<Dynare_file>_mc_*.fig" files,
obtained when samples from multivariate normal are used.
\subsection{RMSE analysis}
Figure files \verb"<DYNARE_file>_rmse_*.fig" store results for the
Figure files \verb"<Dynare_file>_rmse_*.fig" store results for the
RMSE analysis.
\begin{description}
\item[]\verb"<DYNARE_file>_rmse_prior*.fig": save results for
\item[]\verb"<Dynare_file>_rmse_prior*.fig": save results for
the analysis using prior MC samples;
\item[]\verb"<DYNARE_file>_rmse_mc*.fig": save results for
\item[]\verb"<Dynare_file>_rmse_mc*.fig": save results for
the analysis using multivariate normal MC samples;
\item[]\verb"<DYNARE_file>_rmse_post*.fig": save results for
\item[]\verb"<Dynare_file>_rmse_post*.fig": save results for
the analysis using Metropolis posterior samples.
\end{description}
......@@ -369,33 +368,33 @@ The following types of figures are saved (we show prior sample to
fix ideas, but the same conventions are used for multivariate
normal and posterior):
\begin{description}
\item[]\verb"<DYNARE_file>_rmse_prior_*.fig": for each parameter, plots the cdf's
\item[]\verb"<Dynare_file>_rmse_prior_*.fig": for each parameter, plots the CDF's
corresponding to the best 10\% RMES's of each observed series;
\item[]\verb"<DYNARE_file>_rmse_prior_dens_*.fig": for each parameter, plots the pdf's
\item[]\verb"<Dynare_file>_rmse_prior_dens_*.fig": for each parameter, plots the pdf's
corresponding to the best 10\% RMES's of each observed series;
\item[]\verb"<DYNARE_file>_rmse_prior_<name of observedseries>_corr_*.fig": for each observed series plots the
\item[]\verb"<Dynare_file>_rmse_prior_<name of observedseries>_corr_*.fig": for each observed series plots the
bi-dimensional projections of samples with the best 10\% RMSE's,
when the correlation is significant;
\item[]\verb"<DYNARE_file>_rmse_prior_lnlik*.fig": for each observed
series, plots \emph{in red} the cdf of the log-likelihood
corresponding to the best 10\% RMSE's, \emph{in green} the cdf of
the rest of the sample and \emph{in blue }the cdf of the full
\item[]\verb"<Dynare_file>_rmse_prior_lnlik*.fig": for each observed
series, plots \emph{in red} the CDF of the log-likelihood
corresponding to the best 10\% RMSE's, \emph{in green} the CDF of
the rest of the sample and \emph{in blue }the CDF of the full
sample; this allows to see the presence of some idiosyncratic
behaviour;
\item[]\verb"<DYNARE_file>_rmse_prior_lnpost*.fig": for each observed
series, plots \emph{in red} the cdf of the log-posterior
corresponding to the best 10\% RMSE's, \emph{in green} the cdf of
the rest of the sample and \emph{in blue }the cdf of the full
\item[]\verb"<Dynare_file>_rmse_prior_lnpost*.fig": for each observed
series, plots \emph{in red} the CDF of the log-posterior
corresponding to the best 10\% RMSE's, \emph{in green} the CDF of
the rest of the sample and \emph{in blue }the CDF of the full
sample; this allows to see idiosyncratic behaviour;
\item[]\verb"<DYNARE_file>_rmse_prior_lnprior*.fig": for each observed
series, plots \emph{in red} the cdf of the log-prior corresponding
to the best 10\% RMSE's, \emph{in green} the cdf of the rest of
the sample and \emph{in blue }the cdf of the full sample; this
\item[]\verb"<Dynare_file>_rmse_prior_lnprior*.fig": for each observed
series, plots \emph{in red} the CDF of the log-prior corresponding
to the best 10\% RMSE's, \emph{in green} the CDF of the rest of
the sample and \emph{in blue }the CDF of the full sample; this
allows to see idiosyncratic behaviour;
\item[]\verb"<DYNARE_file>_rmse_prior_lik_SA_*.fig": when
\item[]\verb"<Dynare_file>_rmse_prior_lik_SA_*.fig": when
\verb"lik_only=1", this shows the Smirnov tests for the filtering
of the best 10\% log-likelihood values;
\item[]\verb"<DYNARE_file>_rmse_prior_post_SA_*.fig": when
\item[]\verb"<Dynare_file>_rmse_prior_post_SA_*.fig": when
\verb"lik_only=1", this shows the Smirnov test for the filtering
of the best 10\% log-posterior values.
\end{description}
......@@ -405,19 +404,19 @@ In the case of the mapping of the reduced form solution, synthetic
figures are saved in the \verb"\GSA" folder:
\begin{description}
\item[]\verb"<DYNARE_file>_redform_<endo name>_vs_lags_*.fig":
\item[]\verb"<Dynare_file>_redform_<endo name>_vs_lags_*.fig":
shows bar charts of the sensitivity indices for the \emph{ten most
important} parameters driving the reduced form coefficients of the
selected endogenous variables (\verb"namendo") versus lagged
endogenous variables (\verb"namlagendo"); suffix \verb"log"
indicates the results for log-transformed entries;
\item[]\verb"<DYNARE_file>_redform_<endo name>_vs_shocks_*.fig":
\item[]\verb"<Dynare_file>_redform_<endo name>_vs_shocks_*.fig":
shows bar charts of the sensitivity indices for the \emph{ten most
important} parameters driving the reduced form coefficients of the
selected endogenous variables (\verb"namendo") versus exogenous
variables (\verb"namexo"); suffix \verb"log" indicates the results
for log-transformed entries;
\item[]\verb"<DYNARE_file>_redform_GSA(_log).fig": shows bar chart of
\item[]\verb"<Dynare_file>_redform_GSA(_log).fig": shows bar chart of
all sensitivity indices for each parameter: this allows to notice
parameters that have a minor effect for \emph{any} of the reduced
form coefficients,
......@@ -449,24 +448,24 @@ without the need of any user's intervention.
\subsection{Screening analysis}
The results of the screening analysis with Morris sampling design
are stored in the subfolder \verb"\GSA\SCREEN". The data file
\verb"<DYNARE_file>_prior" stores all the information of the
\verb"<Dynare_file>_prior" stores all the information of the
analysis (Morris sample, reduced form coefficients, etc.).
Screening analysis merely concerns reduced form coefficients.
Similar synthetic bar charts as for the reduced form analysis with
MC samples are saved:
\begin{description}
\item[]\verb"<DYNARE_file>_redform_<endo name>_vs_lags_*.fig":
\item[]\verb"<Dynare_file>_redform_<endo name>_vs_lags_*.fig":
shows bar charts of the elementary effect tests for the \emph{ten
most important} parameters driving the reduced form coefficients
of the selected endogenous variables (\verb"namendo") versus
lagged endogenous variables (\verb"namlagendo");
\item[]\verb"<DYNARE_file>_redform_<endo name>_vs_shocks_*.fig":
\item[]\verb"<Dynare_file>_redform_<endo name>_vs_shocks_*.fig":
shows bar charts of the elementary effect tests for the \emph{ten
most important} parameters driving the reduced form coefficients
of the selected endogenous variables (\verb"namendo") versus
exogenous variables (\verb"namexo");
\item[]\verb"<DYNARE_file>_redform_screen.fig": shows bar chart of
\item[]\verb"<Dynare_file>_redform_screen.fig": shows bar chart of
all elementary effect tests for each parameter: this allows to
identify parameters that have a minor effect for \emph{any} of the
reduced form coefficients.
......
@ARTICLE{Ratto_CompEcon_2008,
author = {Ratto, M.},
title = {Analysing DSGE Models with Global Sensitivity Analysis},
journal = {Computational Economics},
year = {2008},
volume = {31},
pages = {115--139},
% Encoding: UTF-8
@Article{Ratto_CompEcon_2008,
author = {Ratto, Marco},
journal = {Computational Economics},
title = {Analysing {DSGE} models with global sensitivity analysis},
year = {2008},
pages = {115--139},
volume = {31},
doi = {10.1007/s10614-007-9110-6},
}
@ARTICLE{Iskrev2010,
author = {Nikolay Iskrev},
title = {Local Identification in {DSGE} Models},
@Article{Iskrev2010,
author = {Nikolay Iskrev},
journal = {Journal of Monetary Economics},
year = {2010},
volume = {57},
pages = {189-202}
title = {Local Identification in {DSGE} Models},
year = {2010},
number = {2},
pages = {189-202},
volume = {57},
doi = {10.1016/j.jmoneco.2009.12.007},
}
@UNPUBLISHED{Iskrev2011,
......@@ -23,3 +28,5 @@
note = {mimeo},
year = {2011}
}
@Comment{jabref-meta: databaseType:bibtex;}
\ifx\undefined\bysame
\newcommand{\bysame}{\leavevmode\hbox to\leftmargin{\hrulefill\,\,}}
\fi
\begin{thebibliography}{xx}
\harvarditem[Collard and Juillard]{Collard and Juillard}{2001}{COLL/JUIL/01a}
{ Collard, F. and M.~Juillard}, Accuracy of stochastic perturbation methods:
The case of asset pricing models, {\it Journal of Economic Dynamics and
Control}, 2001, {\it 25}, 979--999.
\harvarditem[Schmitt-Grohe and Uribe]{Schmitt-Grohe and Uribe}{2002}{SGU/02}
{ Schmitt-Grohe, S. and M.~Uribe}, {\it Solving Dynamic General Equilibrium
Models Using a Second-Order Approximation to the Policy Function}, technical
working paper, Rutgers Univsersity 2002.
\end{thebibliography}
\documentclass[11pt,a4paper]{article}
\usepackage{bibmad,graphicx,latexsym,amssymb,times}
\usepackage[cp850]{inputenc}
\usepackage{graphicx,latexsym,amssymb,times}
\usepackage[utf8]{inputenc}
\begin{document}
\title{Stochastic simulations with {\sc Dynare}. \\ A practical guide.}
\author{Fabrice Collard (GREMAQ, University of Toulouse)\\Adapted for Dynare 4.1\\ by Michel Juillard and S\'ebastien Villemot (CEPREMAP)}
\author{Fabrice Collard (GREMAQ, University of Toulouse)\\Adapted for Dynare 4.x\\ by Michel Juillard and S\'ebastien Villemot (CEPREMAP)}
\date{First draft: February 2001\hspace{10mm}This draft: December 2009.}
\maketitle
This document describes a model involving both endogenous and exogenous state variable. We first describe the theoretical model, before showing how the perturbation method is implemented in {\sc Dynare}.
\section{A theoretical model}
We consider an economy that consists of a large number of dynastic households and a large number of firms. Firms are producing a homogeneous final product that can be either consumed or invested by means of capital and labor services. Firms own their capital stock and hire labor supplied by the households. Households own the firms. In each and every period three perfectly competitive markets open --- the markets for consumption goods, labor services, and financial capital in the form of firms' shares.
\section{A theoretical model}
We consider an economy that consists of a large number of dynastic households and a large number of firms. Firms are producing a homogeneous final product that can be either consumed or invested by means of capital and labor services. Firms own their capital stock and hire labor supplied by the households. Households own the firms. In each and every period three perfectly competitive markets open --- the markets for consumption goods, labor services, and financial capital in the form of firms' shares.
Household preferences are characterized by the lifetime utility function:
\begin{equation}
E_t\sum_{\tau=t}^{\infty}{\beta^\star}^{\tau-t} \left(\log(c_t)-\theta\frac{h_t^{1+\psi}}{1+\psi}\right)
\label{eq:ut}
\end{equation}
\noindent where $0<\beta^\star<1$ is a constant discount factor, $c_t$ is consumption in period
$t$, $h_t$ is the fraction of total available time devoted to productive activity in period $t$, $\theta>0$ and $\psi\geqslant 0$. We assume that there exists a central planner that determines hours, consumption and capital accumulation maximizing the household's utility function subject to the following budget constraint
$t$, $h_t$ is the fraction of total available time devoted to productive activity in period $t$, $\theta>0$ and $\psi\geqslant 0$. We assume that there exists a central planner that determines hours, consumption and capital accumulation maximizing the household's utility function subject to the following budget constraint
\begin{equation}
c_t+i_t=y_t
\label{eq:bud}
......@@ -44,7 +44,7 @@ a_t\\b_t
\left(
\begin{array}{cc}
\rho&\tau\\
\tau&\rho\\
\tau&\rho\\
\end{array}
\right)\left(
\begin{array}{c}
......@@ -57,7 +57,7 @@ a_{t-1}\\b_{t-1}
\end{array}
\right) \label{eq:process}
\end{equation}
where $|\rho+\tau|<1$ and $|\rho-\tau|<1 $ for sake of stationarity and
where $|\rho+\tau|<1$ and $|\rho-\tau|<1 $ for sake of stationarity and
\begin{eqnarray*}
E(\varepsilon_t)&=& 0,\\
E(\nu_t)&=& 0,\\
......@@ -65,7 +65,7 @@ E(\varepsilon_t\varepsilon_s)&=&\left\{
\begin{array}{lcl}
\sigma^2_\varepsilon & \mbox{ if } & t=s \\
0 & \mbox{ if } & t\neq s \\
\end{array}\right. \mbox{, }\\
\end{array}\right. \mbox{, }\\
E(\nu_t\nu_s)&=&\left\{
\begin{array}{lcl}
\sigma^2_\nu & \mbox{ if } & t=s \\
......@@ -75,24 +75,24 @@ E(\varepsilon_t\nu_s)&=&\left\{
\begin{array}{lcl}
\varphi\sigma_\varepsilon\sigma_\nu & \mbox{ if } & t=s \\
0 & \mbox{ if } & t\neq s \\
\end{array}\right. \mbox{. }
\end{array}\right. \mbox{. }
\end{eqnarray*}
\section{Dynamic Equilibrium}
The dynamic equilibrium of this economy follows from the first order conditions for optimality:
The dynamic equilibrium of this economy follows from the first order conditions for optimality:
\begin{eqnarray*}
&&c_t \theta h_t^{1+\psi}=(1-\alpha) y_t \\
&&\beta E_t\left[\left(\frac{\exp(b_t) c_t}{\exp(b_{t+1})c_{t+1}}\right)\left(\exp(b_{t+1})\alpha \frac{y_{t+1}}{k_{t+1}}+1-\delta\right)\right]=1\\
&&y_t=\exp(a_t) k_t^\alpha h_t^{1-\alpha} \\
&&k_{t+1}=\exp(b_t)(y_t-c_t)+(1-\delta)k_t \\
&&a_t=\rho a_{t-1}+\tau b_{t-1}+\varepsilon_t \\
&&b_t=\tau a_{t-1}+\rho b_{t-1}+\nu_t
&&b_t=\tau a_{t-1}+\rho b_{t-1}+\nu_t
\end{eqnarray*}
\section{The {\sc dynare} code}
The {\sc dynare} code is straightforward to write, as the equilibrium is written in the natural way. The whole code is reported at the end of the section. Before that we proceed step by step.
\paragraph{Preamble}
The preamble consists of the some declarations to setup the endogenous and exogenous variables, the parameters and assign values to these parameters.
The preamble consists of the some declarations to setup the endogenous and exogenous variables, the parameters and assign values to these parameters.
\begin{enumerate}
\item {\tt var y, c, k, h, a, b;} specifies the endogenous variables in the model since we have output ({\tt y}), consumption ({\tt c}), capital ({\tt k}), hours ({\tt h}) and the two shocks ({\tt a, b}).
\item {\tt varexo e, u;} specifies the exogenous variables in the model --- namely the innovations of the shocks, since we have the innovation of the non--incorporated shock ({\tt e}), and the innovation of the incorporated shock ({\tt u}).
......@@ -133,9 +133,9 @@ theta = 2.95;
\end{enumerate}
\paragraph{Declaration of the model:}
This step is done in a straightforward way. It starts with the instruction {\tt model;} and ends with {\tt end;}, in between all equilibrium conditions are written exactly the way we write it ``by hand''. However, there is a simple rule that should be kept in mind when the model is written. Let us consider a variable $x$:
This step is done in a straightforward way. It starts with the instruction {\tt model;} and ends with {\tt end;}, in between all equilibrium conditions are written exactly the way we write it ``by hand''. However, there is a simple rule that should be kept in mind when the model is written. Let us consider a variable $x$:
\begin{itemize}
\item If $x$ is decided in period $t$ then we simply write ${\tt x}$.
\item If $x$ is decided in period $t$ then we simply write ${\tt x}$.
\item When the variable is decided in $t-1$, such as the capital stock in our simple model, we write ${\tt x(-1)}$. \item Finally, when a variable is decided in the next period, $t+1$, such as consumption in the Euler equation, we write ${\tt x(+1)}$.
\end{itemize}
Hence the required code to declare our model in {\sc Dynare} will be:
......@@ -164,7 +164,7 @@ end;
\end{verbatim}
so that the level of consumption is actually given by ${\tt exp(c)}$.
\paragraph{Solving the model}
\begin{enumerate}
\begin{enumerate}
\item Now we need to provide numerical initial conditions for the computation of the deterministic steady state. This is done with the sequence between {\tt initval;} and {\tt end;}. Each variable, endogenous or exogenous, should be initialized. In our example, we give the exact values of the deterministic equilibrium in absence of shocks. This takes the form
\begin{verbatim}
initval;
......@@ -206,12 +206,12 @@ Number of periods on which to compute the IRFs (default = 40)
\item {\tt nofunctions}:
Doesn't print the coefficients of the approximated solution
\item {\tt nomoments}:
Doesn't print moments of the endogenous variables
Doesn't print moments of the endogenous variables
\item {\tt order} = [1,2,3]:
Order of Taylor approximation (default = 2)
\item {\tt replic} = Integer:
Number of simulated series used to compute the IRFs (default = 1, if order = 1, and 50 otherwise)
\end{itemize}
\end{itemize}
In our first example, we use simply:
\begin{verbatim}
......@@ -324,8 +324,8 @@ end;
stoch_simul(periods=2000, drop=200);
\end{verbatim}
\bibliographystyle{Usmad}
\bibliography{/papers/biblio/michel}
%\bibliographystyle{Usmad}
%\bibliography{/papers/biblio/michel}
\end{document}
......
EXTRA_DIST = dynare-internals.org
if ENABLE_ORG_EXPORT
html-local:
emacs --batch --visit=dynare-internals.org --funcall org-export-as-html-batch
endif
clean-local:
rm -rf *.html ltxpng
......@@ -2,7 +2,6 @@ function build_internal_documentation()
% The name of the function should be explicit...
datafiles = [];
datafiles = [ datafiles ; {'../../matlab/utilities/dataset'}, {'initialize_dataset'}];
datafiles = [ datafiles ; {'../../matlab/utilities/dataset'}, {'descriptive_statistics'}];
datafiles = [ datafiles ; {'../../matlab/utilities/dataset'}, {'compute_stdv'}];
datafiles = [ datafiles ; {'../../matlab/utilities/dataset'}, {'compute_cova'}];
......@@ -81,4 +80,4 @@ if rows(miscfiles)
fprintf(fid,'\n\n\n');
end
end
fclose(fid);
\ No newline at end of file
fclose(fid);
......@@ -60,7 +60,7 @@ under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license can be found at @uref{http://www.gnu.org/licenses/fdl.txt}.
A copy of the license can be found at @uref{https://www.gnu.org/licenses/fdl.txt}.
@end quotation
@end copying
......@@ -203,18 +203,18 @@ institutions who cannot afford, or do not want to pay for, MATLAB and
are willing to bear the concomitant performance loss.
The development of Dynare is mainly done at
@uref{http://www.cepremap.ens.fr, Cepremap} by a core team of
@uref{http://www.cepremap.ens.fr, CEPREMAP} by a core team of
researchers who devote part of their time to software
development. Currently the development team of Dynare is composed of
Stéphane Adjemian (Université du Maine, Gains and Cepremap), Houtan
Bastani (Cepremap), Michel Juillard (Banque de France), Frédéric
Karamé (Université d'Évry, Epee and Cepremap), Junior Maih (Norges
Bank), Ferhat Mihoubi (Université d'Évry, Epee and Cepremap), George
Perendia, Marco Ratto (JRC) and Sébastien Villemot (Cepremap and Paris
School of Economics). Financial support is provided by Cepremap,
Stéphane Adjemian (Université du Maine, Gains and CEPREMAP), Houtan
Bastani (CEPREMAP), Michel Juillard (Banque de France), Frédéric
Karamé (Université d'Évry, Epee and CEPREMAP), Junior Maih (Norges
Bank), Ferhat Mihoubi (Université d'Évry, Epee and CEPREMAP), George
Perendia, Marco Ratto (JRC) and Sébastien Villemot (CEPREMAP and Paris
School of Economics). Financial support is provided by CEPREMAP,
Banque de France and DSGE-net (an international research network for
DSGE modeling). Increasingly, the developer base is expanding, as
tools developed by researchers outside of Cepremap are integrated into
tools developed by researchers outside of CEPREMAP are integrated into
Dynare.
Interaction between developers and users of Dynare is central to the
......
if HAVE_PDFLATEX
if HAVE_BEAMER
pdf-local: macroprocessor.pdf
endif
endif
SRC = macroprocessor.tex new-design.pdf
EXTRA_DIST = $(SRC)
macroprocessor.pdf: $(SRC)
$(PDFLATEX) macroprocessor
$(PDFLATEX) macroprocessor
clean-local:
rm -f macroprocessor.pdf *.toc *.aux *.log *.nav *.snm *.vrb *.out *~