diff --git a/doc/manual/source/the-model-file.rst b/doc/manual/source/the-model-file.rst index 064ba0c51f7c3b046a7af47ff476f5900d4b9347..63ba6916c020bb55d5c191b941ddff365b7e811b 100644 --- a/doc/manual/source/the-model-file.rst +++ b/doc/manual/source/the-model-file.rst @@ -7461,7 +7461,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 @@ -7753,7 +7753,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 @@ -7838,7 +7838,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 21ccfa542184e5a875280207ff8b43198b0634c9..2800c84b089a15eab551e0685ec3098e600fa517 100644 --- a/matlab/estimation/dynare_estimation_1.m +++ b/matlab/estimation/dynare_estimation_1.m @@ -514,7 +514,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 else fprintf('%s: SMC does not yet support the bayesian_irf option. Skipping computation.\n',dispString); end @@ -543,7 +547,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 else fprintf('%s: SMC does not yet support the moments_varendo option. Skipping computation.\n',dispString); end 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 65660dabb59324575ac2bbcee33e3d90c0aff31b..f10585aca1e784c369d8588d2b04dad6f541790d 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; @@ -167,7 +167,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) @@ -310,7 +310,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 @@ -545,7 +545,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