Kishor Koenig Model of Data Revisions
Kishor Koenig Model of Data Revisions
Hi
I would like to implement the Kishor Koenig (JBES 2012 and JMCB 2014) procedure for forecasting with data that are subject to revision. The basic model is as follows:
gdp = revised / efficient / "final" gdp estimate
gdp0 = initial gdp estimate
cr = credit variable etc.
rev = gdp - gdp0 = revision to gdp estimate
The system consists of three state equations and on measurement equation (which is an identity):
gdp = f10 + f11 * gdp(-1) + f12 * cr(-1) + u1
cr = f20 + f21 * gdp(-1) + f22 * cr(-1) + u2
rev = k0 + k1 * rev(-1) + u3
gdp0 = gdp - rev (identity)
The first three (state) equations are estimated by SUR since the random errors are likely to be correlated. The revised value of gdp is observed with a one quarter lag. The Kalman filter is used to generate an estimate of gdp at T and forecast gdp at T+1 ... T+5 say.
I would like to implement the Kishor Koenig (JBES 2012 and JMCB 2014) procedure for forecasting with data that are subject to revision. The basic model is as follows:
gdp = revised / efficient / "final" gdp estimate
gdp0 = initial gdp estimate
cr = credit variable etc.
rev = gdp - gdp0 = revision to gdp estimate
The system consists of three state equations and on measurement equation (which is an identity):
gdp = f10 + f11 * gdp(-1) + f12 * cr(-1) + u1
cr = f20 + f21 * gdp(-1) + f22 * cr(-1) + u2
rev = k0 + k1 * rev(-1) + u3
gdp0 = gdp - rev (identity)
The first three (state) equations are estimated by SUR since the random errors are likely to be correlated. The revised value of gdp is observed with a one quarter lag. The Kalman filter is used to generate an estimate of gdp at T and forecast gdp at T+1 ... T+5 say.
Re: Kishor Koenig Model of Data Revisions
Apologies
Here is the rest of my query.
I set the equations up as system but I got an error message when I tried to use the Kalman filter command (within a loop to produce dynamic, recursive forecasts):
## VAR4. SYSTEM definition is incomplete or has empty model
The Error Occurred At Location 57, Line 2 of loop/block
Does the Kalman filter handle identities, or do I have to use the DLM command?
Thanks
Anthony
Here is the rest of my query.
I set the equations up as system but I got an error message when I tried to use the Kalman filter command (within a loop to produce dynamic, recursive forecasts):
## VAR4. SYSTEM definition is incomplete or has empty model
The Error Occurred At Location 57, Line 2 of loop/block
Does the Kalman filter handle identities, or do I have to use the DLM command?
Thanks
Anthony
Re: Kishor Koenig Model of Data Revisions
You have to use DLM which is the right choice anyway. (The Kalman filter in SYSTEM is for handling time-varying coefficients, not general state-space models).
Did they use SUR to estimate the coefficients? It seems like that's not fully using the information that's available---aren't CR and GDP0 both available a period before GDP? I would suggest setting up the state space model in GDP, CR and REV as written, with a measurement equation for GDP,CR, and GDP0. The last period would have ||%NA,CR,GDP0|| as the observable for the final data point.
Did they use SUR to estimate the coefficients? It seems like that's not fully using the information that's available---aren't CR and GDP0 both available a period before GDP? I would suggest setting up the state space model in GDP, CR and REV as written, with a measurement equation for GDP,CR, and GDP0. The last period would have ||%NA,CR,GDP0|| as the observable for the final data point.
Re: Kishor Koenig Model of Data Revisions
This shows how to set up and use the state-space model that I described above. Prof. Kishor graciously (and expeditiously!) provided the data for Kishor and Koenig(2014), "Credit Indicators as Predictors of Economic Activity: A Real-Time VAR Analysis", JMCB, vol 46, 545–564.
DLM can handle both the estimation and the prediction in (effectively) one step. The estimates will differ from those from SUR in a couple of ways:
1. The SUR estimates have to use a truncated sample since the credit variable (SLO in this case) isn't available for the first four years.
2. SUR also has to skip the first observation to allow for the lags in the observables while DLM can use the full sample since it can use the ergodic mean and variance for the first data point. (I believe they actually skipped the first four observations of the complete data set).
Since it's a small model and you have to set up the state space formulation anyway to do the KF forecasts, it's easier to just let DLM do the estimation instead of a separate calculation.
DLM can handle both the estimation and the prediction in (effectively) one step. The estimates will differ from those from SUR in a couple of ways:
1. The SUR estimates have to use a truncated sample since the credit variable (SLO in this case) isn't available for the first four years.
2. SUR also has to skip the first observation to allow for the lags in the observables while DLM can use the full sample since it can use the ergodic mean and variance for the first data point. (I believe they actually skipped the first four observations of the complete data set).
Since it's a small model and you have to set up the state space formulation anyway to do the KF forecasts, it's easier to just let DLM do the estimation instead of a separate calculation.
Code: Select all
OPEN DATA "C:\RATS\replications\Kishor Koenig JMCB 2014 (not done)\unused\gdp_1.wf1"
CALENDAR(Q) 1980:1
DATA(FORMAT=WF1) 1980:01 2012:01 DRGDP_0 DRGDP_1 DRGDP_8 E1 RESID SLO
*
* e1 is in the data set already, but we'll compute the revision from
* the original data.
*
set rev = drgdp_1-drgdp_0
*
dec symm sw(3,3)
nonlin f10 f11 f12 f20 f21 f22 k0 k1 sw
*
* The states are the final GDP value, the credit value (SLO) and the
* revision. The first two are governed by a bivariate VAR, the last by a
* univariate autoregression.
*
dec frml[rect] af
frml af = ||f11,f12,0.0|$
f21,f22,0.0|$
0.0,0.0,k1||
dec frml[vect] zf
frml zf = ||f10,f20,k0||
*
* The observables are the final GDP, SLO and the preliminary GDP. The
* first two are directly in the state vector with no error while the
* last is generated as the gap between the final GDP and the revision.
* In this case, SLO isn't available until four years into the data set
* and, in practice, final GDP won't be available at the end of the data
* set. Thus YF will have a mix of data and NA's at various points in the
* data set.
*
dec frml[vect] yf
frml yf = ||drgdp_1,slo,drgdp_0||
dec rect c(3,3)
input c
1 0 1
0 1 0
0 0 -1
*
* Get guess values from linear regressions
*
linreg drgdp_1 / ey1
# constant drgdp_1{1} slo{1}
compute f10=%beta(1),f11=%beta(2),f12=%beta(3)
linreg slo / ey2
# constant drgdp_1{1} slo{1}
compute f20=%beta(1),f21=%beta(2),f22=%beta(3)
linreg rev / ey3
# constant rev{1}
compute k0=%beta(1),k1=%beta(2)
vcv(matrix=sw)
# ey1 ey2 ey3
*
* Estimate the model using the available data. Note that this shows 129
* observations but the rank of observables is only 371. This is due to
* SLO being missing for the first sixteen entries.
*
dlm(method=bfgs,y=yf,c=c,sw=sw,a=af,z=zf,presample=ergodic) / xstates vstates
*
* Suppose we withhold the last year of final GDP and re-do everything.
* Then the first component of XSTATES will be the Kalman filter
* predicted value of final GDP.
*
set drgdp_1x = %if(t<=2011:1,drgdp_1,%na)
dlm(method=bfgs,y=||drgdp_1x,slo,drgdp_0||,c=c,sw=sw,a=af,z=zf,presample=ergodic) / xstates vstates
*
set drgdp_1kf 2011:2 2012:1 = xstates(t)(1)
print 2011:2 2012:1 drgdp_1kf drgdp_1 drgdp_0
- Attachments
-
- gdp_1.wf1
- Data file
- (26.17 KiB) Downloaded 985 times
Re: Kishor Koenig Model of Data Revisions
Hi,
i am doing to estimate Translog cost functions by SUR method.is it available special code of SUR method in rats software ? -is it possible using the SUR in VAR method ??
thanks so much
i am doing to estimate Translog cost functions by SUR method.is it available special code of SUR method in rats software ? -is it possible using the SUR in VAR method ??
thanks so much
Re: Kishor Koenig Model of Data Revisions
Does this have anything to do with the topic of this thread? It sounds like you would use either SUR or NLSYSTEM depending upon the form of the model.