'====================================================== 'This program estimates Okun's Law using least squares (our "constant coefficient" model) and the Kalman 'filter, and derives a measure of potential output 'The program reproduces estimates reported in: 'Lancaster D and P Tulip (2015), 'Okun's Law and Potential Output', 'RBA Research Discussion Paper 2015-14. 'Created by: David Lancaster 'Created: 25 June 2015 '===================================================== '================= 'GLOBAL SETTINGS '================= %sd = "1959q3" 'Workfile start date %ed = "2020q4" 'Workfile end date %estsd = "1960q3" 'Estimation start date %ested = "2015q1" 'Estimation end date '================== 'CREATE WORKFILE '================== 'File path %directory = @runpath cd %directory %wkfile = %directory + "potential_okun.wf1" 'Location of workfile %data = %directory + "data.xls" 'Location of data file 'Create workfile close %wkfile workfile %wkfile q %sd %ed '============= 'IMPORT DATA '============= read(b2, s=sheet1) %data 3 '================== 'DATA PREPARATION '================== 'Change in the unemployment rate series dur = d(ur) 'Two-quarter GDP growth, annualised log changes series lgdp = log(gdp) series d2lgdp = 400* (lgdp-lgdp(-2))/2 'Two-quarter change in real unit labour costs, annualised log changes series lrulc = log(rulc) series d2lrulc = 400* (lrulc-lrulc(-2))/2 '===================== ' CONSTANT COEFFICIENTS MODEL '===================== smpl %estsd %ested coef(4) c1 equation okuneq1.ls(cov=white) dur = c1(2)*dur(-1) + c1(3)*(d2lgdp-c1(1)) + c1(4)*d2lrulc(-2) 'Model 1 show okuneq1 '========================== ' SPECIFY THE KALMAN FILTER '========================== 'Priors on state variables vector(2) mprior mprior(1) = 4 'Prior on starting value for trend GDP growth (annual average GDP growth over 1950s) mprior(2) = 0 'Prior on starting value for lagged dependent variable sym(2) vprior vprior(1,1) = 5 'Prior on variance of trend GDP growth (variance of annual GDP growth over 1950s) vprior(2,2) = 1 'Prior on variance of lagged dependent variable 'Specify coefficient vector coef(8) ckf 'Declare state space sspace ss1 ss1.append dur = lag*dur(-1) + ckf(2)*(d2lgdp-trend)+ckf(3)*D2LRULC(-2)+[var=exp(ckf(4))] 'Measurement equation ss1.append @state trend = 1*trend(-1) + [var = exp(ckf(5))] 'State equation for trend GDP growth (random walk) ss1.append @state lag = 1*lag(-1) + [var = exp(ckf(6))] 'State equation for lagged dependent variable (random walk) 'Apply priors to state space ss1.append @mprior mprior ss1.append @vprior vprior 'Set parameter starting values param ckf(2) -0.0495 ckf(3) 0.01942 ckf(4) -2.8913 ckf(5) -4.1757 ckf(6) -6.2466 'starting values for parameters '===================== ' ESTIMATE THE MODEL '===================== 'Estimate state space smpl %estsd %ested 'Estimation sample ss1.ml(m=500,showopts) 'Estimate Kalman filter by maximum likelihood freeze(mytab) ss1.stats '===================== ' SAVE STATE VARIABLES '===================== ss1.makestates(t=filt) *filt 'Construct one-sided filtered estimates of trend GDP growth and coefficient on lagged dependent variable ss1.makestates(t=filtse) *filtse 'Standard error of estimate 'Graph state variables smpl 1965q1 %ested 'Begin graph sample later due to diffuse prior graph gr_trend.line trendfilt (trendfilt+trendfiltse) (trendfilt-trendfiltse) 'Trend GDP graph gr_trend.addtext(t,font(18)) "Potential GDP Growth" gr_trend.setelem(1) lcolor(blue) gr_trend.setelem(2) lcolor(orange) gr_trend.setelem(3) lcolor(orange) graph gr_lag.line lagfilt (lagfilt+lagfiltse) (lagfilt-lagfiltse) 'Coefficient on lagged dependent variable gr_lag.addtext(t,font(18)) "Coefficient on Lagged Dependent Variable" gr_lag.setelem(1) lcolor(purple) gr_lag.setelem(2) lcolor(green) gr_lag.setelem(3) lcolor(green) show ss1 show gr_trend