Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dynare
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
121
Issues
121
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dynare
dynare
Commits
da3943be
Commit
da3943be
authored
Dec 16, 2020
by
Johannes Pfeifer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure output is saved in dname-folder
That's where other functions are looking for them
parent
84566ada
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
78 additions
and
78 deletions
+78
-78
matlab/UnivariateSpectralDensity.m
matlab/UnivariateSpectralDensity.m
+5
-5
matlab/bvar_forecast.m
matlab/bvar_forecast.m
+4
-4
matlab/bvar_irf.m
matlab/bvar_irf.m
+1
-1
matlab/dynare_estimation.m
matlab/dynare_estimation.m
+2
-2
matlab/dynare_estimation_1.m
matlab/dynare_estimation_1.m
+11
-11
matlab/method_of_moments/method_of_moments.m
matlab/method_of_moments/method_of_moments.m
+1
-1
matlab/mh_autocorrelation_function.m
matlab/mh_autocorrelation_function.m
+6
-6
matlab/mode_check.m
matlab/mode_check.m
+5
-5
matlab/plot_priors.m
matlab/plot_priors.m
+5
-5
matlab/rplot.m
matlab/rplot.m
+12
-12
matlab/stoch_simul.m
matlab/stoch_simul.m
+9
-9
matlab/trace_plot.m
matlab/trace_plot.m
+8
-8
matlab/write_latex_definitions.m
matlab/write_latex_definitions.m
+3
-3
matlab/write_latex_parameter_table.m
matlab/write_latex_parameter_table.m
+3
-3
matlab/write_latex_prior_table.m
matlab/write_latex_prior_table.m
+3
-3
No files found.
matlab/UnivariateSpectralDensity.m
View file @
da3943be
...
...
@@ -151,11 +151,11 @@ else
end
if
~
options_
.
nograph
if
~
exist
(
M_
.
f
name
,
'dir'
)
mkdir
(
'.'
,
M_
.
f
name
);
if
~
exist
(
M_
.
d
name
,
'dir'
)
mkdir
(
'.'
,
M_
.
d
name
);
end
if
~
exist
([
M_
.
f
name
'/graphs'
],
'dir'
)
mkdir
(
M_
.
f
name
,
'graphs'
);
if
~
exist
([
M_
.
d
name
'/graphs'
],
'dir'
)
mkdir
(
M_
.
d
name
,
'graphs'
);
end
for
i
=
1
:
nvar
...
...
@@ -165,6 +165,6 @@ if ~options_.nograph
ylabel
(
'f(\omega)'
)
box
on
axis
tight
dyn_saveas
(
hh
,[
M_
.
f
name
,
filesep
,
'graphs'
,
filesep
,
'SpectralDensity_'
M_
.
endo_names
{
ivar
(
i
)}],
options_
.
nodisplay
,
options_
.
graph_format
)
dyn_saveas
(
hh
,[
M_
.
d
name
,
filesep
,
'graphs'
,
filesep
,
'SpectralDensity_'
M_
.
endo_names
{
ivar
(
i
)}],
options_
.
nodisplay
,
options_
.
graph_format
)
end
end
matlab/bvar_forecast.m
View file @
da3943be
...
...
@@ -114,7 +114,7 @@ sims_with_shocks_sort = sort(sims_with_shocks, 3);
sims_with_shocks_down_conf
=
sims_with_shocks_sort
(:,
:,
sort_idx
(
1
));
sims_with_shocks_up_conf
=
sims_with_shocks_sort
(:,
:,
sort_idx
(
2
));
OutputDirectoryName
=
CheckPath
(
'graphs'
,
M_
.
f
name
);
OutputDirectoryName
=
CheckPath
(
'graphs'
,
M_
.
d
name
);
dyn_graph
=
dynare_graph_init
(
sprintf
(
'BVAR forecasts (nlags = %d)'
,
nlags
),
ny
,
{
'b-'
'g-'
'g-'
'r-'
'r-'
});
...
...
@@ -153,10 +153,10 @@ end
% Store results
DirectoryName
=
[
M_
.
f
name
'/bvar_forecast'
];
DirectoryName
=
[
M_
.
d
name
'/bvar_forecast'
];
if
~
isdir
(
DirectoryName
)
if
~
isdir
(
M_
.
f
name
)
mkdir
(
M_
.
f
name
);
if
~
isdir
(
M_
.
d
name
)
mkdir
(
M_
.
d
name
);
end
mkdir
(
DirectoryName
);
end
...
...
matlab/bvar_irf.m
View file @
da3943be
...
...
@@ -126,7 +126,7 @@ for shock=1:ny
end
% Save intermediate results
DirectoryName
=
[
M_
.
f
name
'/bvar_irf'
];
DirectoryName
=
[
M_
.
d
name
'/bvar_irf'
];
if
~
isdir
(
DirectoryName
)
mkdir
(
'.'
,
DirectoryName
);
end
...
...
matlab/dynare_estimation.m
View file @
da3943be
...
...
@@ -147,7 +147,7 @@ if nnobs > 1 && horizon > 0
[
~
,
nr
,
nc
,
~
,
~
,
nstar
]
=
pltorg
(
nvar
);
m
=
1
;
plot_index
=
0
;
OutputDirectoryName
=
CheckPath
(
'graphs'
,
M_
.
f
name
);
OutputDirectoryName
=
CheckPath
(
'graphs'
,
M_
.
d
name
);
for
i
=
1
:
length
(
var_list
)
if
mod
(
i
,
nstar
)
==
1
plot_index
=
plot_index
+
1
;
...
...
@@ -208,7 +208,7 @@ if nnobs > 1 && horizon > 0
xlim
([
nobs
(
1
)
-
offsetx
nobs
(
end
)
+
horizon
])
m
=
m
+
1
;
if
mod
(
i
+
1
,
nstar
)
==
1
||
i
==
length
(
var_list
)
dyn_saveas
(
hfig
,[
M_
.
f
name
,
filesep
,
'graphs'
,
filesep
M_
.
fname
'_RecursiveForecasts_'
int2str
(
plot_index
)],
options_
.
nodisplay
,
options_
.
graph_format
);
dyn_saveas
(
hfig
,[
M_
.
d
name
,
filesep
,
'graphs'
,
filesep
M_
.
fname
'_RecursiveForecasts_'
int2str
(
plot_index
)],
options_
.
nodisplay
,
options_
.
graph_format
);
end
end
end
...
...
matlab/dynare_estimation_1.m
View file @
da3943be
...
...
@@ -557,11 +557,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
if
~
options_
.
nograph
[
nbplt
,
nr
,
nc
,
lr
,
lc
,
nstar
]
=
pltorg
(
M_
.
exo_nbr
);
if
~
exist
([
M_
.
f
name
'/graphs'
],
'dir'
)
mkdir
(
M_
.
f
name
,
'graphs'
);
if
~
exist
([
M_
.
d
name
'/graphs'
],
'dir'
)
mkdir
(
M_
.
d
name
,
'graphs'
);
end
if
options_
.
TeX
&&
any
(
strcmp
(
'eps'
,
cellstr
(
options_
.
graph_format
)))
fidTeX
=
fopen
([
M_
.
f
name
,
'/graphs/'
M_
.
fname
'_SmoothedShocks.tex'
],
'w'
);
fidTeX
=
fopen
([
M_
.
d
name
,
'/graphs/'
M_
.
fname
'_SmoothedShocks.tex'
],
'w'
);
fprintf
(
fidTeX
,
'%% TeX eps-loader file generated by dynare_estimation_1.m (Dynare).\n'
);
fprintf
(
fidTeX
,[
'%% '
datestr
(
now
,
0
)
'\n'
]);
fprintf
(
fidTeX
,
' \n'
);
...
...
@@ -599,11 +599,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
title
(
name
,
'Interpreter'
,
'none'
)
end
end
dyn_saveas
(
fh
,[
M_
.
f
name
,
'/graphs/'
M_
.
fname
'_SmoothedShocks'
int2str
(
plt
)],
options_
.
nodisplay
,
options_
.
graph_format
);
dyn_saveas
(
fh
,[
M_
.
d
name
,
'/graphs/'
M_
.
fname
'_SmoothedShocks'
int2str
(
plt
)],
options_
.
nodisplay
,
options_
.
graph_format
);
if
options_
.
TeX
&&
any
(
strcmp
(
'eps'
,
cellstr
(
options_
.
graph_format
)))
fprintf
(
fidTeX
,
'\\begin{figure}[H]\n'
);
fprintf
(
fidTeX
,
'\\centering \n'
);
fprintf
(
fidTeX
,
'\\includegraphics[width=%2.2f\\textwidth]{%s_SmoothedShocks%s}\n'
,
options_
.
figures
.
textwidth
*
min
(
i
/
nc
,
1
),[
M_
.
f
name
,
'/graphs/'
M_
.
fname
],
int2str
(
plt
));
fprintf
(
fidTeX
,
'\\includegraphics[width=%2.2f\\textwidth]{%s_SmoothedShocks%s}\n'
,
options_
.
figures
.
textwidth
*
min
(
i
/
nc
,
1
),[
M_
.
d
name
,
'/graphs/'
M_
.
fname
],
int2str
(
plt
));
fprintf
(
fidTeX
,
'\\caption{Smoothed shocks.}'
);
fprintf
(
fidTeX
,
'\\label{Fig:SmoothedShocks:%s}\n'
,
int2str
(
plt
));
fprintf
(
fidTeX
,
'\\end{figure}\n'
);
...
...
@@ -628,7 +628,7 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
if
~
options_
.
nograph
[
nbplt
,
nr
,
nc
,
lr
,
lc
,
nstar
]
=
pltorg
(
number_of_plots_to_draw
);
if
options_
.
TeX
&&
any
(
strcmp
(
'eps'
,
cellstr
(
options_
.
graph_format
)))
fidTeX
=
fopen
([
M_
.
f
name
,
'/graphs/'
M_
.
fname
'_SmoothedObservationErrors.tex'
],
'w'
);
fidTeX
=
fopen
([
M_
.
d
name
,
'/graphs/'
M_
.
fname
'_SmoothedObservationErrors.tex'
],
'w'
);
fprintf
(
fidTeX
,
'%% TeX eps-loader file generated by dynare_estimation_1.m (Dynare).\n'
);
fprintf
(
fidTeX
,[
'%% '
datestr
(
now
,
0
)
'\n'
]);
fprintf
(
fidTeX
,
' \n'
);
...
...
@@ -665,11 +665,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
title
(
name
,
'Interpreter'
,
'none'
)
end
end
dyn_saveas
(
fh
,[
M_
.
f
name
,
'/graphs/'
M_
.
fname
'_SmoothedObservationErrors'
int2str
(
plt
)],
options_
.
nodisplay
,
options_
.
graph_format
);
dyn_saveas
(
fh
,[
M_
.
d
name
,
'/graphs/'
M_
.
fname
'_SmoothedObservationErrors'
int2str
(
plt
)],
options_
.
nodisplay
,
options_
.
graph_format
);
if
options_
.
TeX
&&
any
(
strcmp
(
'eps'
,
cellstr
(
options_
.
graph_format
)))
fprintf
(
fidTeX
,
'\\begin{figure}[H]\n'
);
fprintf
(
fidTeX
,
'\\centering \n'
);
fprintf
(
fidTeX
,
'\\includegraphics[width=%2.2f\\textwidth]{%s_SmoothedObservationErrors%s}\n'
,
options_
.
figures
.
textwidth
*
min
(
i
/
nc
,
1
),[
M_
.
f
name
,
'/graphs/'
M_
.
fname
],
int2str
(
plt
));
fprintf
(
fidTeX
,
'\\includegraphics[width=%2.2f\\textwidth]{%s_SmoothedObservationErrors%s}\n'
,
options_
.
figures
.
textwidth
*
min
(
i
/
nc
,
1
),[
M_
.
d
name
,
'/graphs/'
M_
.
fname
],
int2str
(
plt
));
fprintf
(
fidTeX
,
'\\caption{Smoothed observation errors.}'
);
fprintf
(
fidTeX
,
'\\label{Fig:SmoothedObservationErrors:%s}\n'
,
int2str
(
plt
));
fprintf
(
fidTeX
,
'\\end{figure}\n'
);
...
...
@@ -689,7 +689,7 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
if
~
options_
.
nograph
[
nbplt
,
nr
,
nc
,
lr
,
lc
,
nstar
]
=
pltorg
(
n_varobs
);
if
options_
.
TeX
&&
any
(
strcmp
(
'eps'
,
cellstr
(
options_
.
graph_format
)))
fidTeX
=
fopen
([
M_
.
f
name
,
'/graphs/'
M_
.
fname
'_HistoricalAndSmoothedVariables.tex'
],
'w'
);
fidTeX
=
fopen
([
M_
.
d
name
,
'/graphs/'
M_
.
fname
'_HistoricalAndSmoothedVariables.tex'
],
'w'
);
fprintf
(
fidTeX
,
'%% TeX eps-loader file generated by dynare_estimation_1.m (Dynare).\n'
);
fprintf
(
fidTeX
,[
'%% '
datestr
(
now
,
0
)
'\n'
]);
fprintf
(
fidTeX
,
' \n'
);
...
...
@@ -727,11 +727,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
title
(
name
,
'Interpreter'
,
'none'
)
end
end
dyn_saveas
(
fh
,[
M_
.
f
name
,
'/graphs/'
M_
.
fname
'_HistoricalAndSmoothedVariables'
int2str
(
plt
)],
options_
.
nodisplay
,
options_
.
graph_format
);
dyn_saveas
(
fh
,[
M_
.
d
name
,
'/graphs/'
M_
.
fname
'_HistoricalAndSmoothedVariables'
int2str
(
plt
)],
options_
.
nodisplay
,
options_
.
graph_format
);
if
options_
.
TeX
&&
any
(
strcmp
(
'eps'
,
cellstr
(
options_
.
graph_format
)))
fprintf
(
fidTeX
,
'\\begin{figure}[H]\n'
);
fprintf
(
fidTeX
,
'\\centering \n'
);
fprintf
(
fidTeX
,
'\\includegraphics[width=%2.2f\\textwidth]{%s_HistoricalAndSmoothedVariables%s}\n'
,
options_
.
figures
.
textwidth
*
min
(
i
/
nc
,
1
),[
M_
.
f
name
,
'/graphs/'
M_
.
fname
],
int2str
(
plt
));
fprintf
(
fidTeX
,
'\\includegraphics[width=%2.2f\\textwidth]{%s_HistoricalAndSmoothedVariables%s}\n'
,
options_
.
figures
.
textwidth
*
min
(
i
/
nc
,
1
),[
M_
.
d
name
,
'/graphs/'
M_
.
fname
],
int2str
(
plt
));
fprintf
(
fidTeX
,
'\\caption{Historical and smoothed variables.}'
);
fprintf
(
fidTeX
,
'\\label{Fig:HistoricalAndSmoothedVariables:%s}\n'
,
int2str
(
plt
));
fprintf
(
fidTeX
,
'\\end{figure}\n'
);
...
...
matlab/method_of_moments/method_of_moments.m
View file @
da3943be
...
...
@@ -173,7 +173,7 @@ end
% General options that can be set by the user in the mod file, otherwise default values are provided
options_mom_
=
set_default_option
(
options_mom_
,
'dirname'
,
M_
.
f
name
);
% directory in which to store estimation output
options_mom_
=
set_default_option
(
options_mom_
,
'dirname'
,
M_
.
d
name
);
% directory in which to store estimation output
options_mom_
=
set_default_option
(
options_mom_
,
'graph_format'
,
'eps'
);
% specify the file format(s) for graphs saved to disk
options_mom_
=
set_default_option
(
options_mom_
,
'nodisplay'
,
false
);
% do not display the graphs, but still save them to disk
options_mom_
=
set_default_option
(
options_mom_
,
'nograph'
,
false
);
% do not create graphs (which implies that they are not saved to the disk nor displayed)
...
...
matlab/mh_autocorrelation_function.m
View file @
da3943be
...
...
@@ -95,13 +95,13 @@ hh=dyn_figure(options_.nodisplay,'Name',FigureName);
bar
(
0
:
options_
.
mh_autocorrelation_function_size
,
autocor
,
'k'
);
axis
tight
% create subdirectory <
f
name>/graphs if it doesn't exist
if
~
exist
(
M_
.
f
name
,
'dir'
)
mkdir
(
'.'
,
M_
.
f
name
);
% create subdirectory <
d
name>/graphs if it doesn't exist
if
~
exist
(
M_
.
d
name
,
'dir'
)
mkdir
(
'.'
,
M_
.
d
name
);
end
if
~
exist
([
M_
.
f
name
filesep
'graphs'
])
mkdir
(
M_
.
f
name
,
'graphs'
);
if
~
exist
([
M_
.
d
name
filesep
'graphs'
])
mkdir
(
M_
.
d
name
,
'graphs'
);
end
plot_name
=
get_the_name
(
column
,
0
,
M_
,
estim_params_
,
options_
);
dyn_saveas
(
hh
,[
M_
.
f
name
,
filesep
,
'graphs'
,
filesep
,
'MH_Autocorrelation_'
plot_name
],
options_
.
nodisplay
,
options_
.
graph_format
)
dyn_saveas
(
hh
,[
M_
.
d
name
,
filesep
,
'graphs'
,
filesep
,
'MH_Autocorrelation_'
plot_name
],
options_
.
nodisplay
,
options_
.
graph_format
)
matlab/mode_check.m
View file @
da3943be
...
...
@@ -77,11 +77,11 @@ end
[
nbplt
,
nr
,
nc
,
lr
,
lc
,
nstar
]
=
pltorg
(
length
(
x
));
if
~
exist
([
Model
.
f
name
filesep
'
graphs
'
],
'
dir
'
)
mkdir
(
Model
.
f
name
,
'
graphs
'
);
if
~
exist
([
Model
.
d
name
filesep
'
graphs
'
],
'
dir
'
)
mkdir
(
Model
.
d
name
,
'
graphs
'
);
end
if
TeX
&&
any
(
strcmp
(
'
eps
'
,
cellstr
(
DynareOptions
.
graph_format
)))
fidTeX
=
fopen
([
Model
.
f
name
,
'
/
graphs
/
'
,
Model
.
fname
'
_CheckPlots
.
tex
'
],
'w'
);
fidTeX
=
fopen
([
Model
.
d
name
,
'
/
graphs
/
'
,
Model
.
fname
'
_CheckPlots
.
tex
'
],
'w'
);
fprintf
(
fidTeX
,
'
%%
TeX
eps
-
loader
file
generated
by
mode_check
.
m
(
Dynare
).
\
n
'
);
fprintf
(
fidTeX
,[
'
%%
'
datestr
(
now
,
0
)
'\n'
]);
fprintf
(
fidTeX
,
'
\
n
'
);
...
...
@@ -201,12 +201,12 @@ for plt = 1:nbplt
text
(
0
.
25
,
0
.
5
,
'
log
-
post
'
)
text
(
0
.
69
,
0
.
5
,
'
log
-
lik
kernel
'
)
end
dyn_saveas
(
hh
,[
Model
.
f
name
,
'
/
graphs
/
'
,
Model
.
fname
'
_CheckPlots
'
int2str
(
plt
)
],
DynareOptions
.
nodisplay
,
DynareOptions
.
graph_format
);
dyn_saveas
(
hh
,[
Model
.
d
name
,
'
/
graphs
/
'
,
Model
.
fname
'
_CheckPlots
'
int2str
(
plt
)
],
DynareOptions
.
nodisplay
,
DynareOptions
.
graph_format
);
if
TeX
&&
any
(
strcmp
(
'
eps
'
,
cellstr
(
DynareOptions
.
graph_format
)))
%
TeX
eps
loader
file
fprintf
(
fidTeX
,
'\\
begin
{
figure
}[
H
]
\
n
'
);
fprintf
(
fidTeX
,
'\\
centering
\
n
'
);
fprintf
(
fidTeX
,
'\\
includegraphics
[
width
=%
2
.
2
f
\\
textwidth
]{
%
s_CheckPlots
%
s
}
\
n
'
,
DynareOptions
.
figures
.
textwidth
*
min
(
k
/
nc
,
1
),[
Model
.
f
name
,
'
/
graphs
/
'
,
Model
.
fname
],
int2str
(
plt
));
fprintf
(
fidTeX
,
'\\
includegraphics
[
width
=%
2
.
2
f
\\
textwidth
]{
%
s_CheckPlots
%
s
}
\
n
'
,
DynareOptions
.
figures
.
textwidth
*
min
(
k
/
nc
,
1
),[
Model
.
d
name
,
'
/
graphs
/
'
,
Model
.
fname
],
int2str
(
plt
));
fprintf
(
fidTeX
,
'\\
caption
{
Check
plots
.}
'
);
fprintf
(
fidTeX
,
'\\
label
{
Fig
:
CheckPlots
:%
s
}
\
n
'
,
int2str
(
plt
));
fprintf
(
fidTeX
,
'\\
end
{
figure
}
\
n
'
);
...
...
matlab/plot_priors.m
View file @
da3943be
...
...
@@ -41,11 +41,11 @@ end
npar
=
length
(
bayestopt_
.
p1
);
[
nbplt
,
nr
,
nc
,
lr
,
lc
,
nstar
]
=
pltorg
(
npar
);
if
~
exist
([
M_
.
f
name
'/graphs'
],
'dir'
)
mkdir
(
M_
.
f
name
,
'graphs'
);
if
~
exist
([
M_
.
d
name
'/graphs'
],
'dir'
)
mkdir
(
M_
.
d
name
,
'graphs'
);
end
if
TeX
&&
any
(
strcmp
(
'eps'
,
cellstr
(
options_
.
graph_format
)))
fidTeX
=
fopen
([
M_
.
f
name
,
'/graphs/'
M_
.
fname
'_Priors.tex'
],
'w'
);
fidTeX
=
fopen
([
M_
.
d
name
,
'/graphs/'
M_
.
fname
'_Priors.tex'
],
'w'
);
fprintf
(
fidTeX
,
'%% TeX eps-loader file generated by plot_priors.m (Dynare).\n'
);
fprintf
(
fidTeX
,[
'%% '
datestr
(
now
,
0
)
'\n'
]);
fprintf
(
fidTeX
,
' \n'
);
...
...
@@ -73,11 +73,11 @@ for plt = 1:nbplt
end
drawnow
end
dyn_saveas
(
hplt
,[
M_
.
f
name
,
'/graphs/'
M_
.
fname
'_Priors'
int2str
(
plt
)],
options_
.
nodisplay
,
options_
.
graph_format
);
dyn_saveas
(
hplt
,[
M_
.
d
name
,
'/graphs/'
M_
.
fname
'_Priors'
int2str
(
plt
)],
options_
.
nodisplay
,
options_
.
graph_format
);
if
TeX
&&
any
(
strcmp
(
'eps'
,
cellstr
(
options_
.
graph_format
)))
fprintf
(
fidTeX
,
'\\begin{figure}[H]\n'
);
fprintf
(
fidTeX
,
'\\centering\n'
);
fprintf
(
fidTeX
,
'\\includegraphics[width=%2.2f\\textwidth]{%s_Priors%s}\n'
,
options_
.
figures
.
textwidth
*
min
(
index
/
nc
,
1
),[
M_
.
f
name
,
'/graphs/'
M_
.
fname
],
int2str
(
plt
));
fprintf
(
fidTeX
,
'\\includegraphics[width=%2.2f\\textwidth]{%s_Priors%s}\n'
,
options_
.
figures
.
textwidth
*
min
(
index
/
nc
,
1
),[
M_
.
d
name
,
'/graphs/'
M_
.
fname
],
int2str
(
plt
));
fprintf
(
fidTeX
,
'\\caption{Priors.}'
);
fprintf
(
fidTeX
,
'\\label{Fig:Priors:%s}\n'
,
int2str
(
plt
));
fprintf
(
fidTeX
,
'\\end{figure}\n'
);
...
...
matlab/rplot.m
View file @
da3943be
...
...
@@ -37,12 +37,12 @@ if isempty(oo_.endo_simul)
error
(
'rplot: oo_.endo_simul is empty.'
)
end
% create subdirectory <
f
name>/graphs if it doesn't exist
if
~
exist
(
M_
.
f
name
,
'dir'
)
mkdir
(
'.'
,
M_
.
f
name
);
% create subdirectory <
d
name>/graphs if it doesn't exist
if
~
exist
(
M_
.
d
name
,
'dir'
)
mkdir
(
'.'
,
M_
.
d
name
);
end
if
~
exist
([
M_
.
f
name
filesep
'graphs'
],
'dir'
)
mkdir
(
M_
.
f
name
,
'graphs'
);
if
~
exist
([
M_
.
d
name
filesep
'graphs'
],
'dir'
)
mkdir
(
M_
.
d
name
,
'graphs'
);
end
ix
=
(
1
-
M_
.
maximum_lag
:
size
(
oo_
.
endo_simul
,
2
)
-
M_
.
maximum_lag
)
'
;
...
...
@@ -69,7 +69,7 @@ else
end
if
options_
.
TeX
&&
any
(
strcmp
(
'eps'
,
cellstr
(
options_
.
graph_format
)))
fidTeX
=
fopen
([
M_
.
f
name
,
filesep
,
'graphs'
,
filesep
,
M_
.
fname
'_simulated_trajectories_'
,
num2str
(
options_
.
rplottype
),
'.tex'
],
'w'
);
fidTeX
=
fopen
([
M_
.
d
name
,
filesep
,
'graphs'
,
filesep
,
M_
.
fname
'_simulated_trajectories_'
,
num2str
(
options_
.
rplottype
),
'.tex'
],
'w'
);
fprintf
(
fidTeX
,
'%% TeX eps-loader file generated by rplot.m (Dynare).\n'
);
fprintf
(
fidTeX
,[
'%% '
datestr
(
now
,
0
)
'\n'
]);
end
...
...
@@ -94,9 +94,9 @@ if options_.rplottype == 0
legend
(
s1
,
'interpreter'
,
'none'
);
end
end
dyn_saveas
(
hh
,[
M_
.
f
name
,
filesep
,
'graphs'
,
filesep
,
'SimulatedTrajectory_'
s1
{
1
}],
options_
.
nodisplay
,
options_
.
graph_format
)
dyn_saveas
(
hh
,[
M_
.
d
name
,
filesep
,
'graphs'
,
filesep
,
'SimulatedTrajectory_'
s1
{
1
}],
options_
.
nodisplay
,
options_
.
graph_format
)
if
options_
.
TeX
&&
any
(
strcmp
(
'eps'
,
cellstr
(
options_
.
graph_format
)))
create_TeX_loader
(
fidTeX
,[
M_
.
f
name
,
'/graphs/'
,
'SimulatedTrajectory_'
s1
{
1
}],
'Simulated trajectories'
,
'SimulatedTrajectory_'
,
s1
{
1
},
1
)
create_TeX_loader
(
fidTeX
,[
M_
.
d
name
,
'/graphs/'
,
'SimulatedTrajectory_'
s1
{
1
}],
'Simulated trajectories'
,
'SimulatedTrajectory_'
,
s1
{
1
},
1
)
end
elseif
options_
.
rplottype
==
1
for
j
=
1
:
size
(
y
,
1
)
...
...
@@ -109,9 +109,9 @@ elseif options_.rplottype == 1
title
([
'Plot of '
s1
{
j
}],
'Interpreter'
,
'none'
)
;
end
xlabel
(
'Periods'
)
;
dyn_saveas
(
hh
,[
M_
.
f
name
,
filesep
,
'graphs'
,
filesep
,
'SimulatedTrajectory_'
s1
{
j
}],
options_
.
nodisplay
,
options_
.
graph_format
)
dyn_saveas
(
hh
,[
M_
.
d
name
,
filesep
,
'graphs'
,
filesep
,
'SimulatedTrajectory_'
s1
{
j
}],
options_
.
nodisplay
,
options_
.
graph_format
)
if
options_
.
TeX
&&
any
(
strcmp
(
'eps'
,
cellstr
(
options_
.
graph_format
)))
create_TeX_loader
(
fidTeX
,[
M_
.
f
name
,
'/graphs/'
,
'SimulatedTrajectory_'
s1
{
j
}],
'Simulated trajectories'
,
'SimulatedTrajectory_'
,
s1
{
j
},
1
);
create_TeX_loader
(
fidTeX
,[
M_
.
d
name
,
'/graphs/'
,
'SimulatedTrajectory_'
s1
{
j
}],
'Simulated trajectories'
,
'SimulatedTrajectory_'
,
s1
{
j
},
1
);
end
end
elseif
options_
.
rplottype
==
2
...
...
@@ -137,9 +137,9 @@ elseif options_.rplottype == 2
end
axis
tight
;
end
dyn_saveas
(
hh
,[
M_
.
f
name
,
filesep
,
'graphs'
,
filesep
,
'SimulatedTrajectory_'
s1
{
1
}],
options_
.
nodisplay
,
options_
.
graph_format
)
dyn_saveas
(
hh
,[
M_
.
d
name
,
filesep
,
'graphs'
,
filesep
,
'SimulatedTrajectory_'
s1
{
1
}],
options_
.
nodisplay
,
options_
.
graph_format
)
if
options_
.
TeX
&&
any
(
strcmp
(
'eps'
,
cellstr
(
options_
.
graph_format
)))
create_TeX_loader
(
fidTeX
,[
M_
.
f
name
,
'/graphs/'
,
'SimulatedTrajectory_'
s1
{
1
}],
'Simulated trajectories'
,
'SimulatedTrajectory_'
,
s1
{
1
},
min
(
j
/
nc
,
1
));
create_TeX_loader
(
fidTeX
,[
M_
.
d
name
,
'/graphs/'
,
'SimulatedTrajectory_'
s1
{
1
}],
'Simulated trajectories'
,
'SimulatedTrajectory_'
,
s1
{
1
},
min
(
j
/
nc
,
1
));
end
end
...
...
matlab/stoch_simul.m
View file @
da3943be
...
...
@@ -204,12 +204,12 @@ end
if
options_
.
irf
var_listTeX
=
M_
.
endo_names_tex
(
i_var
);
if
~
options_
.
nograph
||
(
TeX
&&
any
(
strcmp
(
'eps'
,
cellstr
(
options_
.
graph_format
))))
if
~
exist
([
M_
.
f
name
'/graphs'
],
'dir'
)
mkdir
(
M_
.
f
name
,
'graphs'
);
if
~
exist
([
M_
.
d
name
'/graphs'
],
'dir'
)
mkdir
(
M_
.
d
name
,
'graphs'
);
end
end
if
TeX
&&
any
(
strcmp
(
'eps'
,
cellstr
(
options_
.
graph_format
)))
fidTeX
=
fopen
([
M_
.
f
name
,
'/graphs/'
M_
.
fname
'_IRF.tex'
],
'w'
);
fidTeX
=
fopen
([
M_
.
d
name
,
'/graphs/'
M_
.
fname
'_IRF.tex'
],
'w'
);
fprintf
(
fidTeX
,
'%% TeX eps-loader file generated by stoch_simul.m (Dynare).\n'
);
fprintf
(
fidTeX
,[
'%% '
datestr
(
now
,
0
)
'\n'
]);
fprintf
(
fidTeX
,
' \n'
);
...
...
@@ -300,11 +300,11 @@ if options_.irf
title
(
deblank
(
mylist
(
j
,:)),
'Interpreter'
,
'none'
);
end
end
dyn_saveas
(
hh
,[
M_
.
f
name
,
'/graphs/'
M_
.
fname
'_IRF_'
tit
{
i
}],
options_
.
nodisplay
,
options_
.
graph_format
);
dyn_saveas
(
hh
,[
M_
.
d
name
,
'/graphs/'
M_
.
fname
'_IRF_'
tit
{
i
}],
options_
.
nodisplay
,
options_
.
graph_format
);
if
TeX
&&
any
(
strcmp
(
'eps'
,
cellstr
(
options_
.
graph_format
)))
fprintf
(
fidTeX
,
'\\begin{figure}[H]\n'
);
fprintf
(
fidTeX
,
'\\centering \n'
);
fprintf
(
fidTeX
,
'\\includegraphics[width=%2.2f\\textwidth]{%s_IRF_%s}\n'
,
options_
.
figures
.
textwidth
*
min
(
j
/
nc
,
1
),[
M_
.
f
name
,
'/graphs/'
M_
.
fname
],
tit
{
i
});
fprintf
(
fidTeX
,
'\\includegraphics[width=%2.2f\\textwidth]{%s_IRF_%s}\n'
,
options_
.
figures
.
textwidth
*
min
(
j
/
nc
,
1
),[
M_
.
d
name
,
'/graphs/'
M_
.
fname
],
tit
{
i
});
fprintf
(
fidTeX
,
'\\caption{Impulse response functions (orthogonalized shock to $%s$).}\n'
,
titTeX
{
i
});
fprintf
(
fidTeX
,
'\\label{Fig:IRF:%s}\n'
,
tit
{
i
});
fprintf
(
fidTeX
,
'\\end{figure}\n'
);
...
...
@@ -333,11 +333,11 @@ if options_.irf
title
(
deblank
(
mylist
((
fig
-
1
)
*
nstar
+
plt
,:)),
'Interpreter'
,
'none'
);
end
end
dyn_saveas
(
hh
,[
M_
.
f
name
,
'/graphs/'
M_
.
fname
'_IRF_'
tit
{
i
}
int2str
(
fig
)],
options_
.
nodisplay
,
options_
.
graph_format
);
dyn_saveas
(
hh
,[
M_
.
d
name
,
'/graphs/'
M_
.
fname
'_IRF_'
tit
{
i
}
int2str
(
fig
)],
options_
.
nodisplay
,
options_
.
graph_format
);
if
TeX
&&
any
(
strcmp
(
'eps'
,
cellstr
(
options_
.
graph_format
)))
fprintf
(
fidTeX
,
'\\begin{figure}[H]\n'
);
fprintf
(
fidTeX
,
'\\centering \n'
);
fprintf
(
fidTeX
,
'\\includegraphics[width=%2.2f\\textwidth]{%s_IRF_%s%s}\n'
,
options_
.
figures
.
textwidth
*
min
(
plt
/
nc
,
1
),[
M_
.
f
name
,
'/graphs/'
M_
.
fname
],
tit
{
i
},
int2str
(
fig
));
fprintf
(
fidTeX
,
'\\includegraphics[width=%2.2f\\textwidth]{%s_IRF_%s%s}\n'
,
options_
.
figures
.
textwidth
*
min
(
plt
/
nc
,
1
),[
M_
.
d
name
,
'/graphs/'
M_
.
fname
],
tit
{
i
},
int2str
(
fig
));
if
options_
.
relative_irf
fprintf
(
fidTeX
,
'\\caption{Relative impulse response functions (orthogonalized shock to $%s$).}'
,
titTeX
{
i
});
else
...
...
@@ -365,11 +365,11 @@ if options_.irf
title
(
deblank
(
mylist
((
nbplt
-
1
)
*
nstar
+
plt
,:)),
'Interpreter'
,
'none'
);
end
end
dyn_saveas
(
hh
,[
M_
.
f
name
,
'/graphs/'
M_
.
fname
'_IRF_'
tit
{
i
}
int2str
(
nbplt
)
],
options_
.
nodisplay
,
options_
.
graph_format
);
dyn_saveas
(
hh
,[
M_
.
d
name
,
'/graphs/'
M_
.
fname
'_IRF_'
tit
{
i
}
int2str
(
nbplt
)
],
options_
.
nodisplay
,
options_
.
graph_format
);
if
TeX
&&
any
(
strcmp
(
'eps'
,
cellstr
(
options_
.
graph_format
)))
fprintf
(
fidTeX
,
'\\begin{figure}[H]\n'
);
fprintf
(
fidTeX
,
'\\centering \n'
);
fprintf
(
fidTeX
,
'\\includegraphics[width=%2.2f\\textwidth]{%s_IRF_%s%s}\n'
,
options_
.
figures
.
textwidth
*
min
(
m
/
lc
,
1
),[
M_
.
f
name
,
'/graphs/'
M_
.
fname
],
tit
{
i
},
int2str
(
nbplt
));
fprintf
(
fidTeX
,
'\\includegraphics[width=%2.2f\\textwidth]{%s_IRF_%s%s}\n'
,
options_
.
figures
.
textwidth
*
min
(
m
/
lc
,
1
),[
M_
.
d
name
,
'/graphs/'
M_
.
fname
],
tit
{
i
},
int2str
(
nbplt
));
if
options_
.
relative_irf
fprintf
(
fidTeX
,
'\\caption{Relative impulse response functions (orthogonalized shock to $%s$).}'
,
titTeX
{
i
});
else
...
...
matlab/trace_plot.m
View file @
da3943be
...
...
@@ -115,12 +115,12 @@ plot(1:TotalNumberOfMhDraws,MovingAverage,'-k','linewidth',2)
hold
off
axis
tight
legend
({
'MCMC draw'
;[
num2str
(
N
)
' period moving average'
]},
'Location'
,
'NorthWest'
)
% create subdirectory <
f
name>/graphs if it doesn't exist
if
~
exist
(
M_
.
f
name
,
'dir'
)
mkdir
(
'.'
,
M_
.
f
name
);
% create subdirectory <
d
name>/graphs if it doesn't exist
if
~
exist
(
M_
.
d
name
,
'dir'
)
mkdir
(
'.'
,
M_
.
d
name
);
end
if
~
exist
([
M_
.
f
name
filesep
'graphs'
],
'dir'
)
mkdir
(
M_
.
f
name
,
'graphs'
);
if
~
exist
([
M_
.
d
name
filesep
'graphs'
],
'dir'
)
mkdir
(
M_
.
d
name
,
'graphs'
);
end
%get name for plot
...
...
@@ -131,10 +131,10 @@ else
end
plot_name
=
[
plot_name
,
'_blck_'
,
num2str
(
blck
)];
dyn_saveas
(
hh
,[
M_
.
f
name
,
filesep
,
'graphs'
,
filesep
,
'TracePlot_'
plot_name
],
options_
.
nodisplay
,
options_
.
graph_format
)
dyn_saveas
(
hh
,[
M_
.
d
name
,
filesep
,
'graphs'
,
filesep
,
'TracePlot_'
plot_name
],
options_
.
nodisplay
,
options_
.
graph_format
)
if
options_
.
TeX
fid
=
fopen
([
M_
.
f
name
,
'/graphs/'
,
M_
.
fname
,
'_TracePlot_'
plot_name
,
'.tex'
],
'w+'
);
fid
=
fopen
([
M_
.
d
name
,
'/graphs/'
,
M_
.
fname
,
'_TracePlot_'
plot_name
,
'.tex'
],
'w+'
);
if
strcmpi
(
type
,
'DeepParameter'
)
tex_names
=
M_
.
param_names_tex
;
...
...
@@ -162,7 +162,7 @@ if options_.TeX
fprintf
(
fid
,
'%-s\n'
,
'\begin{figure}[H]'
);
fprintf
(
fid
,
'%-s\n'
,
'\centering'
);
fprintf
(
fid
,
'%-s\n'
,[
' \includegraphics[width=0.8\textwidth]{'
,[
M_
.
f
name
,
'/graphs/TracePlot_'
plot_name
],
'}\\'
]);
fprintf
(
fid
,
'%-s\n'
,[
' \includegraphics[width=0.8\textwidth]{'
,[
M_
.
d
name
,
'/graphs/TracePlot_'
plot_name
],
'}\\'
]);
fprintf
(
fid
,
'%-s\n'
,[
' \caption{'
,
FigureName
,
'}'
]);
fprintf
(
fid
,
'%-s\n'
,
'\end{figure}'
);
fclose
(
fid
);
...
...
matlab/write_latex_definitions.m
View file @
da3943be
...
...
@@ -39,10 +39,10 @@ else
M_var_root
=
{
'M_.endo'
,
'M_.exo'
,
'M_.exo_det'
,
'M_.param'
};
end
if
~
exist
([
M_
.
f
name
'/latex'
],
'dir'
)
mkdir
(
M_
.
f
name
,
'latex'
);
if
~
exist
([
M_
.
d
name
'/latex'
],
'dir'
)
mkdir
(
M_
.
d
name
,
'latex'
);
end
fid
=
fopen
([
M_
.
f
name
,
'/latex/'
M_
.
fname
'_latex_definitions.tex'
],
'w'
);
fid
=
fopen
([
M_
.
d
name
,
'/latex/'
M_
.
fname
'_latex_definitions.tex'
],
'w'
);
for
i
=
1
:
length
(
tables
)
fprintf
(
fid
,
'\\begin{center}\n'
);
fprintf
(
fid
,
'\\begin{longtable}{ccc}\n'
);
...
...
matlab/write_latex_parameter_table.m
View file @
da3943be
...
...
@@ -37,11 +37,11 @@ if ~isequal(M_.param_names, M_.param_names_long)
Long_names_present
=
true
;
end
if
~
exist
([
M_
.
f
name
'/latex'
],
'dir'
)
mkdir
(
M_
.
f
name
,
'latex'
);
if
~
exist
([
M_
.
d
name
'/latex'
],
'dir'
)
mkdir
(
M_
.
d
name
,
'latex'
);
end
fid
=
fopen
([
M_
.
f
name
,
'/latex/'
M_
.
fname
'_latex_parameters.tex'
],
'w'
);
fid
=
fopen
([
M_
.
d
name
,
'/latex/'
M_
.
fname
'_latex_parameters.tex'
],
'w'
);
fprintf
(
fid
,
'\\begin{center}\n'
);
if
Long_names_present
==
1
fprintf
(
fid
,
'\\begin{longtable}{ccc}\n'
);
...
...
matlab/write_latex_prior_table.m
View file @
da3943be
...
...
@@ -54,10 +54,10 @@ ub=bounds.ub;
PriorNames
=
{
'Beta'
,
'Gamma'
,
'Gaussian'
,
'Inv. Gamma'
,
'Uniform'
,
'Inv. Gamma -- 2'
,
''
,
'Weibull'
};
if
~
exist
([
M_
.
f
name
'/latex'
],
'dir'
)
mkdir
(
M_
.
f
name
,
'latex'
);
if
~
exist
([
M_
.
d
name
'/latex'
],
'dir'
)
mkdir
(
M_
.
d
name
,
'latex'
);
end
fidTeX
=
fopen
([
M_
.
f
name
,
'/latex/'
Model
.
fname
'_priors_table.tex'
],
'w+'
);
fidTeX
=
fopen
([
M_
.
d
name
,
'/latex/'
Model
.
fname
'_priors_table.tex'
],
'w+'
);
fprintf
(
fidTeX
,
'%% TeX-table generated by Dynare write_latex_prior_table.m.\n'
);
fprintf
(
fidTeX
,
'%% Prior Information\n'
);
fprintf
(
fidTeX
,[
'%% '
datestr
(
now
,
0
)]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment