One sided hp filter in dynare version 4.3.3

Dear All,
I am trying to use one sided hp filter in my model. I used the following command using dynare 4.3.3 is not working
[ytrend,ycycle]=one_sided_hp_filter([y gov ik c k h],100,100);
It gives me the following error:
Index in position 2 exceeds array bounds (must not exceed 1).
Error in one_sided_hp_filter (line 77)
x=x_user(:,k);

Any suggestion please!!

First I do not know if this function was available in Dynare 4.3.3. Why do you not use the lastest version ? We recently fixed a bug in this function.

You should first read the header of the function available here, before using it. Clearly your calling sequence is wrong.

Best,
Stéphane.

Thank you Stephane,
I used a dyanre version 4.5.3, but unfortunately could not find the steady state which I found in version 4.3.3… I do not know why this happened. I will try to download the newest version and see what happens.

Best regards,

Dear Stéphane,

I used the new version of dynare and used the same mod file used in the previous version. I could not find the steady state. Any idea why is this happening?
Second, you have told me that the calling sequence is wrong, Can you please advice me how to do it?
Third, what is meant by x_user and p_user and how to model both in the syntax, since I am confused.

Best regards,

Hi, for the steady state I cannot say without a mod file, you should post it on the forum. This may be a bug, if it was working with older releases of Dynare. Regarding the second question, all is explained in the header of the matlab function. The one sided HP filter is implemented by (Kalman) filtering a state space model. The third and fourth inputs of the function are the initial conditions of the filter (for the expectation and variance of the state vector). The second argument is the smoothness parameter \lambda. If you have no idea about the initial condition you should provide only two arguments to the function:

[ytrend, ycycle] = one_sided_hp_filter([y gov ik c k h], 1600);

Best,
Stéphane.

Dear Stéphane,

I would like to thank you, now the code is working. I really appreciate your help.

Best regards,