This project is read-only.

Question about function "filter()"

Topics: Kalman Filtering
Jul 15, 2015 at 3:29 AM
In the IRIS toolbox mannual, on page 91, "filter()" calculate "kalman smoother and estimator of out-of-likelihood parameters"; on page 93, "data=[predict\smooth\predict,smooth] return smoother data or prediction data or both".
According to definition given by Durbin and Koopman, "time series analysis by state space methods", oxford, 2001, state space analysis consists filtering, smoothing and forecasting. Filtering means calculate a(t+1) and P(t+1) conditioning on y1,...yt; Smoothing means estimation of a(1), ..., a(n) given the entire sample y1,...yn; Forecasting means to forecast y(n+j) given y1,...yn.
So, my question is according the definition above, what does the iris toolbox filter() function actural do, smoothing and prediction, or smoothing and filtering?
Can i get filtering data that is a(t+1)|y1,...yt using the filter function?
Jul 15, 2015 at 6:47 PM
specifically, i want to estimate the output gap, both ex-post and real-time, in the way Borio et al 2013, Rethinking potential output: Embedding information about the financial cycle, BIS wp 404.
the ex-post output gap conrespond to smoothing, while the real-time be the kalman fitering, (i think so).
can the filter() function do the job?
Jul 17, 2015 at 8:36 PM
Yes, IRIS runs all three steps. You can use the option 'output=' to request what kind of output data you wish to get. By default, it is 'smoother' but you can instead request 'predict' (for data from the t|t-1 prediction step) or 'filter' (for data from the t|t filter, or "updating", step). For instance,
[~,f] = filter(m,d,range,'output=','filter',...)
where ... stands for you other options used. You can also specify any combination of the three. If you wish to get all three, simply run
[~,f] = filter(m,d,range,'output=','smooth,filter,predict',...)
and the output database (struct) f will have three sub-databases (sub-structs), f.smooth, f.filter, and f.predict.

Note also that in your original question, a(t+1)|y(1)...y(t) refers not to filter(ing) data, but prediction data. Filter(ing) data is defined as a(t)|y(1)...y(t).

Hope this helps.

Best,
Jaromir
Marked as answer by jaromirbenes on 7/17/2015 at 12:36 PM