Preprocessor and ref. manual: added 'pruning' option (closes #104)

time-shift
Sébastien Villemot 2010-05-31 18:38:49 +02:00
parent c58312d3b7
commit ccaa8e6443
4 changed files with 50 additions and 3 deletions

View File

@ -2158,7 +2158,11 @@ steady;
<varlistentry>
<term><option>conditional_variance_decomposition</option> = [<replaceable>INTEGER1</replaceable> <replaceable>INTEGER2</replaceable> ...]</term>
<listitem><para>Computes a conditional variance decomposition for the specified period(s). Conditional variances are given by var(y<subscript>t+k</subscript>|t). For period 1, the conditional variance decomposition provides the decomposition of the effects of shocks upon impact.</para></listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<term><option>pruning</option></term>
<listitem><para>Discard higher order terms when iteratively computing simulations of the solution, as in <xref linkend="kim-kim-schaumburg-sims_2008"/>.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
@ -4404,5 +4408,37 @@ plot_conditional_forecast(periods = 10) e u;
</biblioentry>
<biblioentry id="kim-kim-schaumburg-sims_2008" xreflabel="Kim, Kim, Schaumburg and Sims (2008)">
<biblioset relation="article">
<authorgroup>
<author>
<surname>Kim</surname>
<firstname>Jinill</firstname>
</author>
<author>
<surname>Kim</surname>
<firstname>Sunghyun</firstname>
</author>
<author>
<surname>Schaumburg</surname>
<firstname>Ernst</firstname>
</author>
<author>
<surname>Sims</surname>
<firstname>Christopher A.</firstname>
</author>
</authorgroup>
<pubdate>2008</pubdate>
<title>Calculating and using second-order accurate solutions of discrete time dynamic equilibrium models</title>
</biblioset>
<biblioset relation="journal">
<title>Journal of Economic Dynamics and Control</title>
<volumenum>32</volumenum>
<issuenum>11</issuenum>
<pagenums>3397-3414</pagenums>
</biblioset>
</biblioentry>
</bibliography>
</book>

View File

@ -126,6 +126,15 @@ StochSimulStatement::checkPass(ModFileStructure &mod_file_struct)
if ((it != options_list.num_options.end() && it->second == "1")
|| mod_file_struct.order_option >= 3)
mod_file_struct.k_order_solver = true;
// Check that option "pruning" is not used with k-order
it = options_list.num_options.find("pruning");
if ((it != options_list.num_options.end() && it->second == "1")
&& mod_file_struct.k_order_solver)
{
cerr << "ERROR: in 'stoch_simul', you cannot use option 'pruning' with 'k_order_solver' option or with 3rd order approximation" << endl;
exit(EXIT_FAILURE);
}
}
void

View File

@ -115,7 +115,7 @@ class ParsingDriver;
%token NOGRAPH NOMOMENTS NOPRINT NORMAL_PDF
%token OBSERVATION_TRENDS OPTIM OPTIM_WEIGHTS ORDER OSR OSR_PARAMS
%token PARAMETERS PARAMETER_SET PARTIAL_INFORMATION PERIODS PLANNER_OBJECTIVE PLOT_CONDITIONAL_FORECAST PLOT_PRIORS PREFILTER PRESAMPLE
%token PRINT PRIOR_MC PRIOR_TRUNC PRIOR_MODE PRIOR_MEAN POSTERIOR_MODE POSTERIOR_MEAN POSTERIOR_MEDIAN
%token PRINT PRIOR_MC PRIOR_TRUNC PRIOR_MODE PRIOR_MEAN POSTERIOR_MODE POSTERIOR_MEAN POSTERIOR_MEDIAN PRUNING
%token <string_val> QUOTED_STRING
%token QZ_CRITERIUM FULL
%token RELATIVE_IRF REPLIC RPLOT SAVE_PARAMS_AND_STEADY_STATE
@ -843,6 +843,7 @@ stoch_simul_options : o_dr_algo
| o_partial_information
| o_conditional_variance_decomposition
| o_k_order_solver
| o_pruning
;
symbol_list : symbol_list symbol
@ -1891,6 +1892,7 @@ o_draws_nbr_mean_var_estimate : DRAWS_NBR_MEAN_VAR_ESTIMATE EQUAL INT_NUMBER {dr
o_draws_nbr_modified_harmonic_mean : DRAWS_NBR_MODIFIED_HARMONIC_MEAN EQUAL INT_NUMBER {driver.option_num("ms.draws_nbr_modified_harmonic_mean",$3); };
o_dirichlet_scale : DIRICHLET_SCALE EQUAL INT_NUMBER {driver.option_num("ms.dirichlet_scale",$3); };
o_k_order_solver : K_ORDER_SOLVER {driver.option_num("k_order_solver","1"); };
o_pruning : PRUNING { driver.option_num("pruning", "1"); };
o_chain : CHAIN EQUAL INT_NUMBER { driver.option_num("ms.chain",$3); };
o_state : STATE EQUAL INT_NUMBER { driver.option_num("ms.state",$3); };

View File

@ -351,7 +351,7 @@ int sigma_e = 0;
<DYNARE_STATEMENT>filter_covariance {return token::FILTER_COVARIANCE; }
<DYNARE_STATEMENT>filter_decomposition {return token::FILTER_DECOMPOSITION; }
<DYNARE_STATEMENT>selected_variables_only {return token::SELECTED_VARIABLES_ONLY; }
<DYNARE_STATEMENT>pruning {return token::PRUNING; };
<DYNARE_STATEMENT>[\$][^$]*[\$] {
strtok(yytext+1, "$");