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
8747d91d
Commit
8747d91d
authored
Sep 13, 2011
by
Houtan Bastani
Browse files
MS-SBVAR: fix processing for ms_estimation
parent
d115a112
Changes
6
Hide whitespace changes
Inline
Side-by-side
matlab/ms-sbvar/initialize_ms_sbvar_options.m
View file @
8747d91d
...
...
@@ -32,12 +32,10 @@ function options_=initialize_ms_sbvar_options(M_, options_)
% MS SBVAR
% all mex functions
options_
.
ms
.
file_tag
=
M_
.
fname
;
if
isfield
(
options_
.
ms
,
'initialization_file_tag'
)
options_
.
ms
=
rmfield
(
options_
.
ms
,
'initialization_file_tag'
);
end
if
isfield
(
options_
.
ms
,
'estimation_file_tag'
)
options_
.
ms
=
rmfield
(
options_
.
ms
,
'estimation_file_tag'
);
end
options_
.
ms
.
create_init
=
1
;
if
isfield
(
options_
.
ms
,
'free_param_file'
)
options_
.
ms
=
rmfield
(
options_
.
ms
,
'free_param_file'
);
end
...
...
matlab/ms-sbvar/ms_estimation.m
View file @
8747d91d
...
...
@@ -33,14 +33,18 @@ function [options_, oo_]=ms_estimation(M_, options_, oo_)
disp
(
'MS-SBVAR Estimation'
);
options_
=
set_file_tags
(
options_
);
clean_ms_estimation_files
(
options_
.
ms
.
output_file_tag
);
% general setup
if
~
isfield
(
options_
.
ms
,
'initialization_file_tag'
)
clean_ms_init_files
(
options_
.
ms
.
output_
file_tag
);
if
options_
.
ms
.
create_init
clean_ms_init_files
(
options_
.
ms
.
file_tag
);
ms_sbvar_setup
(
options_
);
clean_ms_estimation_files
(
options_
.
ms
.
file_tag
);
clean_ms_estimation_files
(
options_
.
ms
.
output_file_tag
);
else
if
~
strcmp
(
options_
.
ms
.
file_tag
,
options_
.
ms
.
output_file_tag
)
clean_ms_estimation_files
(
options_
.
ms
.
output_file_tag
);
end
end
options_
=
set_ms_init_file
(
options_
);
% setup command line options
opt
=
[
'-estimate -seed '
num2str
(
options_
.
DynareRandomStreams
.
seed
)];
...
...
matlab/ms-sbvar/ms_sbvar_setup.m
View file @
8747d91d
...
...
@@ -434,7 +434,7 @@ fclose(fidForC);
%== Create C initialization filename
%======================================================================
ms_write_markov_file
(
markov_file
,
options_
)
create_init_file
=
[
matlab_filename
,
' '
,
markov_file
,
' '
,
options_
.
ms
.
output_
file_tag
];
create_init_file
=
[
matlab_filename
,
' '
,
markov_file
,
' '
,
options_
.
ms
.
file_tag
];
[
err
]
=
ms_sbvar_create_init_file
(
create_init_file
);
mexErrCheck
(
'ms_sbvar_create_init_file'
,
err
);
end
matlab/ms-sbvar/set_ms_init_file.m
deleted
100644 → 0
View file @
d115a112
function
options_
=
set_ms_init_file
(
options_
)
%function set_ms_init_file()
% Set options_.ms.init_file based on user input
%
% INPUTS
% options_: (struct) options
% oo_: (struct) results
%
% OUTPUTS
% oo_: (struct) results
%
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2011 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 <http://www.gnu.org/licenses/>.
if
~
isfield
(
options_
.
ms
,
'initialization_file_tag'
)
options_
.
ms
.
initialization_file_tag
=
options_
.
ms
.
output_file_tag
;
end
options_
.
ms
.
init_file
=
[
'init_'
options_
.
ms
.
initialization_file_tag
'.dat'
];
if
~
exist
(
options_
.
ms
.
init_file
,
'file'
)
error
([
'ERROR: Could not find initialization file: '
options_
.
ms
.
init_file
]);
end
end
preprocessor/DynareBison.yy
View file @
8747d91d
...
...
@@ -159,7 +159,7 @@ class ParsingDriver;
%token SVAR COEFFICIENTS VARIANCES CONSTANTS EQUATIONS
%token EXTERNAL_FUNCTION EXT_FUNC_NAME EXT_FUNC_NARGS FIRST_DERIV_PROVIDED SECOND_DERIV_PROVIDED
%token SELECTED_VARIABLES_ONLY COVA_COMPUTE ESTIMATION_FILE_TAG SIMULATION_FILE_TAG FILE_TAG
%token NO_ERROR_BANDS ERROR_BAND_PERCENTILES SHOCKS_PER_PARAMETER
INITIALIZATION_FILE_TAG
%token NO_ERROR_BANDS ERROR_BAND_PERCENTILES SHOCKS_PER_PARAMETER
NO_CREATE_INIT
%token SHOCK_DRAWS FREE_PARAMETERS MEDIAN DATA_OBS_NBR NEIGHBORHOOD_WIDTH PVALUE_KS PVALUE_CORR
%token FILTERED_PROBABILITIES FILTERED REAL_TIME_SMOOTHED
%token PROPOSAL_TYPE MDD_PROPOSAL_DRAWS MDD_USE_MEAN_CENTER
...
...
@@ -1630,7 +1630,7 @@ ms_estimation_option : o_coefficients_prior_hyperparameters
| o_gsig2_lmdm
| o_output_file_tag
| o_file_tag
| o_
initialization_file_tag
| o_
no_create_init
| o_convergence_starting_value
| o_convergence_ending_value
| o_convergence_increment_value
...
...
@@ -2087,7 +2087,7 @@ o_cova_compute : COVA_COMPUTE EQUAL INT_NUMBER
;
o_output_file_tag : OUTPUT_FILE_TAG EQUAL filename {driver.option_str("ms.output_file_tag", $3); };
o_file_tag : FILE_TAG EQUAL filename { driver.option_str("ms.file_tag", $3); };
o_
initialization_file_tag : INITIALIZATION_FILE_TAG EQUAL filename { driver.option_str("ms.initialization_file_tag", $3
); };
o_
no_create_init : NO_CREATE_INIT { driver.option_str("ms.create_init", "0"
); };
o_estimation_file_tag : ESTIMATION_FILE_TAG EQUAL filename { driver.option_str("ms.estimation_file_tag", $3); };
o_simulation_file_tag : SIMULATION_FILE_TAG EQUAL filename { driver.option_str("ms.simulation_file_tag", $3); };
o_coefficients_prior_hyperparameters : COEFFICIENTS_PRIOR_HYPERPARAMETERS EQUAL vec_value
...
...
preprocessor/DynareFlex.ll
View file @
8747d91d
...
...
@@ -320,7 +320,7 @@ string eofbuff;
<DYNARE_STATEMENT>output_file_tag {return token::OUTPUT_FILE_TAG;}
<DYNARE_STATEMENT>file_tag {return token::FILE_TAG;};
<DYNARE_STATEMENT>
initialization_file_tag {return token::INITIALIZATION_FILE_TAG
;};
<DYNARE_STATEMENT>
no_create_init {return token::NO_CREATE_INIT
;};
<DYNARE_STATEMENT>estimation_file_tag {return token::ESTIMATION_FILE_TAG;};
<DYNARE_STATEMENT>simulation_file_tag {return token::SIMULATION_FILE_TAG;};
<DYNARE_STATEMENT>filtered {return token::FILTERED;}
...
...
Write
Preview
Supports
Markdown
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