diff --git a/doc/manual/source/the-model-file.rst b/doc/manual/source/the-model-file.rst index c52076ca1de0df9e6a6f536c10e10cf6d4f127a4..5da1ec9d2034f99ced3b773ac980a7461c0647c7 100644 --- a/doc/manual/source/the-model-file.rst +++ b/doc/manual/source/the-model-file.rst @@ -7580,7 +7580,7 @@ observed variables. Triggers the computation of the posterior distribution of IRFs. The length of the IRFs are controlled by the ``irf`` option. Results are stored in ``oo_.PosteriorIRF.dsge`` (see - below for a description of this variable). + below for a description of this variable). Not compatible with OccBin. .. option:: relative_irf @@ -7928,7 +7928,7 @@ observed variables. stored in ``oo_.PosteriorTheoreticalMoments`` (see :mvar:`oo_.PosteriorTheoreticalMoments`). The number of lags in the autocorrelation function is controlled by the ``ar`` - option. + option. Not compatible with OccBin. .. option:: contemporaneous_correlation @@ -8013,7 +8013,7 @@ observed variables. the posterior mode. If a Metropolis-Hastings is computed, the distribution of forecasts is stored in variables ``oo_.PointForecast`` and ``oo_.MeanForecast``. See - :ref:`fore`, for a description of these variables. + :ref:`fore`, for a description of these variables. Not compatible with OccBin. .. option:: tex diff --git a/matlab/estimation/dynare_estimation_1.m b/matlab/estimation/dynare_estimation_1.m index e82e4389ddcb1e9669c851d9068a8734f33bb00d..f82c3a55d437a4d54397d3444d22373e1c96bdd3 100644 --- a/matlab/estimation/dynare_estimation_1.m +++ b/matlab/estimation/dynare_estimation_1.m @@ -520,7 +520,11 @@ if issmc(options_) || (any(bayestopt_.pshape>0) && options_.mh_replic) || (any( if error_flag error('%s: I cannot compute the posterior IRFs!',dispString) end - oo_=PosteriorIRF('posterior',options_,estim_params_,oo_,M_,bayestopt_,dataset_,dataset_info,dispString); + if options_.occbin.likelihood.status + fprintf('%s: the bayesian_irf option is not compatible with the use of OccBin.',dispString) + else + oo_=PosteriorIRF('posterior',options_,estim_params_,oo_,M_,bayestopt_,dataset_,dataset_info,dispString); + end end if options_.moments_varendo if error_flag @@ -549,7 +553,11 @@ if issmc(options_) || (any(bayestopt_.pshape>0) && options_.mh_replic) || (any( end end end - oo_ = compute_moments_varendo('posterior',options_,M_,oo_,estim_params_,var_list_); + if options_.occbin.likelihood.status + fprintf('%s: the moments_varendo option is not compatible with the use of OccBin.',dispString) + else + oo_ = compute_moments_varendo('posterior',options_,M_,oo_,estim_params_,var_list_); + end end if options_.smoother || ~isempty(options_.filter_step_ahead) || options_.forecast if error_flag diff --git a/matlab/estimation/initial_estimation_checks.m b/matlab/estimation/initial_estimation_checks.m index 148a219d529b2257fb6165bbd8980e0217b6f15c..cea50c9f2f122922b2d3a71e0c029dc951b65747 100644 --- a/matlab/estimation/initial_estimation_checks.m +++ b/matlab/estimation/initial_estimation_checks.m @@ -86,6 +86,15 @@ if options_.occbin.likelihood.status || options_.occbin.smoother.status if options_.fast_kalman_filter error('initial_estimation_checks:: Occbin is incompatible with the fast Kalman filter.') end + if options_.bayesian_irf + error('initial_estimation_checks:: Occbin is incompatible with the bayesian_irf option.') + end + if options_.moments_varendo + error('initial_estimation_checks:: Occbin is incompatible with the moments_varendo option.') + end + if options_.forecast + error('initial_estimation_checks:: Occbin is incompatible with the forecast option.') + end end if (options_.occbin.likelihood.status && options_.occbin.likelihood.inversion_filter) || (options_.occbin.smoother.status && options_.occbin.smoother.inversion_filter) diff --git a/matlab/estimation/prior_posterior_statistics_core.m b/matlab/estimation/prior_posterior_statistics_core.m index 478dab2e60eda6405d0995d83c786f226f79e138..ef93127a19028e3b0f5d286b43c6f3dbbcb701cb 100644 --- a/matlab/estimation/prior_posterior_statistics_core.m +++ b/matlab/estimation/prior_posterior_statistics_core.m @@ -76,7 +76,7 @@ naK=myinputs.naK; horizon=myinputs.horizon; iendo=myinputs.iendo; IdObs=myinputs.IdObs; %index of observables -if horizon +if horizon && ~options_.occbin.smoother.status i_last_obs=myinputs.i_last_obs; MAX_nforc1=myinputs.MAX_nforc1; MAX_nforc2=myinputs.MAX_nforc2; @@ -168,7 +168,7 @@ if run_smoother stock_smoothed_constant=NaN(endo_nbr,gend,MAX_n_smoothed_constant); stock_smoothed_trend=NaN(endo_nbr,gend,MAX_n_smoothed_trend); stock_trend_coeff = zeros(endo_nbr,MAX_n_trend_coeff); - if horizon + if horizon && ~options_.occbin.smoother.status stock_forcst_mean= NaN(endo_nbr,horizon,MAX_nforc1); stock_forcst_point = NaN(endo_nbr,horizon,MAX_nforc2); if ~isequal(M_.H,0) @@ -328,7 +328,7 @@ for b=fpar:B end end end - if horizon + if horizon && ~options_.occbin.smoother.status yyyy = alphahat(iendo,i_last_obs); yf = simulate_posterior_forecasts(yyyy,dr,horizon,false,M_.Sigma_e,1); if options_.prefilter @@ -563,7 +563,7 @@ dyn_waitbar_close(h); function yf=simulate_posterior_forecasts(y0,dr,horizon,stochastic_indicator,Sigma_e,n) -% function yf=forcst2(y0,horizon,dr,n) +% function yf=simulate_posterior_forecasts(y0,horizon,dr,n) % % computes forecasts based on first order model solution, given shocks % drawn from the shock distribution, but not including measurement error