Commit 4fc785f8 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

preprocessor: add weibull and weibull_pdf options for estimation and new estimation, #520

parent b5f7c905
......@@ -246,7 +246,8 @@ enum PriorDistributions
eInvGamma1 = 4,
eUniform = 5,
eInvGamma2 = 6,
eDirichlet = 7
eDirichlet = 7,
eWeibull = 8
};
struct Block_contain_type
......
......@@ -2221,6 +2221,9 @@ BasicPriorStatement::writeCShape(ostream &output) const
case eDirichlet:
output << "\"dirichlet\";" << endl;
break;
case eWeibull:
output << "\"weibull\";" << endl;
break;
case eNoShape:
assert(prior_shape != eNoShape);
}
......
......@@ -148,7 +148,7 @@ class ParsingDriver;
%token RESTRICTION RESTRICTION_FNAME CROSS_RESTRICTIONS NLAGS CONTEMP_REDUCED_FORM REAL_PSEUDO_FORECAST
%token DUMMY_OBS NSTATES INDXSCALESSTATES NO_BAYESIAN_PRIOR SPECIFICATION SIMS_ZHA
%token <string_val> ALPHA BETA ABAND NINV CMS NCMS CNUM GAMMA INV_GAMMA INV_GAMMA1 INV_GAMMA2 NORMAL UNIFORM EPS PDF FIG DR NONE PRIOR PRIOR_VARIANCE HESSIAN IDENTITY_MATRIX DIRICHLET
%token GSIG2_LMDM Q_DIAG FLAT_PRIOR NCSK NSTD
%token GSIG2_LMDM Q_DIAG FLAT_PRIOR NCSK NSTD WEIBULL WEIBULL_PDF
%token INDXPARR INDXOVR INDXAP APBAND INDXIMF IMFBAND INDXFORE FOREBAND INDXGFOREHAT INDXGIMFHAT
%token INDXESTIMA INDXGDLS EQ_MS FILTER_COVARIANCE FILTER_DECOMPOSITION
%token EQ_CMS TLINDX TLNUMBER BANACT RESTRICTIONS
......@@ -1330,6 +1330,8 @@ prior_distribution : BETA
{ $$ = eInvGamma2; }
| DIRICHLET
{ $$ = eDirichlet; }
| WEIBULL
{ $$ = eWeibull; }
;
prior_pdf : BETA_PDF
......@@ -1346,6 +1348,8 @@ prior_pdf : BETA_PDF
{ $$ = eUniform; }
| INV_GAMMA2_PDF
{ $$ = eInvGamma2; }
| WEIBULL_PDF
{ $$ = eWeibull; }
;
date_str : DATES { $$ = $1; }
......
......@@ -402,6 +402,10 @@ DATE -?[0-9]+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4][0-9]|5[0-2
yylval->string_val = new string(yytext);
return token::DIRICHLET;
}
<DYNARE_STATEMENT>weibull {
yylval->string_val = new string(yytext);
return token::WEIBULL;
}
<DYNARE_STATEMENT>normal {
yylval->string_val = new string(yytext);
return token::NORMAL;
......@@ -587,6 +591,7 @@ DATE -?[0-9]+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4][0-9]|5[0-2
<DYNARE_BLOCK>inv_gamma1_pdf {return token::INV_GAMMA1_PDF;}
<DYNARE_BLOCK>inv_gamma2_pdf {return token::INV_GAMMA2_PDF;}
<DYNARE_BLOCK>uniform_pdf {return token::UNIFORM_PDF;}
<DYNARE_BLOCK>weibull_pdf {return token::WEIBULL_PDF;}
<DYNARE_BLOCK>dsge_prior_weight {return token::DSGE_PRIOR_WEIGHT;}
<DYNARE_BLOCK>; {return Dynare::parser::token_type (yytext[0]);}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment