Compare commits
16 Commits
e918589e02
...
7bf0395a27
Author | SHA1 | Date |
---|---|---|
Sébastien Villemot | 7bf0395a27 | |
Willi Mutschler | ee2545f84d | |
Sébastien Villemot | dd1669082e | |
Johannes Pfeifer | 9c28f5feaf | |
Sébastien Villemot | 31ce155852 | |
Sébastien Villemot | c36b695cd9 | |
Sébastien Villemot | 6cad684980 | |
Marco Ratto | a4e6531420 | |
Sébastien Villemot | d09a206c7c | |
Marco Ratto | fbf62255c6 | |
Sébastien Villemot | 368c93214e | |
Johannes Pfeifer | 8deeaa7252 | |
Johannes Pfeifer | e3e6f4c9b4 | |
Sébastien Villemot | 5216cec249 | |
Sébastien Villemot | cae5a00e80 | |
Sébastien Villemot | 42e2f77e4a |
|
@ -11,12 +11,12 @@ variables:
|
|||
# - if VERSION was already set (when manually running a pipeline), use it
|
||||
# - if we are in the official Dynare repository:
|
||||
# + if on a tag: use the tag
|
||||
# + if on master: use 6-unstable-$TIMESTAMP-$COMMIT
|
||||
# + if on master: use 7-unstable-$TIMESTAMP-$COMMIT
|
||||
# + on another branch: use $BRANCH-$TIMESTAMP-$COMMIT
|
||||
# - if in a personal repository: use $USER-$TIMESTAMP-$COMMIT
|
||||
before_script:
|
||||
- 'if [[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && [[ -n $CI_COMMIT_TAG ]]; then export VERSION=$CI_COMMIT_TAG; fi'
|
||||
- 'if [[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && [[ $CI_COMMIT_REF_NAME == master ]]; then export VERSION=6-unstable-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA; fi'
|
||||
- 'if [[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && [[ $CI_COMMIT_REF_NAME == master ]]; then export VERSION=7-unstable-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA; fi'
|
||||
- 'if [[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]]; then export VERSION=$CI_COMMIT_REF_NAME-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA; fi'
|
||||
- 'if [[ -z $VERSION ]]; then export VERSION=$CI_PROJECT_NAMESPACE-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA; fi'
|
||||
|
||||
|
|
|
@ -108,8 +108,9 @@ for jexo = unique_shock_entries' % loop over cell with shock names
|
|||
% Adding a legend at the bottom
|
||||
axes('Position',[0, 0, 1, 1],'Visible','off');
|
||||
lgd = legend([plt_data,plt_model],{'Data', 'Model'}, 'Location', 'southeast','NumColumns',2,'FontSize',14);
|
||||
lgd.Position = [0.37 0.01 lgd.Position(3) lgd.Position(4)];
|
||||
|
||||
if ~isoctave
|
||||
lgd.Position = [0.37 0.01 lgd.Position(3) lgd.Position(4)];
|
||||
end
|
||||
dyn_saveas(fig_irf,[graph_directory_name filesep fname '_matched_irf_' jexo{:} int2str(fig)],nodisplay,graph_format);
|
||||
if TeX && any(strcmp('eps',cellstr(graph_format)))
|
||||
fprintf(fid_TeX,'\\begin{figure}[H]\n');
|
||||
|
|
|
@ -44,6 +44,7 @@ end
|
|||
if ismember(flag,{'filter','all'})
|
||||
options_occbin_.filter.state_covariance = false;
|
||||
options_occbin_.filter.guess_regime = false;
|
||||
options_occbin_.filter.periodic_solution = true;
|
||||
options_occbin_.filter.use_relaxation = false;
|
||||
end
|
||||
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
function y0 = get_mean(varargin)
|
||||
% function x = get_mean(vname1, vname2, <order>)
|
||||
% returns the steady-state of a variable identified by its name
|
||||
% function y0 = get_mean(varargin)
|
||||
% returns the mean of a variable identified by its name
|
||||
%
|
||||
% INPUTS:
|
||||
% vname1, vname2, ... : list of variable names
|
||||
% order: if integer 1 or 2, optionally last input can trigger the order
|
||||
% at which steady state is computed
|
||||
% vargargin inputs containing
|
||||
% - vname1, vname2, ... : list of variable names
|
||||
% - order: if integer 1 or 2, optionally last input can trigger the order
|
||||
% at which steady state is computed
|
||||
%
|
||||
% OUTPUTS
|
||||
% x: steady state values
|
||||
% y0: mean values
|
||||
%
|
||||
% SPECIAL REQUIREMENTS
|
||||
% none
|
||||
|
@ -30,27 +31,6 @@ function y0 = get_mean(varargin)
|
|||
% You should have received a copy of the GNU General Public License
|
||||
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
global M_ oo_ options_
|
||||
global M_ options_ oo_
|
||||
|
||||
if ~isempty(regexp(varargin{end},'\d','ONCE')) && isempty(regexp(varargin{end},'\D','ONCE'))
|
||||
order=eval(varargin{end});
|
||||
else
|
||||
order=1;
|
||||
end
|
||||
if order==1
|
||||
ys_ = oo_.steady_state;
|
||||
ys_ = evaluate_steady_state(ys_,[oo_.exo_steady_state; oo_.exo_det_steady_state],M_,options_,true);
|
||||
elseif order==2
|
||||
ys_ = oo_.dr.ys;
|
||||
ys_(oo_.dr.order_var)=ys_(oo_.dr.order_var)+oo_.dr.ghs2./2;
|
||||
else
|
||||
return
|
||||
end
|
||||
lgy_ = M_.endo_names;
|
||||
|
||||
mfys=nan(length(varargin),1);
|
||||
for j=1:length(varargin)
|
||||
mfys(j) = find(strcmp(varargin{j},lgy_));
|
||||
end
|
||||
|
||||
y0 = ys_(mfys);
|
||||
y0=get_mean_no_globals(M_, oo_, options_, varargin{:});
|
|
@ -0,0 +1,76 @@
|
|||
function y0 = get_mean_no_globals(M_, oo_, options_, varargin)
|
||||
% function y0 = get_mean_no_globals(M_, oo_, options_, varargin)
|
||||
% returns the mean of a variable identified by its name
|
||||
%
|
||||
% INPUTS:
|
||||
% M_ [structure] describing the model
|
||||
% oo_ [structure] storing the results
|
||||
% options_ [structure] describing the options
|
||||
% vargargin inputs containing
|
||||
% - vname1, vname2, ... : list of variable names
|
||||
% - order: if integer 1 or 2, optionally last input can trigger the order
|
||||
% at which steady state is computed
|
||||
%
|
||||
% OUTPUTS
|
||||
% y0: mean values
|
||||
%
|
||||
% SPECIAL REQUIREMENTS
|
||||
% none
|
||||
|
||||
% Copyright © 2019-2023 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
% Dynare 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 3 of the License, or
|
||||
% (at your option) any later version.
|
||||
%
|
||||
% Dynare 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 Dynare. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
if ~isempty(regexp(varargin{end},'\d','ONCE')) && isempty(regexp(varargin{end},'\D','ONCE'))
|
||||
order=eval(varargin{end});
|
||||
nvars=length(varargin)-1;
|
||||
else
|
||||
order=1;
|
||||
nvars=length(varargin);
|
||||
end
|
||||
if order==1
|
||||
if isfield(oo_,'dr') && isfield(oo_.dr,'ys')
|
||||
ys_=oo_.dr.ys;
|
||||
else
|
||||
ys_ = oo_.steady_state;
|
||||
ys_ = evaluate_steady_state(ys_,[oo_.exo_steady_state; oo_.exo_det_steady_state],M_,options_,true);
|
||||
end
|
||||
elseif order==2
|
||||
if isfield(oo_,'dr') && isfield(oo_.dr,'ys')
|
||||
ys_=oo_.dr.ys;
|
||||
if ~isfield(oo_.dr,'ghs2')
|
||||
error('get_mean: ghs2 needs to be present in oo_ to compute mean at order=2')
|
||||
else
|
||||
ys_(oo_.dr.order_var)=ys_(oo_.dr.order_var)+oo_.dr.ghs2./2;
|
||||
end
|
||||
else
|
||||
error('get_mean: decision rules need to be present in oo_ to compute mean')
|
||||
end
|
||||
else
|
||||
error('get_mean: order>2 not implemented')
|
||||
end
|
||||
|
||||
mfys=NaN(nvars,1);
|
||||
for j=1:nvars
|
||||
endo_index=find(strcmp(varargin{j},M_.endo_names));
|
||||
if isempty(endo_index)
|
||||
error('get_mean: unknown variables %s requested',varargin{j})
|
||||
else
|
||||
mfys(j) = find(strcmp(varargin{j},M_.endo_names));
|
||||
end
|
||||
end
|
||||
|
||||
y0 = ys_(mfys);
|
|
@ -249,6 +249,15 @@ end
|
|||
|
||||
|
||||
if ~isempty(init2shocks) && ~expand
|
||||
if not(isfield(oo_,'initval_decomposition'))
|
||||
disp('computing initval shock decomposition ...')
|
||||
bayestopt_ = evalin('base','bayestopt_');
|
||||
estim_params_ = evalin('base','estim_params_');
|
||||
M_= evalin('base','M_');
|
||||
options_ = set_default_initial_condition_decomposition_options(options_);
|
||||
oo_ = initial_condition_decomposition(M_,oo_,options_,0,bayestopt_,estim_params_);
|
||||
out = oo_;
|
||||
end
|
||||
n=size(init2shocks,1);
|
||||
M_.exo_names_init=M_.exo_names;
|
||||
for i=1:n
|
||||
|
@ -347,7 +356,7 @@ if options_.plot_shock_decomp.use_shock_groups
|
|||
else
|
||||
% here we know we only have one variable to handle
|
||||
if isstruct(q2a.aux) && ischar(q2a.aux.y)
|
||||
steady_state_aux = get_mean(q2a.aux.y);
|
||||
steady_state_aux = get_mean_no_globals(M_, oo_, options_, q2a.aux.y);
|
||||
q2a.aux.y=repmat(steady_state_aux,16,1);
|
||||
q2a.aux.yss=steady_state_aux;
|
||||
end
|
||||
|
|
24
meson.build
24
meson.build
|
@ -1,14 +1,6 @@
|
|||
# TODO:
|
||||
# - find a way to set GSL_BLAS_LIB to an empty value when querying pkg-config
|
||||
# for gsl; otherwise there is a risk of overriding OpenBLAS/MKL (though
|
||||
# probably not in our current setup); the pkgconfig_define option of
|
||||
# dep.get_variable() is unfortunately not helpful
|
||||
# Close to https://github.com/mesonbuild/meson/issues/3606
|
||||
# - See what to do with xvfb-run (see #1892). Maybe try to detect it from meson.build, and pass it optionally to the test driver script
|
||||
|
||||
project('dynare',
|
||||
'cpp', 'fortran', 'c',
|
||||
version : '6-unstable',
|
||||
version : '7-unstable',
|
||||
# NB: update C++ standard in .clang-format whenever the following is modified
|
||||
default_options : [ 'cpp_std=gnu++20', 'fortran_std=f2018',
|
||||
'c_std=gnu17', 'warning_level=2' ],
|
||||
|
@ -75,6 +67,12 @@ else
|
|||
endif
|
||||
|
||||
openmp_dep = dependency('openmp')
|
||||
|
||||
# TODO: find a way to set GSL_BLAS_LIB to an empty value; otherwise there is a
|
||||
# risk of overriding OpenBLAS/MKL (though probably not in our current setup);
|
||||
# the pkgconfig_define option of dep.get_variable() is unfortunately not
|
||||
# helpful, since that latter method cannot query the “libs”. Reported as:
|
||||
# https://github.com/mesonbuild/meson/issues/12649
|
||||
gsl_dep = dependency('gsl')
|
||||
|
||||
if get_option('build_for') == 'octave'
|
||||
|
@ -1836,9 +1834,15 @@ mod_and_m_tests = [
|
|||
|
||||
base_test_driver_args = [ get_option('build_for') ]
|
||||
if get_option('build_for') == 'matlab'
|
||||
base_test_driver_args += [ matlab_exe.full_path(), matlab_version, matlab_arch ]
|
||||
base_test_driver_args += [ matlab_exe.full_path(), matlab_version, matlab_arch, '' ]
|
||||
else
|
||||
base_test_driver_args += [ octave_exe.full_path(), octave_version, '' ]
|
||||
xvfb_run_exe = find_program('xvfb-run', required : false) # Debian-specific utility
|
||||
if xvfb_run_exe.found()
|
||||
base_test_driver_args += xvfb_run_exe.full_path()
|
||||
else
|
||||
base_test_driver_args += ''
|
||||
endif
|
||||
endif
|
||||
base_test_driver_args += [ meson.current_source_dir(), meson.current_build_dir() ]
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 520876560d5bb4c886a11de681557dd05cbc200e
|
||||
Subproject commit e32025a76fb156a9af8101f9f43faf7eaa2f72ef
|
|
@ -88,7 +88,7 @@
|
|||
'("stderr" "values" "periods" "scales" "restriction" "exclusion"
|
||||
"upper_cholesky" "lower_cholesky" "equation" "bind" "relax" "error_bind"
|
||||
"error_relax" "add" "multiply" "target" "auxname_target_nonstationary"
|
||||
"component" "growth" "auxname" "kind")
|
||||
"component" "growth" "auxname" "kind" "weights")
|
||||
"Dynare statements-like keywords.")
|
||||
|
||||
;; Those keywords that makes the lexer enter the DYNARE_BLOCK start condition
|
||||
|
@ -105,7 +105,8 @@
|
|||
"deterministic_trends" "optim_weights" "homotopy_setup"
|
||||
"conditional_forecast_paths" "svar_identification" "moment_calibration"
|
||||
"irf_calibration" "ramsey_constraints" "generate_irfs" "matched_moments"
|
||||
"occbin_constraints" "model_replace" "pac_target_info" "verbatim")
|
||||
"occbin_constraints" "model_replace" "pac_target_info" "matched_irfs"
|
||||
"matched_irfs_weights" "verbatim")
|
||||
"Dynare block keywords."))
|
||||
|
||||
;; Mathematical functions and operators used in model equations (see "hand_side" in Bison file)
|
||||
|
|
|
@ -6,7 +6,7 @@ set -e
|
|||
shopt -s extglob
|
||||
|
||||
if (($# < 7 )); then
|
||||
echo "Usage: $0 build_for matlab_octave_exe matlab_octave_version matlab_arch source_root build_root test_file(s) [-- extra_file(s)]" 2>&1
|
||||
echo "Usage: $0 build_for matlab_octave_exe matlab_octave_version matlab_arch xvfb_run_exe source_root build_root test_file(s) [-- extra_file(s)]" 2>&1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -14,9 +14,10 @@ build_for=$1
|
|||
matlab_octave_exe=$2
|
||||
matlab_octave_version=$3
|
||||
matlab_arch=$4
|
||||
source_root=$5
|
||||
build_root=$6
|
||||
shift 6
|
||||
xvfb_run_exe=$5
|
||||
source_root=$6
|
||||
build_root=$7
|
||||
shift 7
|
||||
|
||||
test_files=()
|
||||
while (($# > 0)); do
|
||||
|
@ -111,6 +112,11 @@ for test_file in "${test_files[@]}"; do
|
|||
# We cannot use the --no-window-system option, and we have to use xvfb
|
||||
# See the following Octave bug: https://savannah.gnu.org/bugs/?62101
|
||||
# (this affects at least tests/shock_decomposition/ls2003_plot.mod)
|
||||
xvfb-run -a "$matlab_octave_exe" --no-init-file --silent --no-history "$test_arg"
|
||||
test_cmd=("$matlab_octave_exe" --no-init-file --silent --no-history "$test_arg")
|
||||
if [[ -n $xvfb_run_exe ]]; then
|
||||
"$xvfb_run_exe" -a "${test_cmd[@]}"
|
||||
else
|
||||
"${test_cmd[@]}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
|
BIN
tests/estimation/method_of_moments/CET/cet_original_mode.mat (Stored with Git LFS)
BIN
tests/estimation/method_of_moments/CET/cet_original_mode.mat (Stored with Git LFS)
Binary file not shown.
|
@ -83,7 +83,7 @@ method_of_moments(mom_method = irf_matching
|
|||
%, mode_check_neighbourhood_size
|
||||
%, mode_check_number_of_points
|
||||
, mode_check_symmetric_plots = 0
|
||||
, mode_compute = 1
|
||||
, mode_compute = 4
|
||||
, mode_file = cet_original_mode
|
||||
%, nobs
|
||||
%, no_posterior_kernel_density
|
||||
|
|
|
@ -192,7 +192,7 @@ method_of_moments(mom_method = irf_matching
|
|||
, mh_replic=10
|
||||
, plot_priors = 0
|
||||
, nograph
|
||||
, mode_compute = 1
|
||||
, mode_compute = 5
|
||||
, posterior_sampling_method = 'slice'
|
||||
, posterior_sampler_options = ('rotated',1
|
||||
% ,'mode_files'
|
||||
|
|
|
@ -156,14 +156,14 @@ method_of_moments(mom_method = irf_matching
|
|||
|
||||
|
||||
method_of_moments(mom_method = irf_matching
|
||||
, additional_optimizer_steps = [1]
|
||||
, additional_optimizer_steps = [4]
|
||||
, cova_compute=1
|
||||
, dirname=cet_tarb_results
|
||||
, irf_matching_file = cet_irf_matching_file
|
||||
, mh_conf_sig = 0.90
|
||||
, mh_replic=0
|
||||
%, mode_check
|
||||
, mode_compute = 4
|
||||
, mode_compute = 5
|
||||
, mode_file = 'cet_tarb_results/method_of_moments/cet_tarb_mh_mode'
|
||||
, plot_priors = 0
|
||||
, nograph
|
||||
|
|
|
@ -18,7 +18,7 @@ MATLAB64_VERSION = 20231122
|
|||
## Build dependencies
|
||||
|
||||
# pacman -Ss mingw-w64-x86_64-boost
|
||||
MINGW64_BOOST_VERSION = 1.83.0-2
|
||||
MINGW64_BOOST_VERSION = 1.84.0-1
|
||||
|
||||
# pacman -Ss mingw-w64-x86_64-gsl
|
||||
MINGW64_GSL_VERSION = 2.7.1-2
|
||||
|
|
Loading…
Reference in New Issue