
In the IRIS toolbox mannual, on page 91, "filter()" calculate "kalman smoother and estimator of outoflikelihood 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?



specifically, i want to estimate the output gap, both expost and realtime, in the way Borio et al 2013, Rethinking potential output: Embedding information about the financial cycle, BIS wp 404.
the expost output gap conrespond to smoothing, while the realtime be the kalman fitering, (i think so).
can the filter() function do the job?



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 tt1 prediction step) or
'filter' (for data from the tt 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 subdatabases (substructs),
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

