*
* DISTRIBLAG.RPF
* Example of estimation of a distributed lag
*
* RATS User's Guide, Example from Section 2.8.
*
open data haversample.rat
calendar(m) 1947
data(format=rats) 1947:1 2007:4 fltg ftb3
set shortrate = ftb3
set longrate = fltg
*
* Long unrestricted lags
*
linreg longrate
# constant shortrate{0 to 24}
summarize
# shortrate{0 to 24}
set lagdist 1 25 = %beta(t+1)
graph(header="Lag Distribution-Long Unconstrained",number=0)
# lagdist 1 25
*
* ARDL estimates
*
linreg longrate
# constant longrate{1 2 3} shortrate{0 to 4}
*
* From the regression, extract the autoregressive polynomial, (which will
* be 1-a(1)L-a(2)L^2-a(3)L^3) since LONGRATE is the dependent variable),
* and the distributed lag polynomial. Divide DLPOLY by ARPOLY and expand
* out to the 24th degree.
*
compute arpoly=%eqnlagpoly(0,longrate)
compute dlpoly=%eqnlagpoly(0,shortrate)
compute ardlpoly=%polydiv(dlpoly,arpoly,24)
*
* Copy the expanded polynomial to the series lagdist and graph it.
*
set lagdist 1 25 = ardlpoly(t)
graph(header="Lag Distribution-ARDL(3,4)",number=0)
# lagdist
*
* Compute the long-run response from the ARDL model
*
disp "LR Response" %polyvalue(dlpoly,1.0)/%polyvalue(arpoly,1.0)