Forward Guidance Open Economy

Dear all,

I was trying to to implement a forward guidance shock (interest rate = 0) for four periods. It is a two country DSGE model and only domestic country follows forward guidance. I can solve the model with stochastic and deterministic simulations, but I cannot solve it when there is a forward guidance shock. I tried to follow the example of @jpfeifer (NK_linear_forward_guidance.mod) but I have the following error messages

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

Error in csolve (line 80)
** grad(:,i) = (feval(FUN,x+tvec(:,i),varargin{:})-f0)/delta;**

Error in DGNT (line 366)
[x, errorflag] = csolve(‘distance’,start_value,[],1e-6,500,shock_name,target_value,target_name,M_,options_,oo_);

Error in dynare (line 235)
evalin(‘base’,fname) ;

Thank you for your help.
Best,
Guido Traficante

DGNT.mod (5.1 KB)

I would need to see the distance.m-function as well.

Thanks for the reply, actually I used the same distance.m you created because I believed that the problem was equivalent (ie find a value of the shock which makes the policy rate constant for k periods). Am I wrong?

You forgot to change the name of the target variable. Use
DGNT.mod (5.1 KB)

Thanks a lot Johannes, now it works!
Best regards,
Guido