Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dóra Kocsis
dynare
Commits
742ed027
Commit
742ed027
authored
Oct 07, 2011
by
Houtan Bastani
Browse files
MS-SBVAR: rework set_ms_estimation to match different meanings of file_tag
parent
38587195
Changes
8
Hide whitespace changes
Inline
Side-by-side
matlab/ms-sbvar/ms_compute_mdd.m
View file @
742ed027
...
...
@@ -34,7 +34,7 @@ function [options_, oo_]=ms_compute_mdd(M_, options_, oo_)
disp
(
'MS-SBVAR Marginal Data Density'
);
options_
=
set_file_tags
(
options_
);
clean_ms_mdd_files
(
options_
.
ms
.
output_file_tag
,
options_
.
ms
.
proposal_type
);
[
options_
,
oo_
]
=
set_ms_estimation_file
(
options_
,
oo_
);
[
options_
,
oo_
]
=
set_ms_estimation_file
(
options_
.
ms
.
file_tag
,
options_
,
oo_
);
options_
=
set_ms_simulation_file
(
options_
);
% setup command line options
...
...
matlab/ms-sbvar/ms_compute_probabilities.m
View file @
742ed027
...
...
@@ -34,7 +34,7 @@ function [options_, oo_]=ms_compute_probabilities(M_, options_, oo_)
disp
(
'MS-SBVAR Compute Regime Probabilities'
);
options_
=
set_file_tags
(
options_
);
clean_ms_probabilities_files
(
options_
.
ms
.
output_file_tag
);
[
options_
,
oo_
]
=
set_ms_estimation_file
(
options_
,
oo_
);
[
options_
,
oo_
]
=
set_ms_estimation_file
(
options_
.
ms
.
file_tag
,
options_
,
oo_
);
% setup command line options
opt
=
[
'-probabilities -seed '
num2str
(
options_
.
DynareRandomStreams
.
seed
)];
...
...
matlab/ms-sbvar/ms_estimation.m
View file @
742ed027
...
...
@@ -70,7 +70,7 @@ opt = [opt ' -random_tol_parms ' num2str(options_.ms.random_parameter_convergenc
[
err
]
=
ms_sbvar_command_line
(
opt
);
mexErrCheck
(
'ms_estimation'
,
err
);
[
options_
,
oo_
]
=
set_ms_estimation_file
(
options_
,
oo_
);
[
options_
,
oo_
]
=
set_ms_estimation_file
(
options_
.
ms
.
output_file_tag
,
options_
,
oo_
);
[
err
,
oo_
.
ms
.
A0
,
oo_
.
ms
.
Aplus
,
oo_
.
ms
.
Zeta
,
oo_
.
ms
.
Q
]
=
...
mex_ms_convert_free_parameters
({{
'file_tag'
,
options_
.
ms
.
output_file_tag
}},
oo_
.
ms
.
maxparams
);
mexErrCheck
(
'mex_ms_convert_free_parameters'
,
err
);
...
...
matlab/ms-sbvar/ms_forecast.m
View file @
742ed027
...
...
@@ -33,7 +33,7 @@ function [options_, oo_]=ms_forecast(M_, options_, oo_)
disp
(
'MS-SBVAR Forecasts'
);
options_
=
set_file_tags
(
options_
);
[
options_
,
oo_
]
=
set_ms_estimation_file
(
options_
,
oo_
);
[
options_
,
oo_
]
=
set_ms_estimation_file
(
options_
.
ms
.
file_tag
,
options_
,
oo_
);
options_
=
set_ms_simulation_file
(
options_
);
clean_files_for_second_type_of_mex
(
M_
,
options_
,
'forecast'
)
forecastdir
=
[
options_
.
ms
.
output_file_tag
filesep
'Forecast'
];
...
...
matlab/ms-sbvar/ms_irf.m
View file @
742ed027
...
...
@@ -34,7 +34,7 @@ function [options_, oo_]=ms_irf(varlist,M_, options_, oo_)
disp
(
'MS-SBVAR Impulse Response Function'
);
options_
=
set_file_tags
(
options_
);
[
options_
,
oo_
]
=
set_ms_estimation_file
(
options_
,
oo_
);
[
options_
,
oo_
]
=
set_ms_estimation_file
(
options_
.
ms
.
file_tag
,
options_
,
oo_
);
options_
=
set_ms_simulation_file
(
options_
);
clean_files_for_second_type_of_mex
(
M_
,
options_
,
'irf'
)
irfdir
=
[
options_
.
ms
.
output_file_tag
filesep
'IRF'
];
...
...
matlab/ms-sbvar/ms_simulation.m
View file @
742ed027
...
...
@@ -34,7 +34,7 @@ function [options_, oo_]=ms_simulation(M_, options_, oo_)
disp
(
'MS-SBVAR Simulation'
);
options_
=
set_file_tags
(
options_
);
clean_ms_simulation_files
(
options_
.
ms
.
output_file_tag
);
[
options_
,
oo_
]
=
set_ms_estimation_file
(
options_
,
oo_
);
[
options_
,
oo_
]
=
set_ms_estimation_file
(
options_
.
ms
.
file_tag
,
options_
,
oo_
);
% setup command line options
opt
=
[
'-simulate -seed '
num2str
(
options_
.
DynareRandomStreams
.
seed
)];
...
...
matlab/ms-sbvar/ms_variance_decomposition.m
View file @
742ed027
...
...
@@ -33,7 +33,7 @@ function [options_, oo_]=ms_variance_decomposition(M_, options_, oo_)
disp
(
'MS-SBVAR Variance Decomposition'
);
options_
=
set_file_tags
(
options_
);
[
options_
,
oo_
]
=
set_ms_estimation_file
(
options_
,
oo_
);
[
options_
,
oo_
]
=
set_ms_estimation_file
(
options_
.
ms
.
file_tag
,
options_
,
oo_
);
options_
=
set_ms_simulation_file
(
options_
);
clean_files_for_second_type_of_mex
(
M_
,
options_
,
'variance_decomposition'
)
vddir
=
[
options_
.
ms
.
output_file_tag
filesep
'Variance_Decomposition'
];
...
...
matlab/ms-sbvar/set_ms_estimation_file.m
View file @
742ed027
function
[
options_
,
oo_
]
=
set_ms_estimation_file
(
options_
,
oo_
)
function
[
options_
,
oo_
]
=
set_ms_estimation_file
(
file_tag
,
options_
,
oo_
)
%function set_ms_estimation_file()
% Set options_.ms.free_param_file based on user input
%
% INPUTS
% file_tag: (string) necessary because of different meanings of
% file_tag between ms_estimation and other ms_*
% routines
% options_: (struct) options
% oo_: (struct) results
%
...
...
@@ -30,7 +33,7 @@ function [options_, oo_]=set_ms_estimation_file(options_, oo_)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
options_
.
ms
.
free_param_file
=
[
'est_free_'
options_
.
ms
.
file_tag
'.out'
];
options_
.
ms
.
free_param_file
=
[
'est_free_'
file_tag
'.out'
];
if
~
exist
(
options_
.
ms
.
free_param_file
,
'file'
)
error
([
'ERROR: Could not find free parameter file: '
options_
.
ms
.
free_param_file
]);
end
...
...
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