Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
preprocessor
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
preprocessor
Commits
c62d52a5
Commit
c62d52a5
authored
13 years ago
by
Houtan Bastani
Browse files
Options
Downloads
Patches
Plain Diff
preprocessor: bug fix in setting prior_variance
parent
340a9fb5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
DynareBison.yy
+5
-5
5 additions, 5 deletions
DynareBison.yy
ParsingDriver.cc
+4
-4
4 additions, 4 deletions
ParsingDriver.cc
ParsingDriver.hh
+1
-1
1 addition, 1 deletion
ParsingDriver.hh
with
10 additions
and
10 deletions
DynareBison.yy
+
5
−
5
View file @
c62d52a5
...
@@ -1223,16 +1223,16 @@ subsamples_name_list : subsamples_name_list COMMA o_subsample_name
...
@@ -1223,16 +1223,16 @@ subsamples_name_list : subsamples_name_list COMMA o_subsample_name
| o_subsample_name
| o_subsample_name
;
;
prior : symbol '.' PRIOR '(' prior_options_list ')' ';'
prior : symbol '.' PRIOR
{ driver.set_prior_variance(); }
'(' prior_options_list ')' ';'
{ driver.set_prior($1); }
{ driver.set_prior($1); }
| symbol '.' symbol '.' PRIOR '(' prior_options_list ')' ';'
| symbol '.' symbol '.' PRIOR
{ driver.set_prior_variance(); }
'(' prior_options_list ')' ';'
{
{
driver.add_subsample_range(new string (*$1), $3);
driver.add_subsample_range(new string (*$1), $3);
driver.set_prior($1);
driver.set_prior($1);
}
}
| STD '(' symbol ')' '.' PRIOR '(' prior_options_list ')' ';'
| STD '(' symbol ')' '.' PRIOR
{ driver.set_prior_variance(); }
'(' prior_options_list ')' ';'
{ driver.set_std_prior($3); }
{ driver.set_std_prior($3); }
| CORR '(' symbol COMMA symbol')' '.' PRIOR '(' prior_options_list ')' ';'
| CORR '(' symbol COMMA symbol')' '.' PRIOR
{ driver.set_prior_variance(); }
'(' prior_options_list ')' ';'
{ driver.set_corr_prior($3, $5); }
{ driver.set_corr_prior($3, $5); }
;
;
...
@@ -2000,7 +2000,7 @@ o_init : INIT EQUAL signed_number { driver.option_num("init", $3); };
...
@@ -2000,7 +2000,7 @@ o_init : INIT EQUAL signed_number { driver.option_num("init", $3); };
o_bounds : BOUNDS EQUAL vec_value_w_inf { driver.option_num("bounds", $3); };
o_bounds : BOUNDS EQUAL vec_value_w_inf { driver.option_num("bounds", $3); };
o_domain : DOMAINN EQUAL vec_value { driver.option_num("domain", $3); };
o_domain : DOMAINN EQUAL vec_value { driver.option_num("domain", $3); };
o_interval : INTERVAL EQUAL vec_value { driver.option_num("interval", $3); };
o_interval : INTERVAL EQUAL vec_value { driver.option_num("interval", $3); };
o_variance : VARIANCE EQUAL expression { driver.
add_expression_to_prior_statement
($3); }
o_variance : VARIANCE EQUAL expression { driver.
set_prior_variance
($3); }
o_new_estimation_data_nobs : NOBS EQUAL INT_NUMBER { driver.option_num("nobs", $3); };
o_new_estimation_data_nobs : NOBS EQUAL INT_NUMBER { driver.option_num("nobs", $3); };
o_prefilter : PREFILTER EQUAL INT_NUMBER { driver.option_num("prefilter", $3); };
o_prefilter : PREFILTER EQUAL INT_NUMBER { driver.option_num("prefilter", $3); };
o_presample : PRESAMPLE EQUAL INT_NUMBER { driver.option_num("presample", $3); };
o_presample : PRESAMPLE EQUAL INT_NUMBER { driver.option_num("presample", $3); };
...
...
This diff is collapsed.
Click to expand it.
ParsingDriver.cc
+
4
−
4
View file @
c62d52a5
...
@@ -1305,12 +1305,12 @@ ParsingDriver::set_prior(string *name)
...
@@ -1305,12 +1305,12 @@ ParsingDriver::set_prior(string *name)
check_symbol_is_parameter
(
name
);
check_symbol_is_parameter
(
name
);
mod_file
->
addStatement
(
new
PriorStatement
(
*
name
,
prior_variance
,
options_list
));
mod_file
->
addStatement
(
new
PriorStatement
(
*
name
,
prior_variance
,
options_list
));
options_list
.
clear
();
options_list
.
clear
();
prior_variance
=
NULL
;
set_
prior_variance
()
;
delete
name
;
delete
name
;
}
}
void
void
ParsingDriver
::
add_expression_to_prior_statement
(
expr_t
variance
)
ParsingDriver
::
set_prior_variance
(
expr_t
variance
)
{
{
prior_variance
=
variance
;
prior_variance
=
variance
;
}
}
...
@@ -1346,7 +1346,7 @@ ParsingDriver::set_std_prior(string *name)
...
@@ -1346,7 +1346,7 @@ ParsingDriver::set_std_prior(string *name)
check_symbol_is_endogenous_or_exogenous
(
name
);
check_symbol_is_endogenous_or_exogenous
(
name
);
mod_file
->
addStatement
(
new
StdPriorStatement
(
*
name
,
prior_variance
,
options_list
,
mod_file
->
symbol_table
));
mod_file
->
addStatement
(
new
StdPriorStatement
(
*
name
,
prior_variance
,
options_list
,
mod_file
->
symbol_table
));
options_list
.
clear
();
options_list
.
clear
();
prior_variance
=
NULL
;
set_
prior_variance
()
;
delete
name
;
delete
name
;
}
}
...
@@ -1366,7 +1366,7 @@ ParsingDriver::set_corr_prior(string *name1, string *name2)
...
@@ -1366,7 +1366,7 @@ ParsingDriver::set_corr_prior(string *name1, string *name2)
check_symbol_is_endogenous_or_exogenous
(
name2
);
check_symbol_is_endogenous_or_exogenous
(
name2
);
mod_file
->
addStatement
(
new
CorrPriorStatement
(
*
name1
,
*
name2
,
prior_variance
,
options_list
,
mod_file
->
symbol_table
));
mod_file
->
addStatement
(
new
CorrPriorStatement
(
*
name1
,
*
name2
,
prior_variance
,
options_list
,
mod_file
->
symbol_table
));
options_list
.
clear
();
options_list
.
clear
();
prior_variance
=
NULL
;
set_
prior_variance
()
;
delete
name1
;
delete
name1
;
delete
name2
;
delete
name2
;
}
}
...
...
This diff is collapsed.
Click to expand it.
ParsingDriver.hh
+
1
−
1
View file @
c62d52a5
...
@@ -389,7 +389,7 @@ public:
...
@@ -389,7 +389,7 @@ public:
//! Sets the prior for a parameter
//! Sets the prior for a parameter
void
set_prior
(
string
*
arg
);
void
set_prior
(
string
*
arg
);
//! Adds the variance option to its temporary holding place
//! Adds the variance option to its temporary holding place
void
add_expression_to_prior_statement
(
expr_t
variance
);
void
set_prior_variance
(
expr_t
variance
=
NULL
);
//! Sets the options for a parameter
//! Sets the options for a parameter
void
set_options
(
string
*
arg
);
void
set_options
(
string
*
arg
);
//! Sets the prior for estimated std dev
//! Sets the prior for estimated std dev
...
...
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