Page 1 of 1

finding output gap by using Kalman filter.

Posted: Mon Jan 19, 2026 12:19 pm
by Brc
Hello,

I have GDP which is quarterly data from 1998:q1 to 2025:q1.

I am trying to find output gap by using Kalman filter. How can I write down its codes? or how can I find its codes?

Please help me to do this. Thank you.

Re: finding output gap by using Kalman filter.

Posted: Tue Jan 20, 2026 7:59 am
by TomDoan
What people usually do is to take the difference between (log) GDP and its HP filter. The HP filter is the Kalman smoothed output from a particular state-space model. See HPFILTER.RPF.