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
fd2d3b0e
Commit
fd2d3b0e
authored
Dec 30, 2011
by
Houtan Bastani
Browse files
preprocessor: added back prior names w/o _pdf and fixed check and write
parent
6c5722ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
preprocessor/ComputingTasks.cc
View file @
fd2d3b0e
...
...
@@ -1669,7 +1669,7 @@ BasicPriorStatement::BasicPriorStatement(const string &name_arg,
void
BasicPriorStatement
::
checkPass
(
ModFileStructure
&
mod_file_struct
)
{
if
(
options_list
.
string_options
.
find
(
"
shape
"
)
==
options_list
.
string_options
.
end
()
)
if
(
prior_
shape
==
eNoShape
)
{
cerr
<<
"ERROR: You must pass the shape option to the prior statement."
<<
endl
;
exit
(
EXIT_FAILURE
);
...
...
@@ -1732,7 +1732,7 @@ void
BasicPriorStatement
::
writeShape
(
ostream
&
output
,
const
string
&
lhs_field
)
const
{
assert
(
prior_shape
!=
eNoShape
);
output
<<
"estimation_info"
<<
lhs_field
<<
"(prior_indx).shape = "
<<
prior_shape
;
output
<<
"estimation_info"
<<
lhs_field
<<
"(prior_indx).shape = "
<<
prior_shape
<<
";"
<<
endl
;
}
PriorStatement
::
PriorStatement
(
const
string
&
name_arg
,
...
...
preprocessor/DynareBison.yy
View file @
fd2d3b0e
...
...
@@ -183,7 +183,7 @@ class ParsingDriver;
%type <symbol_type_val> change_type_arg
%type <vector_string_val> change_type_var_list
%type <vector_int_val> vec_int_elem vec_int_1 vec_int vec_int_number
%type <prior_distributions_val> prior_pdf
%type <prior_distributions_val> prior_pdf
prior_distribution
%%
%start statement_list;
...
...
@@ -1159,6 +1159,22 @@ estimated_bounds_elem : STDERR symbol COMMA expression COMMA expression ';'
}
;
prior_distribution : BETA
{ $$ = eBeta; }
| GAMMA
{ $$ = eGamma; }
| NORMAL
{ $$ = eNormal; }
| INV_GAMMA
{ $$ = eInvGamma; }
| INV_GAMMA1
{ $$ = eInvGamma1; }
| UNIFORM
{ $$ = eUniform; }
| INV_GAMMA2
{ $$ = eInvGamma2; }
;
prior_pdf : BETA_PDF
{ $$ = eBeta; }
| GAMMA_PDF
...
...
@@ -1975,7 +1991,7 @@ o_last_obs : LAST_OBS EQUAL date_number
{ driver.option_date("last_obs", $3); }
;
o_shift : SHIFT EQUAL signed_number { driver.option_num("shift", $3); };
o_shape : SHAPE EQUAL prior_
pdf
{ driver.prior_shape = $3; };
o_shape : SHAPE EQUAL prior_
distribution
{ driver.prior_shape = $3; };
o_mode : MODE EQUAL signed_number { driver.option_num("mode", $3); };
o_mean : MEAN EQUAL signed_number { driver.option_num("mean", $3); };
o_stdev : STDEV EQUAL non_negative_number { driver.option_num("stdev", $3); };
...
...
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