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
Loading items

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
  • ebenetce/dynare
  • chskcau/dynare-doc-fixes
28 results
Select Git revision
Loading items
Show changes
Showing
with 367 additions and 387 deletions
...@@ -64,7 +64,7 @@ public:@; ...@@ -64,7 +64,7 @@ public:@;
@<|IntegDerivs| constructor code@>; @<|IntegDerivs| constructor code@>;
}; };
@ This constuctor integrates a rule (namely its $g^{**}$ part) with @ This constructor integrates a rule (namely its $g^{**}$ part) with
respect to $u=\tilde\sigma\eta$, and stores to the object the respect to $u=\tilde\sigma\eta$, and stores to the object the
derivatives of this integral $h$ at $(y^*,u,\sigma)=(\tilde derivatives of this integral $h$ at $(y^*,u,\sigma)=(\tilde
y^*,0,\tilde\sigma)$. The original container of $g^{**}$, the moments of y^*,0,\tilde\sigma)$. The original container of $g^{**}$, the moments of
......
...@@ -155,18 +155,18 @@ sigma_m =-5.85; ...@@ -155,18 +155,18 @@ sigma_m =-5.85;
Lambdamu=3.4e-3; Lambdamu=3.4e-3;
LambdaA = 2.8e-3; LambdaA = 2.8e-3;
LambdaYd= (LambdaA+alppha*Lambdamu)/(1-alppha);
/* /*
The following parameters are set in the steady state file as they depend on other The following parameters are set in the steady state file as they depend on other
deep parameters that were estimated in the original study. Setting them in the deep parameters (some were estimated in the original study). Setting them in the
steady state file means they are updated for every parameter draw in the MCMC steady state file means they are updated for every parameter draw in the MCMC
algorithm, while the parameters initialized here are only set once for the initial algorithm, while the parameters initialized here are only set once for the initial
values of the parameters they depend on: values of the parameters they depend on:
gammma1 as it depends on LambdaA, alppha, Lambdamu, betta, and delta gammma1=mu_z*mu_I/betta-(1-delta);
Rbar =0 as it depends on PI, LambdaA, alppha, Lambdamu, and betta R=1+(PIbar*mu_z/betta-1);
Lambdax Lambdax=exp(LambdaYd);
LambdaYd= (LambdaA+alppha*Lambdamu)/(1-alppha);
*/ */
......
...@@ -36,6 +36,7 @@ d=1; ...@@ -36,6 +36,7 @@ d=1;
phi=1; phi=1;
m=0; m=0;
zeta=1; zeta=1;
LambdaYd= (LambdaA+alppha*Lambdamu)/(1-alppha);
mu_z=exp(LambdaYd); mu_z=exp(LambdaYd);
mu_I=exp(Lambdamu); mu_I=exp(Lambdamu);
mu_A=exp(LambdaA); mu_A=exp(LambdaA);
......
...@@ -74,8 +74,11 @@ periods 1; ...@@ -74,8 +74,11 @@ periods 1;
values 1.2; values 1.2;
end; end;
// Deterministic simulation of the model for 200 periods // Prepare the deterministic simulation of the model over 200 periods
simul(periods=200); perfect_foresight_setup(periods=200);
// Perform the simulation
perfect_foresight_solver;
// Display the path of consumption and capital // Display the path of consumption and capital
rplot c; rplot c;
......
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Dynare Upstream-Name: Dynare
Upstream-Contact: Dynare Team, whose members in 2016 are: Upstream-Contact: Dynare Team, whose members in 2017 are:
Stéphane Adjemian <stephane.adjemian@univ-lemans.fr> Stéphane Adjemian <stephane.adjemian@univ-lemans.fr>
Houtan Bastani <houtan@dynare.org> Houtan Bastani <houtan@dynare.org>
Michel Juillard <michel.juillard@mjui.fr> Michel Juillard <michel.juillard@mjui.fr>
Frédéric Karamé <frederic.karame@univ-lemans.fr> Frédéric Karamé <frederic.karame@univ-lemans.fr>
Junior Maih <junior.maih@gmail.com> Junior Maih <junior.maih@gmail.com>
Ferhat Mihoubi <fmihoubi@univ-evry.fr> Ferhat Mihoubi <fmihoubi@univ-evry.fr>
George Perendia <george@perendia.orangehome.co.uk>
Johannes Pfeifer <jpfeifer@gmx.de> Johannes Pfeifer <jpfeifer@gmx.de>
Marco Ratto <marco.ratto@jrc.ec.europa.eu> Marco Ratto <marco.ratto@ec.europa.eu>
Sébastien Villemot <sebastien@dynare.org> Sébastien Villemot <sebastien@dynare.org>
Source: http://www.dynare.org Source: http://www.dynare.org
...@@ -18,8 +17,8 @@ Copyright: 1996-2017 Dynare Team ...@@ -18,8 +17,8 @@ Copyright: 1996-2017 Dynare Team
License: GPL-3+ License: GPL-3+
Files: matlab/AIM/SP* Files: matlab/AIM/SP*
Copyright: public-domain Copyright: none
License: public-domain License: public-domain-aim
This code is in the public domain and may be used freely. This code is in the public domain and may be used freely.
However the authors would appreciate acknowledgement of the source by However the authors would appreciate acknowledgement of the source by
citation of any of the following papers: citation of any of the following papers:
...@@ -86,53 +85,56 @@ Copyright: 2016 Benjamin Born and Johannes Pfeifer ...@@ -86,53 +85,56 @@ Copyright: 2016 Benjamin Born and Johannes Pfeifer
2016 Dynare Team 2016 Dynare Team
License: GPL-3+ License: GPL-3+
Files: matlab\gsa\Morris_Measure_Groups.m Files: matlab/gsa/Morris_Measure_Groups.m
matlab\gsa\Sampling_Function_2.m matlab/gsa/Sampling_Function_2.m
Written by Jessica Cariboni and Francesca Campolongo Copyright: 2005 European Commission
2012 Dynare Team
License: GPL-3+
Comment: Written by Jessica Cariboni and Francesca Campolongo
Joint Research Centre, The European Commission, Joint Research Centre, The European Commission,
Copyright (C) 2005 European Commission
Copyright (C) 2012 Dynare Team Files: matlab/gsa/cumplot.m
matlab/gsa/filt_mc_.m
Files: matlab\gsa\cumplot.m matlab/gsa/gsa_plotmatrix.m
matlab\gsa\filt_mc_.m matlab/gsa/gsa_skewness.m
matlab\gsa\gsa_plotmatrix.m matlab/gsa/gsa_speed.m
matlab\gsa\gsa_skewness.m matlab/gsa/log_trans_.m
matlab\gsa\gsa_speed.m matlab/gsa/map_calibration.m
matlab\gsa\log_trans_.m matlab/gsa/map_ident_.m
matlab\gsa\map_calibration.m matlab/gsa/mcf_analysis.m
matlab\gsa\map_ident_.m matlab/gsa/myboxplot.m
matlab\gsa\mcf_analysis.m matlab/gsa/myprctilecol.m
matlab\gsa\myboxplot.m matlab/gsa/prior_draw_gsa.m
matlab\gsa\myprctilecol.m matlab/gsa/read_data.m
matlab\gsa\prior_draw_gsa.m matlab/gsa/redform_map.m
matlab\gsa\read_data.m matlab/gsa/redform_screen.m
matlab\gsa\redform_map.m matlab/gsa/scatter_mcf.m
matlab\gsa\redform_screen.m matlab/gsa/smirnov.m
matlab\gsa\scatter_mcf.m matlab/gsa/stab_map_.m
matlab\gsa\smirnov.m matlab/gsa/stab_map_1.m
matlab\gsa\stab_map_.m matlab/gsa/stab_map_2.m
matlab\gsa\stab_map_1.m matlab/gsa/stand_.m
matlab\gsa\stab_map_2.m matlab/gsa/tcrit.m
matlab\gsa\stand_.m matlab/gsa/teff.m
matlab\gsa\tcrit.m matlab/gsa/trank.m
matlab\gsa\teff.m Copyright: 2011-2017 European Commission
matlab\gsa\trank.m 2011-2017 Dynare Team
Copyright (C) 2011-2017 European Commission License: GPL-3+
Copyright (C) 2011-2017 Dynare Team
Files: matlab/gsa/pick.m Files: matlab/gsa/pick.m
Copyright (C) 2001-2017 European Commission Copyright: none
This file is part of GLUEWIN License: public-domain-jrc
The program has been developed by M. Ratto, European Commission, Joint Research Centre, This software has been developed at the Joint Research Centre of European Commission
Institute for the Protection and Security of The Citizen, Technological and Economic Risk Management,
Applied Statistics, as a deliverable of the IMPACT project
(EC Fifth Framework Programme, SCA Project, IST-1999-11313, DG-INFSO).
Disclaimer: This software has been developed at the Joint Research Centre of European Commission
by officers in the course of their official duties. This software is not subject to copyright by officers in the course of their official duties. This software is not subject to copyright
protection and is in the public domain. It is an experimental system. The Joint Research Centre protection and is in the public domain. It is an experimental system. The Joint Research Centre
of European Commission assumes no responsibility whatsoever for its use by other parties of European Commission assumes no responsibility whatsoever for its use by other parties
and makes no guarantees, expressed or implied, about its quality, reliability, or any other and makes no guarantees, expressed or implied, about its quality, reliability, or any other
characteristic. We would appreciate acknowledgement if the software is used. characteristic. We would appreciate acknowledgement if the software is used.
Comment: This file is part of GLUEWIN.
The program has been developed by M. Ratto, European Commission, Joint Research Centre,
Institute for the Protection and Security of The Citizen, Technological and Economic Risk Management,
Applied Statistics, as a deliverable of the IMPACT project
(EC Fifth Framework Programme, SCA Project, IST-1999-11313, DG-INFSO).
Files: matlab/optimization/simpsa.m matlab/optimization/simpsaget.m matlab/optimization/simpsaset.m Files: matlab/optimization/simpsa.m matlab/optimization/simpsaget.m matlab/optimization/simpsaset.m
Copyright: 2005 Henning Schmidt, FCC, henning@fcc.chalmers.se Copyright: 2005 Henning Schmidt, FCC, henning@fcc.chalmers.se
...@@ -141,23 +143,24 @@ Copyright: 2005 Henning Schmidt, FCC, henning@fcc.chalmers.se ...@@ -141,23 +143,24 @@ Copyright: 2005 Henning Schmidt, FCC, henning@fcc.chalmers.se
License: GPL-3+ License: GPL-3+
Files: matlab/missing/stats/normpdf.m matlab/missing/stats/gamcdf.m Files: matlab/missing/stats/normpdf.m matlab/missing/stats/gamcdf.m
matlab/missing/stats/common_size.m matlab/missing/stats/chi2inv.m matlab/missing/stats/chi2inv.m
matlab/missing/stats/gaminv.m matlab/missing/stats/gampdf.m matlab/missing/stats/gaminv.m matlab/missing/stats/gampdf.m
matlab/missing/stats/stdnormal_inv.m matlab/missing/stats/betacdf.m matlab/missing/stats/stdnormal_inv.m matlab/missing/stats/betacdf.m
matlab/missing/stats/betapdf.m matlab/missing/stats/normcdf.m matlab/missing/stats/betapdf.m matlab/missing/stats/normcdf.m
matlab/missing/stats/stdnormal_cdf.m matlab/missing/stats/norminv.m matlab/missing/stats/stdnormal_cdf.m matlab/missing/stats/norminv.m
matlab/missing/stats/stdnormal_pdf.m matlab/missing/stats/betainv.m matlab/missing/stats/stdnormal_pdf.m matlab/missing/stats/betainv.m
matlab/missing/stats-matlab/common_size.m
Copyright: 1995-2007 Kurt Hornik Copyright: 1995-2007 Kurt Hornik
2008-2011 Dynare Team 2008-2011 Dynare Team
License: GPL-3+ License: GPL-3+
Files: matlab/missing/stats/quantile.m Files: matlab/missing/stats-matlab/quantile.m
Copyright: 2014-2016 Christopher Hummersone Copyright: 2014-2016 Christopher Hummersone
2016 Dynare Team 2016 Dynare Team
License: GPL-3+ License: GPL-3+
Files: matlab/missing/stats/corr.m Files: matlab/missing/stats-matlab/corr.m
Copyright: 1993-1996 Kurt Hornik Copyright: 1993-1996 Kurt Hornik
1996-2015 John W. Eaton 1996-2015 John W. Eaton
2013-2015 Julien Bect 2013-2015 Julien Bect
...@@ -175,83 +178,24 @@ Copyright: 2005 Jos van der Geest <jos@jasen.nl> ...@@ -175,83 +178,24 @@ Copyright: 2005 Jos van der Geest <jos@jasen.nl>
2013 Christophe Gouel 2013 Christophe Gouel
2016 Dynare Team 2016 Dynare Team
License: BSD-2-clause License: BSD-2-clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
.
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Files: matlab/lmmcp/lmmcp.m Files: matlab/lmmcp/lmmcp.m
Copyright: 2005 Christian Kanzow and Stefania Petra Copyright: 2005 Christian Kanzow and Stefania Petra
2013 Christophe Gouel 2013 Christophe Gouel
2014 Dynare Team 2014 Dynare Team
License: permissive License: permissive-lmmcp
Unlimited permission is granted to everyone to use, copy, modify or Unlimited permission is granted to everyone to use, copy, modify or
distribute this software. distribute this software.
Files: matlab/utilities/graphics/distinguishable_colors.m Files: matlab/utilities/graphics/distinguishable_colors.m
Copyright 2010-2011 by Timothy E. Holy Copyright: 2010-2011 Timothy E. Holy
All rights reserved. License: BSD-2-clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Files: matlab/utilities/graphics/colorspace.m Files: matlab/utilities/graphics/colorspace.m
Pascal Getreuer 2005-2010 Copyright: 2005-2010 Pascal Getreuer
All rights reserved. License: BSD-2-clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Files: doc/dynare.texi doc/*.tex doc/*.svg doc/*.dia doc/*.pdf doc/*.bib Files: doc/dynare.texi doc/*.tex doc/*.svg doc/*.pdf doc/*.bib
Copyright: 1996-2017 Dynare Team Copyright: 1996-2017 Dynare Team
License: GFDL-NIV-1.3+ License: GFDL-NIV-1.3+
...@@ -300,7 +244,7 @@ Files: m4/ax_compare_version.m4 ...@@ -300,7 +244,7 @@ Files: m4/ax_compare_version.m4
Copyright: 2008 Tim Toolan <toolan@ele.uri.edu> Copyright: 2008 Tim Toolan <toolan@ele.uri.edu>
License: permissive-autoconf License: permissive-autoconf
Files: m4/ax_latex_bibtex_test.m4 m4/ax_latex_class.m4 m4/ax_tex_test.m4 Files: m4/ax_latex_class.m4 m4/ax_tex_test.m4
Copyright: 2008 Boretti Mathieu <boretti@eig.unige.ch> Copyright: 2008 Boretti Mathieu <boretti@eig.unige.ch>
2009 Dynare Team 2009 Dynare Team
License: LGPL-2.1+ License: LGPL-2.1+
...@@ -329,7 +273,7 @@ Copyright: 1996-2011 Daniel Waggoner and Tao Zha ...@@ -329,7 +273,7 @@ Copyright: 1996-2011 Daniel Waggoner and Tao Zha
License: GPL-3+ License: GPL-3+
Files: contrib/ms-sbvar/switch_dw/state_space/sbvar/dw_csminwel.c Files: contrib/ms-sbvar/switch_dw/state_space/sbvar/dw_csminwel.c
state_space/sbvar/dw_csminwel.h contrib/ms-sbvar/switch_dw/state_space/sbvar/dw_csminwel.h
Copyright: 1996 Christopher Sims Copyright: 1996 Christopher Sims
2003 Karibzhanov, Waggoner and Zha 2003 Karibzhanov, Waggoner and Zha
License: GPL-3+ License: GPL-3+
...@@ -403,32 +347,28 @@ Files: contrib/ms-sbvar/TZcode/MatlabFiles/qplot2.m ...@@ -403,32 +347,28 @@ Files: contrib/ms-sbvar/TZcode/MatlabFiles/qplot2.m
Copyright: 1997-2012 Clark A. Burdick Copyright: 1997-2012 Clark A. Burdick
License: GPL-3+ License: GPL-3+
Files: contrib/dmm/* License: BSD-2-clause
Copyright: 2010-2014 European Commission Redistribution and use in source and binary forms, with or without
2006-2012 Dynare Team modification, are permitted provided that the following conditions are
License: GPL-3+ met:
.
Files: contrib/dmm/randlib/* * Redistributions of source code must retain the above copyright
Copyright: none notice, this list of conditions and the following disclaimer.
License: public-domain * Redistributions in binary form must reproduce the above copyright
We place the Randlib code that we have written in the public domain. notice, this list of conditions and the following disclaimer in
. the documentation and/or other materials provided with the distribution
NO WARRANTY .
. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
WE PROVIDE ABSOLUTELY NO WARRANTY OF ANY KIND EITHER EXPRESSED OR AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
THIS PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SERVICING, REPAIR OR CORRECTION. SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
. INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR ANY OF ITS COMPONENT CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
INSTITUTIONS INCLUDING M. D. ANDERSON HOSPITAL BE LIABLE TO YOU FOR ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL, POSSIBILITY OF SUCH DAMAGE.
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA OR
ITS ANALYSIS BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD
PARTIES) THE PROGRAM.
License: GFDL-NIV-1.3+ License: GFDL-NIV-1.3+
Permission is granted to copy, distribute and/or modify this document Permission is granted to copy, distribute and/or modify this document
...@@ -438,21 +378,6 @@ License: GFDL-NIV-1.3+ ...@@ -438,21 +378,6 @@ License: GFDL-NIV-1.3+
. .
A copy of the license can be found at <http://www.gnu.org/licenses/fdl.txt> A copy of the license can be found at <http://www.gnu.org/licenses/fdl.txt>
License: GPL-2+
This program is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 2 of
the License, or (at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see
<http://www.gnu.org/licenses/>.
License: GPL-2+ with Autoconf exception License: GPL-2+ with Autoconf exception
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as modify it under the terms of the GNU General Public License as
......
# ===========================================================================
# http://www.nongnu.org/autoconf-archive/ax_latex_test.html
# ===========================================================================
#
# OBSOLETE MACRO
#
# Deprecated because of licensing issues. The Lesser GPL imposes licensing
# restrictions on the generated configure script unless it is augmented
# with an Autoconf Exception clause.
#
# SYNOPSIS
#
# AX_LATEX_BIBTEX_TEST(FILEDATA,BIBDATA,VARIABLETOSET,[NOCLEAN])
#
# DESCRIPTION
#
# This macros creates a bib file called contest.bib with BIBDATA,
# executes the latex application with FILEDATA as input, then runs
# bibtex on the resulting aux file, and finally sets VARIABLETOSET
# to yes or no depending on the result. If NOCLEAN is set, the folder
# used for the test is not deleted after testing.
#
# The macro assumes that the variables PDFLATEX and BIBTEX are set.
#
# Adapted from the macro AX_LATEX_TEST by Sébastien Villemot.
#
# LICENSE
#
# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
# Copyright (c) 2009 Dynare Team
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or (at
# your option) any later version.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library. If not, see <http://www.gnu.org/licenses/>.
AC_DEFUN([AX_LATEX_BIBTEX_TEST],[
rm -rf conftest.dir/.acltx
AS_MKDIR_P([conftest.dir/.acltx])
cd conftest.dir/.acltx
m4_ifval([$3],[$3="no"; export $3;])
cat > conftest.tex << ACLEOF
$1
ACLEOF
cat > conftest.bib << ACLEOF
$2
ACLEOF
$PDFLATEX conftest 2>&1 1>output
$BIBTEX conftest 2>&1 1>output2 m4_ifval([$3],[&& $3=yes])
cd ..
cd ..
sed 's/^/| /' conftest.dir/.acltx/conftest.tex >&5
echo "$as_me:$LINENO: executing $PDFLATEX conftest" >&5
sed 's/^/| /' conftest.dir/.acltx/output >&5
echo "$as_me:$LINENO: executing $BIBTEX conftest" >&5
sed 's/^/| /' conftest.dir/.acltx/output2 >&5
m4_ifval([$4],,[rm -rf conftest.dir/.acltx])
])
dnl Copyright (C) 2009-2016 Dynare Team dnl Copyright (C) 2009-2019 Dynare Team
dnl dnl
dnl This file is part of Dynare. dnl This file is part of Dynare.
dnl dnl
...@@ -22,6 +22,21 @@ AC_REQUIRE([AX_MATLAB]) ...@@ -22,6 +22,21 @@ AC_REQUIRE([AX_MATLAB])
AC_MSG_CHECKING([for MATLAB version]) AC_MSG_CHECKING([for MATLAB version])
if test "x$MATLAB_VERSION" != "x"; then if test "x$MATLAB_VERSION" != "x"; then
case $MATLAB_VERSION in case $MATLAB_VERSION in
*2019b | *2019B)
MATLAB_VERSION="9.7"
;;
*2019a | *2019A)
MATLAB_VERSION="9.6"
;;
*2018b | *2018B)
MATLAB_VERSION="9.5"
;;
*2018a | *2018A)
MATLAB_VERSION="9.4"
;;
*2017b | *2017B)
MATLAB_VERSION="9.3"
;;
*2017a | *2017A) *2017a | *2017A)
MATLAB_VERSION="9.2" MATLAB_VERSION="9.2"
;; ;;
......
...@@ -41,13 +41,13 @@ else ...@@ -41,13 +41,13 @@ else
AX_COMPARE_VERSION([$MATLAB_VERSION], [lt], [7.1], [AC_MSG_ERROR([I can't determine the MEX file extension. Please explicitly indicate it to the configure script with the MEXEXT variable.])]) AX_COMPARE_VERSION([$MATLAB_VERSION], [lt], [7.1], [AC_MSG_ERROR([I can't determine the MEX file extension. Please explicitly indicate it to the configure script with the MEXEXT variable.])])
case $build_os in case $build_os in
*cygwin*) *cygwin*)
ax_cv_mexext=`$MATLAB/bin/mexext.bat | sed 's/\r//'` ax_cv_mexext=$("$MATLAB"/bin/mexext.bat | sed 's/\r//')
;; ;;
*mingw*) *mingw*)
ax_cv_mexext=`cd $MATLAB/bin && cmd /c mexext.bat | sed 's/\r//'` ax_cv_mexext=$(cd "$MATLAB"/bin && cmd /c mexext.bat | sed 's/\r//')
;; ;;
*) *)
ax_cv_mexext=`$MATLAB/bin/mexext` ax_cv_mexext=$("$MATLAB"/bin/mexext)
;; ;;
esac esac
fi]) fi])
......
...@@ -58,7 +58,7 @@ function [alphahat,etahat,epsilonhat,ahat,SteadyState,trend_coeff,aK,T,R,P,PK,de ...@@ -58,7 +58,7 @@ function [alphahat,etahat,epsilonhat,ahat,SteadyState,trend_coeff,aK,T,R,P,PK,de
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% None % None
% Copyright (C) 2006-2017 Dynare Team % Copyright (C) 2006-2018 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -104,6 +104,10 @@ oo_.dr.restrict_columns = bayestopt_.smoother_restrict_columns; ...@@ -104,6 +104,10 @@ oo_.dr.restrict_columns = bayestopt_.smoother_restrict_columns;
[T,R,SteadyState,info,M_,options_,oo_] = dynare_resolve(M_,options_,oo_); [T,R,SteadyState,info,M_,options_,oo_] = dynare_resolve(M_,options_,oo_);
if info~=0
print_info(info,options_.noprint, options_);
return
end
oo_.dr.restrict_var_list = oldoo.restrict_var_list; oo_.dr.restrict_var_list = oldoo.restrict_var_list;
oo_.dr.restrict_columns = oldoo.restrict_columns; oo_.dr.restrict_columns = oldoo.restrict_columns;
...@@ -179,7 +183,7 @@ elseif options_.lik_init == 3 % Diffuse Kalman filter ...@@ -179,7 +183,7 @@ elseif options_.lik_init == 3 % Diffuse Kalman filter
Z = [Z, eye(vobs)]; Z = [Z, eye(vobs)];
end end
end end
[Pstar,Pinf] = compute_Pinf_Pstar(mf,T,R,Q,options_.qz_criterium,oo_.dr.restrict_var_list); [Pstar,Pinf] = compute_Pinf_Pstar(mf,T,R,Q,options_.qz_criterium);
elseif options_.lik_init == 4 % Start from the solution of the Riccati equation. elseif options_.lik_init == 4 % Start from the solution of the Riccati equation.
[err, Pstar] = kalman_steady_state(transpose(T),R*Q*transpose(R),transpose(build_selection_matrix(mf,np,vobs)),H); [err, Pstar] = kalman_steady_state(transpose(T),R*Q*transpose(R),transpose(build_selection_matrix(mf,np,vobs)),H);
mexErrCheck('kalman_steady_state',err); mexErrCheck('kalman_steady_state',err);
......
function [xparams, logpost] = GetOneDraw(type) function [xparams, logpost] = GetOneDraw(type,M_,estim_params_,oo_,options_,bayestopt_)
% function [xparams, logpost] = GetOneDraw(type) % function [xparams, logpost] = GetOneDraw(type,M_,estim_params_,oo_,options_,bayestopt_)
% draws one parameter vector and its posterior from MCMC or the prior % draws one parameter vector and its posterior from MCMC or the prior
% %
% INPUTS % INPUTS
% type: [string] 'posterior': draw from MCMC draws % type: [string] 'posterior': draw from MCMC draws
% 'prior': draw from prior % 'prior': draw from prior
% M_ [structure] Definition of the model
% estim_params_ [structure] characterizing parameters to be estimated
% oo_ [structure] Storage of results
% options_ [structure] Options
% bayestopt_ [structure] describing the priors
% %
% OUTPUTS % OUTPUTS
% xparams: vector of estimated parameters (drawn from posterior or prior distribution) % xparams: vector of estimated parameters (drawn from posterior or prior distribution)
...@@ -36,6 +41,6 @@ switch type ...@@ -36,6 +41,6 @@ switch type
case 'prior' case 'prior'
xparams = prior_draw(); xparams = prior_draw();
if nargout>1 if nargout>1
logpost = evaluate_posterior_kernel(xparams'); logpost = evaluate_posterior_kernel(xparams',M_,estim_params_,oo_,options_,bayestopt_);
end end
end end
\ No newline at end of file
...@@ -174,7 +174,7 @@ localVars.type=type; ...@@ -174,7 +174,7 @@ localVars.type=type;
if strcmpi(type,'posterior') if strcmpi(type,'posterior')
while b<B while b<B
b = b + 1; b = b + 1;
x(b,:) = GetOneDraw(type); x(b,:) = GetOneDraw(type,M_,estim_params_,oo_,options_,bayestopt_);
end end
end end
......
...@@ -141,7 +141,7 @@ while fpar<B ...@@ -141,7 +141,7 @@ while fpar<B
irun = irun+1; irun = irun+1;
irun2 = irun2+1; irun2 = irun2+1;
if strcmpi(type,'prior') if strcmpi(type,'prior')
deep = GetOneDraw(type); deep = GetOneDraw(type,M_,estim_params_,oo_,options_,bayestopt_);
else else
deep = x(fpar,:); deep = x(fpar,:);
end end
......
...@@ -51,8 +51,16 @@ else ...@@ -51,8 +51,16 @@ else
addpath(mexpath); addpath(mexpath);
end end
end end
elseif matlab_ver_less_than('9.4')
tmp = [dynareroot '../mex/matlab/win64-7.8-9.3/'];
if exist(tmp, 'dir')
mexpath = tmp;
if modifypath
addpath(mexpath);
end
end
else else
tmp = [dynareroot '../mex/matlab/win64-7.8-9.2/']; tmp = [dynareroot '../mex/matlab/win64-9.4-9.7/'];
if exist(tmp, 'dir') if exist(tmp, 'dir')
mexpath = tmp; mexpath = tmp;
if modifypath if modifypath
......
...@@ -57,17 +57,16 @@ islog = q2a.islog; ...@@ -57,17 +57,16 @@ islog = q2a.islog;
aux = q2a.aux; aux = q2a.aux;
aux0 = aux; aux0 = aux;
cumfix = q2a.cumfix; cumfix = q2a.cumfix;
% usual shock decomp qvintage_ = vintage_;
if isstruct(oo_) tpoints = t0:4:t1;
% z = oo_.shock_decomposition; if ~ismember(vintage_,tpoints) && vintage_
myopts=options_; ind1=min(find(tpoints>vintage_));
myopts.plot_shock_decomp.type='qoq'; ind2=max(find(tpoints<vintage_));
myopts.plot_shock_decomp.realtime=0; vintage_=tpoints(ind1);
[z, junk] = plot_shock_decomposition(M_,oo_,myopts,[]);
else
z = oo_;
end end
z = z(i_var,:,:);
nfrcst = options_.shock_decomp.forecast/4;
%% initialize names
mytype=var_type; mytype=var_type;
if isfield(q2a,'name') if isfield(q2a,'name')
mytxt = q2a.name; mytxt = q2a.name;
...@@ -90,29 +89,6 @@ if isfield(q2a,'name') ...@@ -90,29 +89,6 @@ if isfield(q2a,'name')
end end
mytype=0; mytype=0;
end end
if isstruct(aux)
if ischar(aux.y)
myopts=options_;
myopts.plot_shock_decomp.type='qoq';
myopts.plot_shock_decomp.realtime=0;
[y_aux, steady_state_aux] = plot_shock_decomposition(M_,oo_,myopts,aux.y);
aux.y=y_aux;
aux.yss=steady_state_aux;
end
yaux=aux.y;
end
if mytype==2
gtxt = 'PHI'; % inflation rate
gtex = '\pi';
elseif mytype
gtxt = 'G'; % growth rate
gtex = 'g';
end
steady_state=steady_state(i_var);
% endo_names = M_.endo_names(i_var,:);
% endo_names_tex = M_.endo_names_tex(i_var,:);
nterms = size(z,2);
nfrcst = opts.forecast/4;
for j=1:nvar for j=1:nvar
if j>1 if j>1
...@@ -133,44 +109,47 @@ for j=1:nvar ...@@ -133,44 +109,47 @@ for j=1:nvar
gendo_names_tex = [gtex '(' deblank(endo_names_tex(j,:)) ')']; gendo_names_tex = [gtex '(' deblank(endo_names_tex(j,:)) ')'];
end end
end end
for k =1:nterms
if isstruct(aux)
aux.y = squeeze(yaux(j,k,min((t0-3):-4:1):end));
end
[za(j,k,:), steady_state_a(j,1), gza(j,k,:), steady_state_ga(j,1)] = ...
quarterly2annual(squeeze(z(j,k,min((t0-3):-4:1):end)),steady_state(j),GYTREND0,var_type,islog,aux);
end
ztmp=squeeze(za(j,:,:));
if cumfix==0
zscale = sum(ztmp(1:end-1,:))./ztmp(end,:);
ztmp(1:end-1,:) = ztmp(1:end-1,:)./repmat(zscale,[nterms-1,1]);
else
zres = ztmp(end,:)-sum(ztmp(1:end-1,:));
ztmp(end-1,:) = ztmp(end-1,:) + zres;
end
gztmp=squeeze(gza(j,:,:));
if cumfix==0
gscale = sum(gztmp(1:end-1,:))./ gztmp(end,:);
gztmp(1:end-1,:) = gztmp(1:end-1,:)./repmat(gscale,[nterms-1,1]);
else
gres = gztmp(end,:) - sum(gztmp(1:end-1,:));
gztmp(end-1,:) = gztmp(end-1,:)+gres;
end
za(j,:,:) = ztmp;
gza(j,:,:) = gztmp;
end end
if q2a.plot ==1 if q2a.plot ==1
z=gza;
endo_names = gendo_names; endo_names = gendo_names;
endo_names_tex = gendo_names_tex; endo_names_tex = gendo_names_tex;
elseif q2a.plot == 2 elseif q2a.plot ~= 2
z=za;
else
z=cat(1,za,gza);
endo_names = char(endo_names,gendo_names); endo_names = char(endo_names,gendo_names);
endo_names_tex = char(endo_names_tex,gendo_names_tex); endo_names_tex = char(endo_names_tex,gendo_names_tex);
end end
% end initialize names
steady_state=steady_state(i_var);
if realtime_==0
% usual shock decomp
if isstruct(oo_)
% z = oo_.shock_decomposition;
myopts=options_;
myopts.plot_shock_decomp.type='qoq';
myopts.plot_shock_decomp.realtime=0;
[z, junk] = plot_shock_decomposition(M_,oo_,myopts,[]);
else
z = oo_;
end
z = z(i_var,:,:);
if isstruct(aux)
if ischar(aux.y)
myopts=options_;
myopts.plot_shock_decomp.type='qoq';
myopts.plot_shock_decomp.realtime=0;
[y_aux, steady_state_aux] = plot_shock_decomposition(M_,oo_,myopts,aux.y);
aux.y=y_aux;
aux.yss=steady_state_aux;
end
end
% endo_names = M_.endo_names(i_var,:);
% endo_names_tex = M_.endo_names_tex(i_var,:);
% make annualized shock decomp
[z, steady_state_a, steady_state_ga] = annualiz(z,t0,q2a,aux,steady_state);
end
% if isstruct(oo_) % if isstruct(oo_)
% oo_.annualized_shock_decomposition=z; % oo_.annualized_shock_decomposition=z;
% end % end
...@@ -180,85 +159,55 @@ if realtime_ && isstruct(oo_) && isfield(oo_, 'realtime_shock_decomposition') ...@@ -180,85 +159,55 @@ if realtime_ && isstruct(oo_) && isfield(oo_, 'realtime_shock_decomposition')
init=1; init=1;
for i=t0:4:t1 for i=t0:4:t1
yr=floor(i/4); yr=floor(i/4);
za=[];
gza=[];
myopts=options_; myopts=options_;
myopts.plot_shock_decomp.type='qoq'; myopts.plot_shock_decomp.type='qoq';
myopts.plot_shock_decomp.realtime=1; myopts.plot_shock_decomp.realtime=1;
myopts.plot_shock_decomp.vintage=i; myopts.plot_shock_decomp.vintage=i;
[z, steady_state_aux] = plot_shock_decomposition(M_,oo_,myopts,[]);
% retrieve quarterly shock decomp
z = plot_shock_decomposition(M_,oo_,myopts,[]);
zdim = size(z);
z = z(i_var,:,:); z = z(i_var,:,:);
if isstruct(aux) if isstruct(aux)
if ischar(aux0.y) if ischar(aux0.y)
% retrieve quarterly shock decomp for aux variable
[y_aux, steady_state_aux] = plot_shock_decomposition(M_,oo_,myopts,aux0.y); [y_aux, steady_state_aux] = plot_shock_decomposition(M_,oo_,myopts,aux0.y);
aux.y=y_aux; aux.y=y_aux;
aux.yss=steady_state_aux; aux.yss=steady_state_aux;
end end
yaux=aux.y;
end end
nterms = size(z,2);
% z = oo_.realtime_shock_decomposition.(['time_' int2str(i)]); % make annualized shock decomp
% z = z(i_var,:,:); [z, steady_state_a, steady_state_ga] = annualiz(z,t0,q2a,aux,steady_state);
for j=1:nvar
for k =nterms:-1:1
% if k<nterms
% ztmp = squeeze(sum(z(j,[1:k-1,k+1:end-1],t0-4:end)));
% else
ztmp = squeeze(z(j,k,min((t0-3):-4:1):end));
% end
if isstruct(aux)
aux.y = squeeze(yaux(j,k,min((t0-3):-4:1):end));
end
[za(j,k,:), steady_state_a(j,1), gza(j,k,:), steady_state_ga(j,1)] = ...
quarterly2annual(ztmp,steady_state(j),GYTREND0,var_type,islog,aux);
% if k<nterms
% za(j,k,:) = za(j,end,:) - za(j,k,:);
% gza(j,k,:) = gza(j,end,:) - gza(j,k,:);
% end
end
ztmp=squeeze(za(j,:,:)); if init==1
oo_.annualized_realtime_shock_decomposition.pool = z;
if cumfix==0
zscale = sum(ztmp(1:end-1,:))./ztmp(end,:);
ztmp(1:end-1,:) = ztmp(1:end-1,:)./repmat(zscale,[nterms-1,1]);
else else
zres = ztmp(end,:)-sum(ztmp(1:end-1,:)); oo_.annualized_realtime_shock_decomposition.pool(:,:,yr) = z(:,:,end-nfrcst);
ztmp(end-1,:) = ztmp(end-1,:) + zres;
end end
oo_.annualized_realtime_shock_decomposition.(['yr_' int2str(yr)]) = z;
gztmp=squeeze(gza(j,:,:)); if options_.shock_decomp.forecast
if cumfix==0 if qvintage_>i-4 && qvintage_<i
gscale = sum(gztmp(1:end-1,:))./ gztmp(end,:); myopts.plot_shock_decomp.vintage=qvintage_;
gztmp(1:end-1,:) = gztmp(1:end-1,:)./repmat(gscale,[nterms-1,1]); % retrieve quarterly shock decomp
else z = plot_shock_decomposition(M_,oo_,myopts,[]);
gres = gztmp(end,:) - sum(gztmp(1:end-1,:)); z(:,:,end+1:zdim(3))=nan; % fill with nan's remaining time points to reach Q4
gztmp(end-1,:) = gztmp(end-1,:)+gres; z = z(i_var,:,:);
if isstruct(aux)
if ischar(aux0.y)
% retrieve quarterly shock decomp for aux variable
[y_aux, steady_state_aux] = plot_shock_decomposition(M_,oo_,myopts,aux0.y);
aux.y=y_aux;
aux.yss=steady_state_aux;
end end
za(j,:,:) = ztmp;
gza(j,:,:) = gztmp;
end end
if q2a.plot ==1 % make annualized shock decomp
z=gza; z = annualiz(z,t0,q2a,aux,steady_state);
elseif q2a.plot == 2
z=za;
else
z=cat(1,za,gza);
end
if init==1
oo_.annualized_realtime_shock_decomposition.pool = z;
else
oo_.annualized_realtime_shock_decomposition.pool(:,:,yr) = z(:,:,end-nfrcst);
end end
oo_.annualized_realtime_shock_decomposition.(['yr_' int2str(yr)]) = z;
if opts.forecast
oo_.annualized_realtime_forecast_shock_decomposition.(['yr_' int2str(yr)]) = z(:,:,end-nfrcst:end); oo_.annualized_realtime_forecast_shock_decomposition.(['yr_' int2str(yr)]) = z(:,:,end-nfrcst:end);
if init>nfrcst if init>nfrcst
oo_.annualized_realtime_conditional_shock_decomposition.(['yr_' int2str(yr-nfrcst)]) = ... oo_.annualized_realtime_conditional_shock_decomposition.(['yr_' int2str(yr-nfrcst)]) = ...
...@@ -277,6 +226,7 @@ if realtime_ && isstruct(oo_) && isfield(oo_, 'realtime_shock_decomposition') ...@@ -277,6 +226,7 @@ if realtime_ && isstruct(oo_) && isfield(oo_, 'realtime_shock_decomposition')
oo_.annualized_realtime_shock_decomposition.pool(:,:,yr-my_forecast_:yr) - ... oo_.annualized_realtime_shock_decomposition.pool(:,:,yr-my_forecast_:yr) - ...
oo_.annualized_realtime_forecast_shock_decomposition.(['yr_' int2str(yr-my_forecast_)])(:,:,1:my_forecast_+1); oo_.annualized_realtime_forecast_shock_decomposition.(['yr_' int2str(yr-my_forecast_)])(:,:,1:my_forecast_+1);
oo_.annualized_realtime_conditional_shock_decomposition.(['yr_' int2str(yr-my_forecast_)])(:,end-1,:) = ... oo_.annualized_realtime_conditional_shock_decomposition.(['yr_' int2str(yr-my_forecast_)])(:,end-1,:) = ...
oo_.annualized_realtime_conditional_shock_decomposition.(['yr_' int2str(yr-my_forecast_)])(:,end-1,:) + ...
oo_.annualized_realtime_forecast_shock_decomposition.(['yr_' int2str(yr-my_forecast_)])(:,end,1:my_forecast_+1); oo_.annualized_realtime_forecast_shock_decomposition.(['yr_' int2str(yr-my_forecast_)])(:,end,1:my_forecast_+1);
oo_.annualized_realtime_conditional_shock_decomposition.(['yr_' int2str(yr-my_forecast_)])(:,end,:) = ... oo_.annualized_realtime_conditional_shock_decomposition.(['yr_' int2str(yr-my_forecast_)])(:,end,:) = ...
oo_.annualized_realtime_shock_decomposition.pool(:,end,yr-my_forecast_:yr); oo_.annualized_realtime_shock_decomposition.pool(:,end,yr-my_forecast_:yr);
...@@ -331,3 +281,53 @@ else ...@@ -331,3 +281,53 @@ else
steady_state = steady_state_a; steady_state = steady_state_a;
end end
end end
return
function [z, steady_state_a, steady_state_ga] = annualiz(z,t0,q2a,aux,steady_state)
GYTREND0 = q2a.GYTREND0;
var_type = q2a.type;
islog = q2a.islog;
cumfix = q2a.cumfix;
if isstruct(aux)
yaux=aux.y;
end
[nvar , nterms, junk] = size(z);
for j=1:nvar
for k =1:nterms
ztmp = squeeze(z(j,k,min((t0-3):-4:1):end));
if isstruct(aux)
aux.y = squeeze(yaux(j,k,min((t0-3):-4:1):end));
end
[za(j,k,:), steady_state_a(j,1), gza(j,k,:), steady_state_ga(j,1)] = ...
quarterly2annual(ztmp,steady_state(j),GYTREND0,var_type,islog,aux);
end
ztmp=squeeze(za(j,:,:));
if cumfix==0
zscale = sum(ztmp(1:end-1,:))./ztmp(end,:);
ztmp(1:end-1,:) = ztmp(1:end-1,:)./repmat(zscale,[nterms-1,1]);
else
zres = ztmp(end,:)-sum(ztmp(1:end-1,:));
ztmp(1:end-1,:) = ztmp(1:end-1,:) + repmat(zres,[nterms-1 1])/(nterms-1);
end
gztmp=squeeze(gza(j,:,:));
if cumfix==0
gscale = sum(gztmp(1:end-1,:))./ gztmp(end,:);
gztmp(1:end-1,:) = gztmp(1:end-1,:)./repmat(gscale,[nterms-1,1]);
else
gres = gztmp(end,:) - sum(gztmp(1:end-1,:));
gztmp(1:end-1,:) = gztmp(1:end-1,:) + repmat(gres,[nterms-1 1])/(nterms-1);
end
za(j,:,:) = ztmp;
gza(j,:,:) = gztmp;
end
if q2a.plot ==1
z=gza;
elseif q2a.plot == 2
z=za;
else
z=cat(1,za,gza);
end
...@@ -3,7 +3,7 @@ function varargout = prior(varargin) ...@@ -3,7 +3,7 @@ function varargout = prior(varargin)
% Computes various prior statistics and display them in the command window. % Computes various prior statistics and display them in the command window.
% %
% INPUTS % INPUTS
% 'table', 'moments', 'optimize', 'simulate', 'plot' % 'table', 'moments', 'optimize', 'simulate', 'plot', 'moments(distribution)'
% %
% OUTPUTS % OUTPUTS
% none % none
...@@ -11,7 +11,7 @@ function varargout = prior(varargin) ...@@ -11,7 +11,7 @@ function varargout = prior(varargin)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2015-2017 Dynare Team % Copyright (C) 2015-2018 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -103,6 +103,9 @@ if ismember('simulate', varargin) % Prior simulations (BK). ...@@ -103,6 +103,9 @@ if ismember('simulate', varargin) % Prior simulations (BK).
disp(['mjdgges crash share = ' num2str(results.dll.problem_share)]) disp(['mjdgges crash share = ' num2str(results.dll.problem_share)])
disp(['Steady state problem share = ' num2str(results.ss.problem_share)]) disp(['Steady state problem share = ' num2str(results.ss.problem_share)])
disp(['Complex steady state share = ' num2str(results.ss.complex_share)]) disp(['Complex steady state share = ' num2str(results.ss.complex_share)])
if options_.loglinear
disp(['Nonpositive steady state share = ' num2str(results.ss.nonpositive_share)])
end
disp(['Analytical steady state problem share = ' num2str(results.ass.problem_share)]) disp(['Analytical steady state problem share = ' num2str(results.ass.problem_share)])
skipline(2) skipline(2)
donesomething = true; donesomething = true;
...@@ -158,6 +161,7 @@ if ismember('moments(distribution)', varargin) % Prior simulations (BK). ...@@ -158,6 +161,7 @@ if ismember('moments(distribution)', varargin) % Prior simulations (BK).
dr = tmp.pdraws{j,3}; dr = tmp.pdraws{j,3};
oo__ = oo_; oo__ = oo_;
oo__.dr = dr; oo__.dr = dr;
Model=set_parameters_locally(Model,tmp.pdraws{j,1});% Needed to update the covariance matrix of the state innovations.
oo__ = disp_th_moments(oo__.dr, [], Model, options_, oo__); oo__ = disp_th_moments(oo__.dr, [], Model, options_, oo__);
FirstOrderMoments(:,iter) = oo__.mean; FirstOrderMoments(:,iter) = oo__.mean;
SecondOrderMoments(:,:,iter) = oo__.var; SecondOrderMoments(:,:,iter) = oo__.var;
......
...@@ -30,7 +30,7 @@ function [Pstar,Pinf] = compute_Pinf_Pstar(mf,T,R,Q,qz_criterium, restrict_colum ...@@ -30,7 +30,7 @@ function [Pstar,Pinf] = compute_Pinf_Pstar(mf,T,R,Q,qz_criterium, restrict_colum
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% None % None
% Copyright (C) 2006-2017 Dynare Team % Copyright (C) 2006-2018 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -48,8 +48,22 @@ function [Pstar,Pinf] = compute_Pinf_Pstar(mf,T,R,Q,qz_criterium, restrict_colum ...@@ -48,8 +48,22 @@ function [Pstar,Pinf] = compute_Pinf_Pstar(mf,T,R,Q,qz_criterium, restrict_colum
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
np = size(T,1); np = size(T,1);
if nargin == 6
indx = restrict_columns;
indx0=find(~ismember([1:np],indx));
else
indx=(find(max(abs(T))>=1.e-10));
indx0=(find(max(abs(T))<1.e-10));
end
np0=length(indx0);
Tbkp = T;
T0=T(indx0,indx); % static variables vs. dynamic ones
R0=R(indx0,:); % matrix of shocks for static variables
% perform Kitagawa transformation % Perform Kitagawa transformation only for non-zero columns of T
T=T(indx,indx);
R=R(indx,:);
np = size(T,1);
[QT,ST] = schur(T); [QT,ST] = schur(T);
e1 = abs(ordeig(ST)) > 2-qz_criterium; e1 = abs(ordeig(ST)) > 2-qz_criterium;
[QT,ST] = ordschur(QT,ST,e1); [QT,ST] = ordschur(QT,ST,e1);
...@@ -59,7 +73,6 @@ nk1 = nk+1; ...@@ -59,7 +73,6 @@ nk1 = nk+1;
Pstar = zeros(np,np); Pstar = zeros(np,np);
R1 = QT'*R; R1 = QT'*R;
B = R1*Q*R1'; B = R1*Q*R1';
% computes variance of stationary block (lower right)
i = np; i = np;
while i >= nk+2 while i >= nk+2
if ST(i,i-1) == 0 if ST(i,i-1) == 0
...@@ -100,13 +113,64 @@ if i == nk+1 ...@@ -100,13 +113,64 @@ if i == nk+1
Pstar(nk1,nk1)=(B(nk1,nk1)+c)/(1-ST(nk1,nk1)*ST(nk1,nk1)); Pstar(nk1,nk1)=(B(nk1,nk1)+c)/(1-ST(nk1,nk1)*ST(nk1,nk1));
end end
if np0
ST1=ST;
% Now I recover stationarized static variables using
% ss = s-A*z
% and
% z-z(-1) (growth rates of unit roots) only depends on stationary variables
Pstar = blkdiag(zeros(np0),Pstar);
ST = [zeros(length(Pstar),length(indx0)) [T0*QT ;ST]];
R1 = [R0; R1];
% Build the matrix for stationarized variables
STinf = ST(np0+1:np0+nk,np0+1:np0+nk);
iSTinf = inv(STinf);
ST0=ST;
ST0(:,1:np0+nk)=0; % stationarized static + 1st difference only respond to lagged stationary states
ST00 = ST(1:np0,np0+1:np0+nk);
% A\B is the matrix division of A into B, which is roughly the
% same as INV(A)*B
ST0(1:np0,np0+nk+1:end) = ST(1:np0,np0+nk+1:end)-ST00*(iSTinf*ST(np0+1:np0+nk,np0+nk+1:end)); % snip non-stationary part
R10 = R1;
R10(1:np0,:) = R1(1:np0,:)-ST00*(iSTinf*R1(np0+1:np0+nk,:)); % snip non-stationary part
% Kill non-stationary part before projecting Pstar
ST0(np0+1:np0+nk,:)=0;
R10(np0+1:np0+nk,:)=0; % is this questionable???? IT HAS TO in order to match Michel's version!!!
% project Pstar onto static x
Pstar = ST0*Pstar*ST0'+R10*Q*R10';
% QT(1:np0,np0+1:np0+nk) = QT(1:np0,np0+1:np0+nk)+ST(1:np0,np0+1:np0+nk); %%% is this questionable ????
% reorder QT entries
else
STinf = ST(np0+1:np0+nk,np0+1:np0+nk);
end
% stochastic trends with no influence on observed variables are % stochastic trends with no influence on observed variables are
% arbitrarily initialized to zero % arbitrarily initialized to zero
Pinf = zeros(np,np); Pinf = zeros(np,np);
Pinf(1:nk,1:nk) = eye(nk); Pinf(1:nk,1:nk) = eye(nk);
if np0
STtriu = STinf-eye(nk);
% A\B is the matrix division of A into B, which is roughly the
% same as INV(A)*B
STinf0 = ST00*(eye(nk)-iSTinf*STtriu);
Pinf = blkdiag(zeros(np0),Pinf);
QT = blkdiag(eye(np0),QT);
QTinf = QT;
QTinf(1:np0,np0+1:np0+nk) = STinf0;
QTinf([indx0(:); indx(:)],:) = QTinf;
STinf1 = [zeros(np0+np,np0) [STinf0; eye(nk); zeros(np-nk,nk)] zeros(np0+np,np-nk)];
for k = 1:nk
if norm(QTinf(mf,:)*ST([indx0(:); indx(:)],k+np0)) < 1e-8
Pinf(k+np0,k+np0) = 0;
end
end
Pinf = STinf1*Pinf*STinf1';
QT([indx0(:); indx(:)],:) = QT;
else
for k = 1:nk for k = 1:nk
if norm(QT(mf,:)*ST(:,k)) < 1e-8 if norm(QT(mf,:)*ST(:,k)) < 1e-8
Pinf(k,k) = 0; Pinf(k+np0,k+np0) = 0;
end
end end
end end
......
...@@ -67,6 +67,9 @@ if options_.steadystate_flag ...@@ -67,6 +67,9 @@ if options_.steadystate_flag
options_,0); options_,0);
end end
[U,Uy,W] = feval([M_.fname,'_objective_static'],zeros(endo_nbr,1),[], M_.params); [U,Uy,W] = feval([M_.fname,'_objective_static'],zeros(endo_nbr,1),[], M_.params);
if any(any(isnan(Uy)))
error(['discretionary_policy: the derivatives of the objective function contain NaN'])
end
if any(any(Uy~=0)) if any(any(Uy~=0))
error(['discretionary_policy: the objective function must have zero ' ... error(['discretionary_policy: the objective function must have zero ' ...
'first order derivatives']) 'first order derivatives'])
...@@ -98,7 +101,9 @@ instr_nbr=endo_nbr-eq_nbr; ...@@ -98,7 +101,9 @@ instr_nbr=endo_nbr-eq_nbr;
if instr_nbr==0 if instr_nbr==0
error('discretionary_policy:: There are no available instruments, because the model has as many equations as variables.') error('discretionary_policy:: There are no available instruments, because the model has as many equations as variables.')
end end
if size(Instruments,1)~= instr_nbr if size(Instruments,1)< instr_nbr
error('discretionary_policy:: There are fewer declared instruments than omitted equations.')
elseif size(Instruments,1)> instr_nbr
error('discretionary_policy:: There are more declared instruments than omitted equations.') error('discretionary_policy:: There are more declared instruments than omitted equations.')
end end
......
...@@ -48,7 +48,7 @@ function [H,G,retcode]=discretionary_policy_engine(AAlag,AA0,AAlead,BB,bigw,inst ...@@ -48,7 +48,7 @@ function [H,G,retcode]=discretionary_policy_engine(AAlag,AA0,AAlead,BB,bigw,inst
% Dennis, Richard (2007): Optimal policy in rational expectations models: new solution algorithms, % Dennis, Richard (2007): Optimal policy in rational expectations models: new solution algorithms,
% Macroeconomic Dynamics, 11, 31–55. % Macroeconomic Dynamics, 11, 31–55.
% Copyright (C) 2007-2017 Dynare Team % Copyright (C) 2007-2018 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -112,9 +112,9 @@ F1=F10; ...@@ -112,9 +112,9 @@ F1=F10;
while 1 while 1
iter=iter+1; iter=iter+1;
P=SylvesterDoubling(W+beta*F1'*Q*F1,beta*H1',H1,discretion_tol,solve_maxit); P=SylvesterDoubling(W+beta*F1'*Q*F1,beta*H1',H1,discretion_tol,solve_maxit);
if any(any(isnan(P))) if any(any(isnan(P))) || any(any(isinf(P)))
P=SylvesterHessenbergSchur(W+beta*F1'*Q*F1,beta*H1',H1); P=SylvesterHessenbergSchur(W+beta*F1'*Q*F1,beta*H1',H1);
if any(any(isnan(P))) if any(any(isnan(P))) || any(any(isinf(P)))
retcode=2; retcode=2;
return return
end end
......
...@@ -27,6 +27,11 @@ function disp_dr(dr,order,var_list) ...@@ -27,6 +27,11 @@ function disp_dr(dr,order,var_list)
global M_ options_ global M_ options_
if M_.hessian_eq_zero && order~=1
order = 1;
warning('disp_dr: using order = 1 because Hessian is equal to zero');
end
nx =size(dr.ghx,2); nx =size(dr.ghx,2);
nu =size(dr.ghu,2); nu =size(dr.ghu,2);
if options_.block if options_.block
......
...@@ -84,7 +84,11 @@ end ...@@ -84,7 +84,11 @@ end
disp([' ']), disp([' ']),
if any(idemodel.ino)
no_warning_message_display=1;
if any(idemodel.ino) || any(any(idemodel.ind0==0)) || any(any(idemodel.jweak_pair))
no_warning_message_display=0;
disp('WARNING !!!') disp('WARNING !!!')
if SampleSize>1 if SampleSize>1
disp(['The rank of H (model) is deficient for ', num2str(length(find(idemodel.ino))),' out of ',int2str(SampleSize),' MC runs!' ]), disp(['The rank of H (model) is deficient for ', num2str(length(find(idemodel.ino))),' out of ',int2str(SampleSize),' MC runs!' ]),
...@@ -152,12 +156,15 @@ if any(idemodel.ino) ...@@ -152,12 +156,15 @@ if any(idemodel.ino)
% end % end
end end
if ~any(idemodel.ino) && ~any(any(idemodel.ind0==0)) if no_warning_message_display
disp(['All parameters are identified in the model (rank of H).' ]), disp(['All parameters are identified in the model (rank of H).' ]),
skipline() skipline()
end end
if any(idemoments.ino) no_warning_message_display = 1;
if any(idemoments.ino) || any(any(idemoments.ind0==0)) || any(any(idemoments.jweak_pair))
no_warning_message_display = 0;
skipline() skipline()
disp('WARNING !!!') disp('WARNING !!!')
if SampleSize > 1 if SampleSize > 1
...@@ -234,7 +241,7 @@ if any(idemoments.ino) ...@@ -234,7 +241,7 @@ if any(idemoments.ino)
% end % end
% end % end
end end
if ~any(idemoments.ino) && ~any(any(idemoments.ind0==0)) if no_warning_message_display
skipline() skipline()
disp(['All parameters are identified by J moments (rank of J)' ]), disp(['All parameters are identified by J moments (rank of J)' ]),
skipline() skipline()
......