Occbin: correctly set options_.nk
See the report at https://forum.dynare.org/t/occbin-smoother-fails-after-successful-estimation/20789 which reports a crash with
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;
and elaborates
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).