Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
dynare
Commits
77488f5f
Commit
77488f5f
authored
12 years ago
by
Johannes Pfeifer
Browse files
Options
Downloads
Patches
Plain Diff
Make BVAR obey graph-options and save to graph folder
parent
7bbe1217
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!404
Make BVAR obey graph-options and save to graph folder
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
matlab/bvar_forecast.m
+5
-4
5 additions, 4 deletions
matlab/bvar_forecast.m
matlab/dynare_graph.m
+4
-6
4 additions, 6 deletions
matlab/dynare_graph.m
matlab/dynare_graph_init.m
+5
-5
5 additions, 5 deletions
matlab/dynare_graph_init.m
matlab/forcst_unc.m
+8
-7
8 additions, 7 deletions
matlab/forcst_unc.m
with
22 additions
and
22 deletions
matlab/bvar_forecast.m
+
5
−
4
View file @
77488f5f
...
...
@@ -114,17 +114,18 @@ 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
));
dynare_graph_init
(
sprintf
(
'BVAR forecasts (nlags = %d)'
,
nlags
),
ny
,
{
'b-'
'g-'
'g-'
'r-'
'r-'
});
OutputDirectoryName
=
CheckPath
(
'graphs'
,
M_
.
fname
);
dyn_graph
=
dynare_graph_init
(
sprintf
(
'BVAR forecasts (nlags = %d)'
,
nlags
),
ny
,
{
'b-'
'g-'
'g-'
'r-'
'r-'
});
for
i
=
1
:
ny
dyn
are_graph
(
[
sims_no_shock_median
(:,
i
)
...
dyn
_graph
=
dynare_graph
(
dyn_graph
,
[
sims_no_shock_median
(:,
i
)
...
sims_no_shock_up_conf
(:,
i
)
sims_no_shock_down_conf
(:,
i
)
...
sims_with_shocks_up_conf
(:,
i
)
sims_with_shocks_down_conf
(:,
i
)
],
...
options_
.
varobs
(
i
,
:));
end
dynare_graph_close
;
dyn_saveas
(
dyn_graph
.
fh
,[
OutputDirectoryName
'/'
M_
.
fname
'_BVAR_forecast_'
,
num2str
(
nlags
)],
options_
)
% Compute RMSE
...
...
This diff is collapsed.
Click to expand it.
matlab/dynare_graph.m
+
4
−
6
View file @
77488f5f
function
dyn
are_graph
(
y
,
tit
,
x
)
function
dyn
_graph
=
dynare_graph
(
dyn_graph
,
y
,
tit
,
x
)
% function dynare_graph(y,tit,x)
% graphs
%
...
...
@@ -7,12 +7,12 @@ function dynare_graph(y,tit,x)
% colors: line colors
%
% OUTPUT
%
n
on
e
%
dyn_graph: structure with figure informati
on
%
% SPECIAL REQUIREMENT
% none
% Copyright (C) 2006-20
09
Dynare Team
% Copyright (C) 2006-20
13
Dynare Team
%
% This file is part of Dynare.
%
...
...
@@ -29,9 +29,7 @@ function dynare_graph(y,tit,x)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global
dyn_graph
if
nargin
<
3
if
nargin
<
4
x
=
(
1
:
size
(
y
,
1
))
'
;
end
nplot
=
dyn_graph
.
plot_nbr
+
1
;
...
...
This diff is collapsed.
Click to expand it.
matlab/dynare_graph_init.m
+
5
−
5
View file @
77488f5f
function
dynare_graph_init
(
figure_name
,
nplot
,
line_types
,
line_width
)
function
dyn_graph
=
dynare_graph_init
(
figure_name
,
nplot
,
line_types
,
line_width
)
% function dynare_graph_init(figure_name,colors)
% initializes set of graphs
%
...
...
@@ -7,12 +7,12 @@ function dynare_graph_init(figure_name,nplot,line_types,line_width)
% colors: line colors
%
% OUTPUTS
%
n
on
e
%
dyn_graph: structure with figure informati
on
%
% SPECIAL REQUIREMENT
% none
% Copyright (C) 2006-20
09
Dynare Team
% Copyright (C) 2006-20
13
Dynare Team
%
% This file is part of Dynare.
%
...
...
@@ -29,9 +29,9 @@ function dynare_graph_init(figure_name,nplot,line_types,line_width)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global
dyn_graph
options_
global
options_
dyn_graph
.
fh
=
figure
(
'Name'
,
figure_name
);
dyn_graph
.
fh
=
dyn_
figure
(
options_
,
'Name'
,
figure_name
);
dyn_graph
.
figure_name
=
figure_name
;
if
nargin
>
2
dyn_graph
.
line_types
=
line_types
;
...
...
This diff is collapsed.
Click to expand it.
matlab/forcst_unc.m
+
8
−
7
View file @
77488f5f
...
...
@@ -15,7 +15,7 @@ function forcst_unc(y0,var_list)
% SPECIAL REQUIREMENTS
% None.
% Copyright (C) 2006-201
1
Dynare Team
% Copyright (C) 2006-201
3
Dynare Team
%
% This file is part of Dynare.
%
...
...
@@ -129,20 +129,21 @@ yf3_1 = yf3'-[zeros(maximum_lag,n); yf3_intv];
yf3_2
=
yf3
'+
[
zeros
(
maximum_lag
,
n
);
yf3_intv
];
% graphs
OutputDirectoryName
=
CheckPath
(
'graphs'
,
M_
.
fname
);
dynare_graph_init
(
'Forecasts type I'
,
n
,{
'b-'
'g-'
'g-'
'r-'
'r-'
});
dyn_graph
=
dynare_graph_init
(
'Forecasts type I'
,
n
,{
'b-'
'g-'
'g-'
'r-'
'r-'
});
for
i
=
1
:
n
dynare_graph
([
yf_mean
(:,
i
)
squeeze
(
yf1
(:,
i
,
k1
))
squeeze
(
yf2
(:,
i
,
k2
))],
...
dynare_graph
(
dyn_graph
,
[
yf_mean
(:,
i
)
squeeze
(
yf1
(:,
i
,
k1
))
squeeze
(
yf2
(:,
i
,
k2
))],
...
var_list
(
i
,:));
end
dyn
are_graph_close
;
dyn
_saveas
(
dyn_graph
.
fh
,[
OutputDirectoryName
'/'
M_
.
fname
'_forecast_param_uncert_'
,
num2str
(
nlags
)],
options_
)
dynare_graph_init
(
'Forecasts type II'
,
n
,{
'b-'
'k-'
'k-'
'r-'
'r-'
});
dyn_graph
=
dynare_graph_init
(
'Forecasts type II'
,
n
,{
'b-'
'k-'
'k-'
'r-'
'r-'
});
for
i
=
1
:
n
dynare_graph
([
yf_mean
(:,
i
)
yf3_1
(:,
i
)
yf3_2
(:,
i
)
squeeze
(
yf2
(:,
i
,
k2
))],
...
dynare_graph
(
dyn_graph
,
[
yf_mean
(:,
i
)
yf3_1
(:,
i
)
yf3_2
(:,
i
)
squeeze
(
yf2
(:,
i
,
k2
))],
...
var_list
(
i
,:));
end
dyn
are_graph_close
;
dyn
_saveas
(
dyn_graph
.
fh
,[
OutputDirectoryName
'/'
M_
.
fname
'_forecast_param_shock_uncert_'
,
num2str
(
nlags
)],
options_
)
% saving results
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment