preprocessor: bug fix in setting prior_variance
parent
e2f69ab4fc
commit
ed82146c37
|
@ -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); };
|
||||||
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); };
|
||||||
|
|
|
@ -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)
|
||||||
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)
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue