Occbin smoother fails after successful estimation

Hello,

After a successful estimation using Occbin, Dynare proceeded to run the smoother for a subsample of my endogenous variables (I asked for three of my 34 endogenous vars). However, the process faied with the following message:

Unable to perform assignment because the size of the left side is 0-by-17-by-0 and the size of the right side is 1-by-17-by-2.

Error in DsgeSmoother (line 455)
        aaa(:,oo_.dr.restrict_var_list,:)=aK;

Error in occbin.DSGE_smoother (line 120)
[alphahat,etahat,epsilonhat,ahat,SteadyState,trend_coeff,aK,T0,R0,P,PK,decomp,Trend,state_uncertainty,M_,oo_,bayestopt_] = DsgeSmoother(xparam1,gend,Y,data_index,missing_value,M_,oo_,options_,bayestopt_,estim_params_,occbin_options);%
T1=TT;

Error in dynare_estimation_1 (line 599)
            [atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,decomp,Trend,state_uncertainty,M_,oo_,bayestopt_] =
          occbin.DSGE_smoother(xparam1,dataset_.nobs,transpose(dataset_.data),dataset_info.missing.aindex,dataset_info.missing.state,M_,oo_,options_,bayestopt_,estim_params_,dataset_,dataset_info);

Is there an obvious reason why this might occur? I can provide files for replication, but unfortunately the estimation takes roughly 4 weeks to run, making it difficult to replicate from scratch.

UPDATE: Part of the issue is that “options_.nk” is unset and is empty, for some reason. Manually setting options_.nk = 1 before running the smoother helps. However, there is still an error because the dimensions of aK are completely wrong - aK is of size (1, 17, 2), when it is expected to be (1, 17, 69) (as I have 68 observations).

UPDATE 2: setting nk>1 fixes the problem. For example, setting nk=2 leads to aK have the dimensions 2 17 70. This seems to be caused by line 436 in “missing_DiffuseKalmanSmootherH3_Z.m”, which generates Occbin output only if nk> 1 (and otherwise does not invoke Occbin correctly).

Thanks for reporting this. I will have a deeper look in the coming days. Could you please provide me with the call to estimation and the options that you used?

Can you check whether Various fixes to smoother output (!2057) · Merge requests · Dynare / dynare · GitLab solves the issue?

Many thanks for the swift response - if still relevant, the call to estimation was:

estimation(datafile=data_Hamilton, mode_compute = 6, mh_nblocks = 20, mh_replic = 20000, mode_check, smoother_redux, graph_format = PDF, plot_priors = 0) y iSR;

While the occbin options were:

occbin_setup(likelihood_max_kalman_iterations = 40, likelihood_check_ahead_periods = 1000, smoother_maxit = 40, smoother_check_ahead_periods = 1000, likelihood_periodic_solution, smoother_periodic_solution, filter_use_relaxation);

It might take a while for me to check the updated files due to how slow the estimation is, but since I am running a near-identical estimation in any case I will update the files and let you know if I still encounter the same issue.

Thanks. There is definitely another issue with smoother_redux, see PKF: fix smoother_redux with state_uncertainty (#1862) · Issues · Dynare / dynare · GitLab

1 Like