Hi guys,
I am doing a dissertation about Forecasting Stock Returns using Macroeconomic Variables
When I RUN the programme, it shows:
Error in sample: Attempt to set sample outside of workfile range.
Structure/Resize (from\WORKINGFILE\PROC menu) can expand the workflie rang. in "SMPL 2000 M12+133+12 2012:12"
Well, the in sample range is 1980m2 to 2000m12
out of sample range is 2001m1 to 2012m12.
I have TWO problems.
1. what's the problems for Error in sample?
2. the X7 variable only shows apart of results, and X8 variable does not show any result after I am RUNING... I have no idea what this problem is.
Code here:
' Forecasting Stock Returns using Macroeconomic Variables
' forecasting workhorse: bivariate ADL with recursive window
workfile ADLoutv1 m 1980m2 2012m12
fetch data::bond
fetch data::stock
fetch data::ex
fetch data::inflt
fetch data::int
fetch data::m1
fetch data::m2
fetch data::oil
fetch data::ts
fetch data::une
%y = "stock"
%d = "bond"
%x1 = "ex"
%x2 = "inflt"
%x3 = "int"
%x4 = "m1"
%x5 = "m2"
%x6 = "oil"
%x7 = "ts"
%x8 = "une"
'ADL Model 1 step ahead
for !horizon=0 to 144-1
smpl 1980m2 2000m12+!horizon
equation Mx1s1_{!horizon}.ls {%y} c {%x1}(-1) {%y}(-1)
Mx1s1_{!horizon}.makeresid yx1s1res
smpl 2000m12+!horizon+1 2012:12
Mx1s1_{!horizon}.forecast(f=na) tmp_yx1s1fcst
series yx1s1fcst
yx1s1fcst=tmp_yx1s1fcst
next
'ADL Model 3 step ahead
for !horizon=0 to 144-3
smpl 1980m2 2000m12+!horizon
equation Mx1s3_{!horizon}.ls {%y} c {%x1}(-3) {%y}(-3)
Mx1s3_{!horizon}.makeresid yx1s3res
smpl 2000m12+!horizon+3 2012:12
Mx1s3_{!horizon}.forecast(f=na) tmp_yx1s3fcst
series yx1s3fcst
yx1s3fcst=tmp_yx1s3fcst
next
'ADL Model 6 step ahead
for !horizon=0 to 144-6
smpl 1980m2 2000m12+!horizon
equation Mx1s6_{!horizon}.ls {%y} c {%x1}(-6) {%y}(-6)
Mx1s6_{!horizon}.makeresid yx1s6res
smpl 2000m12+!horizon+6 2012:12
Mx1s6_{!horizon}.forecast(f=na) tmp_yx1s6fcst
series yx1s6fcst
yx1s6fcst=tmp_yx1s6fcst
next
'ADL Model 12 step ahead
for !horizon=0 to 144-12
smpl 1980m2 2000m12+!horizon
equation Mx1s12_{!horizon}.ls {%y} c {%x1}(-12) {%y}(-12)
Mx1s12_{!horizon}.makeresid yx1s12res
smpl 2000m12+!horizon+12 2012:12
Mx1s12_{!horizon}.forecast(f=na) tmp_yx1s12fcst
series yx1s12fcst
yx1s12fcst=tmp_yx1s12fcst
next
'ADL Model 1 step ahead
for !horizon=0 to 144-1
smpl 1980m2 2000m12+!horizon
equation Mx2s1_{!horizon}.ls {%y} c {%x2}(-1) {%y}(-1)
Mx2s1_{!horizon}.makeresid yx2s1res
smpl 2000m12+!horizon+1 2012:12
Mx2s1_{!horizon}.forecast(f=na) tmp_yx2s1fcst
series yx2s1fcst
yx2s1fcst=tmp_yx2s1fcst
next
'ADL Model 3 step ahead
for !horizon=0 to 144-3
smpl 1980m2 2000m12+!horizon
equation Mx2s3_{!horizon}.ls {%y} c {%x2}(-3) {%y}(-3)
Mx2s3_{!horizon}.makeresid yx2s3res
smpl 2000m12+!horizon+3 2012:12
Mx2s3_{!horizon}.forecast(f=na) tmp_yx2s3fcst
series yx2s3fcst
yx2s3fcst=tmp_yx2s3fcst
next
'ADL Model 6 step ahead
for !horizon=0 to 144-6
smpl 1980m2 2000m12+!horizon
equation Mx2s6_{!horizon}.ls {%y} c {%x2}(-6) {%y}(-6)
Mx2s6_{!horizon}.makeresid yx2s6res
smpl 2000m12+!horizon+6 2012:12
Mx2s6_{!horizon}.forecast(f=na) tmp_yx2s6fcst
series yx2s6fcst
yx2s6fcst=tmp_yx2s6fcst
next
'ADL Model 12 step ahead
for !horizon=0 to 144-12
smpl 1980m2 2000m12+!horizon
equation Mx2s12_{!horizon}.ls {%y} c {%x2}(-12) {%y}(-12)
Mx2s12_{!horizon}.makeresid yx2s12res
smpl 2000m12+!horizon+12 2012:12
Mx2s12_{!horizon}.forecast(f=na) tmp_yx2s12fcst
series yx2s12fcst
yx2s12fcst=tmp_yx2s12fcst
next
'ADL Model 1 step ahead
for !horizon=0 to 144-1
smpl 1980m2 2000m12+!horizon
equation Mx3s1_{!horizon}.ls {%y} c {%x3}(-1) {%y}(-1)
Mx3s1_{!horizon}.makeresid yx3s1res
smpl 2000m12+!horizon+1 2012:12
Mx3s1_{!horizon}.forecast(f=na) tmp_yx3s1fcst
series yx3s1fcst
yx3s1fcst=tmp_yx3s1fcst
next
'ADL Model 3 step ahead
for !horizon=0 to 144-3
smpl 1980m2 2000m12+!horizon
equation Mx3s3_{!horizon}.ls {%y} c {%x3}(-3) {%y}(-3)
Mx3s3_{!horizon}.makeresid yx3s3res
smpl 2000m12+!horizon+3 2012:12
Mx3s3_{!horizon}.forecast(f=na) tmp_yx3s3fcst
series yx3s3fcst
yx3s3fcst=tmp_yx3s3fcst
next
'ADL Model 6 step ahead
for !horizon=0 to 144-6
smpl 1980m2 2000m12+!horizon
equation Mx3s6_{!horizon}.ls {%y} c {%x3}(-6) {%y}(-6)
Mx3s6_{!horizon}.makeresid yx3s6res
smpl 2000m12+!horizon+6 2012:12
Mx3s6_{!horizon}.forecast(f=na) tmp_yx3s6fcst
series yx3s6fcst
yx3s6fcst=tmp_yx3s6fcst
next
'ADL Model 12 step ahead
for !horizon=0 to 144-12
smpl 1980m2 2000m12+!horizon
equation Mx3s12_{!horizon}.ls {%y} c {%x3}(-12) {%y}(-12)
Mx3s12_{!horizon}.makeresid yx3s12res
smpl 2000m12+!horizon+12 2012:12
Mx3s12_{!horizon}.forecast(f=na) tmp_yx3s12fcst
series yx3s12fcst
yx3s12fcst=tmp_yx3s12fcst
next
'ADL Model 1 step ahead
for !horizon=0 to 144-1
smpl 1980m2 2000m12+!horizon
equation Mx4s1_{!horizon}.ls {%y} c {%x4}(-1) {%y}(-1)
Mx4s1_{!horizon}.makeresid yx4s1res
smpl 2000m12+!horizon+1 2012:12
Mx4s1_{!horizon}.forecast(f=na) tmp_yx4s1fcst
series yx4s1fcst
yx4s1fcst=tmp_yx4s1fcst
next
'ADL Model 3 step ahead
for !horizon=0 to 144-3
smpl 1980m2 2000m12+!horizon
equation Mx4s3_{!horizon}.ls {%y} c {%x4}(-3) {%y}(-3)
Mx4s3_{!horizon}.makeresid yx4s3res
smpl 2000m12+!horizon+3 2012:12
Mx4s3_{!horizon}.forecast(f=na) tmp_yx4s3fcst
series yx4s3fcst
yx4s3fcst=tmp_yx4s3fcst
next
'ADL Model 6 step ahead
for !horizon=0 to 144-6
smpl 1980m2 2000m12+!horizon
equation Mx4s6_{!horizon}.ls {%y} c {%x4}(-6) {%y}(-6)
Mx4s6_{!horizon}.makeresid yx4s6res
smpl 2000m12+!horizon+6 2012:12
Mx4s6_{!horizon}.forecast(f=na) tmp_yx4s6fcst
series yx4s6fcst
yx4s6fcst=tmp_yx4s6fcst
next
'ADL Model 12 step ahead
for !horizon=0 to 144-12
smpl 1980m2 2000m12+!horizon
equation Mx4s12_{!horizon}.ls {%y} c {%x4}(-12) {%y}(-12)
Mx4s12_{!horizon}.makeresid yx4s12res
smpl 2000m12+!horizon+12 2012:12
Mx4s12_{!horizon}.forecast(f=na) tmp_yx4s12fcst
series yx4s12fcst
yx4s12fcst=tmp_yx4s12fcst
next
'ADL Model 1 step ahead
for !horizon=0 to 144-1
smpl 1980m2 2000m12+!horizon
equation Mx5s1_{!horizon}.ls {%y} c {%x5}(-1) {%y}(-1)
Mx5s1_{!horizon}.makeresid yx5s1res
smpl 2000m12+!horizon+1 2012:12
Mx5s1_{!horizon}.forecast(f=na) tmp_yx5s1fcst
series yx5s1fcst
yx5s1fcst=tmp_yx5s1fcst
next
'ADL Model 3 step ahead
for !horizon=0 to 144-3
smpl 1980m2 2000m12+!horizon
equation Mx5s3_{!horizon}.ls {%y} c {%x5}(-3) {%y}(-3)
Mx5s3_{!horizon}.makeresid yx5s3res
smpl 2000m12+!horizon+3 2012:12
Mx5s3_{!horizon}.forecast(f=na) tmp_yx5s3fcst
series yx5s3fcst
yx5s3fcst=tmp_yx5s3fcst
next
'ADL Model 6 step ahead
for !horizon=0 to 144-6
smpl 1980m2 2000m12+!horizon
equation Mx5s6_{!horizon}.ls {%y} c {%x5}(-6) {%y}(-6)
Mx5s6_{!horizon}.makeresid yx5s6res
smpl 2000m12+!horizon+6 2012:12
Mx5s6_{!horizon}.forecast(f=na) tmp_yx5s6fcst
series yx5s6fcst
yx5s6fcst=tmp_yx5s6fcst
next
'ADL Model 12 step ahead
for !horizon=0 to 144-12
smpl 1980m2 2000m12+!horizon
equation Mx5s12_{!horizon}.ls {%y} c {%x5}(-12) {%y}(-12)
Mx5s12_{!horizon}.makeresid yx5s12res
smpl 2000m12+!horizon+12 2012:12
Mx5s12_{!horizon}.forecast(f=na) tmp_yx5s12fcst
series yx5s12fcst
yx5s12fcst=tmp_yx5s12fcst
next
'ADL Model 1 step ahead
for !horizon=0 to 144-1
smpl 1980m2 2000m12+!horizon
equation Mx6s1_{!horizon}.ls {%y} c {%x6}(-1) {%y}(-1)
Mx6s1_{!horizon}.makeresid yx6s1res
smpl 2000m12+!horizon+1 2012:12
Mx6s1_{!horizon}.forecast(f=na) tmp_yx6s1fcst
series yx6s1fcst
yx6s1fcst=tmp_yx6s1fcst
next
'ADL Model 3 step ahead
for !horizon=0 to 144-3
smpl 1980m2 2000m12+!horizon
equation Mx6s3_{!horizon}.ls {%y} c {%x6}(-3) {%y}(-3)
Mx6s3_{!horizon}.makeresid yx6s3res
smpl 2000m12+!horizon+3 2012:12
Mx6s3_{!horizon}.forecast(f=na) tmp_yx6s3fcst
series yx6s3fcst
yx6s3fcst=tmp_yx6s3fcst
next
'ADL Model 6 step ahead
for !horizon=0 to 144-6
smpl 1980m2 2000m12+!horizon
equation Mx6s6_{!horizon}.ls {%y} c {%x6}(-6) {%y}(-6)
Mx6s6_{!horizon}.makeresid yx6s6res
smpl 2000m12+!horizon+6 2012:12
Mx6s6_{!horizon}.forecast(f=na) tmp_yx6s6fcst
series yx6s6fcst
yx6s6fcst=tmp_yx6s6fcst
next
'ADL Model 12 step ahead
for !horizon=0 to 144-12
smpl 1980m2 2000m12+!horizon
equation Mx6s12_{!horizon}.ls {%y} c {%x6}(-12) {%y}(-12)
Mx6s12_{!horizon}.makeresid yx6s12res
smpl 2000m12+!horizon+12 2012:12
Mx6s12_{!horizon}.forecast(f=na) tmp_yx6s12fcst
series yx6s12fcst
yx6s12fcst=tmp_yx6s12fcst
next
'ADL Model 1 step ahead
for !horizon=0 to 144-1
smpl 1980m2 2000m12+!horizon
equation Mx7s1_{!horizon}.ls {%y} c {%x7}(-1) {%y}(-1)
Mx7s1_{!horizon}.makeresid yx7s1res
smpl 2000m12+!horizon+12 2012:12
Mx7s1_{!horizon}.forecast(f=na) tmp_yx7s1fcst
series yx7s1fcst
yx7s1fcst=tmp_yx7s1fcst
next
'ADL Model 3 step ahead
for !horizon=0 to 144-3
smpl 1980m2 2000m12+!horizon
equation Mx7s3_{!horizon}.ls {%y} c {%x7}(-3) {%y}(-3)
Mx7s3_{!horizon}.makeresid yx7s3res
smpl 2000m12+!horizon+12 2012:12
Mx7s3_{!horizon}.forecast(f=na) tmp_yx7s3fcst
series yx7s3fcst
yx7s3fcst=tmp_yx7s3fcst
next
'ADL Model 6 step ahead
for !horizon=0 to 144-6
smpl 1980m2 2000m12+!horizon
equation Mx7s6_{!horizon}.ls {%y} c {%x7}(-6) {%y}(-6)
Mx7s6_{!horizon}.makeresid yx7s6res
smpl 2000m12+!horizon+12 2012:12
Mx7s6_{!horizon}.forecast(f=na) tmp_yx7s6fcst
series yx7s6fcst
yx7s6fcst=tmp_yx7s6fcst
next
'ADL Model 12 step ahead
for !horizon=0 to 144-12
smpl 1980m2 2000m12+!horizon
equation Mx7s12_{!horizon}.ls {%y} c {%x7}(-12) {%y}(-12)
Mx7s12_{!horizon}.makeresid yx7s12res
smpl 2000m12+!horizon+12 2012:12
Mx7s12_{!horizon}.forecast(f=na) tmp_yx7s12fcst
series yx7s12fcst
yx7s12fcst=tmp_yx7s12fcst
next
'ADL Model 1 step ahead
for !horizon=0 to 144-1
smpl 1980m2 2000m12+!horizon
equation Mx8s1_{!horizon}.ls {%y} c {%x8}(-1) {%y}(-1)
Mx8s1_{!horizon}.makeresid yx8s1res
smpl 2000m12+!horizon+1 2012:12
Mx8s1_{!horizon}.forecast(f=na) tmp_yx8s1fcst
series yx8s1fcst
yx8s1fcst=tmp_yx8s1fcst
next
'ADL Model 3 step ahead
for !horizon=0 to 144-3
smpl 1980m2 2000m12+!horizon
equation Mx8s3_{!horizon}.ls {%y} c {%x8}(-3) {%y}(-3)
Mx8s3_{!horizon}.makeresid yx8s3res
smpl 2000m12+!horizon+3 2012:12
Mx8s3_{!horizon}.forecast(f=na) tmp_yx8s3fcst
series yx1s3fcst
yx8s3fcst=tmp_yx8s3fcst
next
'ADL Model 6 step ahead
for !horizon=0 to 144-6
smpl 1980m2 2000m12+!horizon
equation Mx8s6_{!horizon}.ls {%y} c {%x8}(-6) {%y}(-6)
Mx8s6_{!horizon}.makeresid yx8s6res
smpl 2000m12+!horizon+6 2012:12
Mx8s6_{!horizon}.forecast(f=na) tmp_yx8s6fcst
series yx8s6fcst
yx8s6fcst=tmp_yx8s6fcst
next
'ADL Model 12 step ahead
for !horizon=0 to 144-12
smpl 1980m2 2000m12+!horizon
equation Mx8s12_{!horizon}.ls {%y} c {%x8}(-12) {%y}(-12)
Mx8s12_{!horizon}.makeresid yx8s12res
smpl 2000m12+!horizon+12 2012:12
Mx8s12_{!horizon}.forecast(f=na) tmp_yx8s12fcst
series yx8s12fcst
yx8s12fcst=tmp_yx8s12fcst
'ADL Model 1 step ahead
for !horizon=0 to 144-1
smpl 1980m2 2000m12+!horizon
equation Mx1s1_{!horizon}.ls {%d} c {%x1}(-1) {%d}(-1)
Mx1s1_{!horizon}.makeresid dx1s1res
smpl 2000m12+!horizon+12 2012:12
Mx1s1_{!horizon}.forecast(f=na) tmp_dx1s1fcst
series dx1s1fcst
dx1s1fcst=tmp_dx1s1fcst
next
'ADL Model 3 step ahead
for !horizon=0 to 144-3
smpl 1980m2 2000m12+!horizon
equation Mx1s3_{!horizon}.ls {%d} c {%x1}(-3) {%d}(-3)
Mx1s3_{!horizon}.makeresid dx1s3res
smpl 2000m12+!horizon+12 2012:12
Mx1s3_{!horizon}.forecast(f=na) tmp_dx1s3fcst
series dx1s3fcst
dx1s3fcst=tmp_dx1s3fcst
next
'ADL Model 6 step ahead
for !horizon=0 to 144-6
smpl 1980m2 2000m12+!horizon
equation Mx1s6_{!horizon}.ls {%d} c {%x1}(-6) {%d}(-6)
Mx1s6_{!horizon}.makeresid dx1s6res
smpl 2000m12+!horizon+12 2012:12
Mx1s6_{!horizon}.forecast(f=na) tmp_dx1s6fcst
series dx1s6fcst
dx1s6fcst=tmp_dx1s6fcst
next
'ADL Model 12 step ahead
for !horizon=0 to 144-12
smpl 1980m2 2000m12+!horizon
equation Mx1s12_{!horizon}.ls {%d} c {%x1}(-12) {%d}(-12)
Mx1s12_{!horizon}.makeresid dx1s12res
smpl 2000m12+!horizon+12 2012:12
Mx1s12_{!horizon}.forecast(f=na) tmp_dx1s12fcst
series dx1s12fcst
dx1s12fcst=tmp_dx1s12fcst
next
'ADL Model 1 step ahead
for !horizon=0 to 144-1
smpl 1980m2 2000m12+!horizon
equation Mx2s1_{!horizon}.ls {%d} c {%x2}(-1) {%d}(-1)
Mx2s1_{!horizon}.makeresid dx2s1res
smpl 2000m12+!horizon+12 2012:12
Mx2s1_{!horizon}.forecast(f=na) tmp_dx2s1fcst
series dx2s1fcst
dx2s1fcst=tmp_dx2s1fcst
next
'ADL Model 3 step ahead
for !horizon=0 to 144-3
smpl 1980m2 2000m12+!horizon
equation Mx2s3_{!horizon}.ls {%d} c {%x2}(-3) {%d}(-3)
Mx2s3_{!horizon}.makeresid dx2s3res
smpl 2000m12+!horizon+12 2012:12
Mx2s3_{!horizon}.forecast(f=na) tmp_dx2s3fcst
series dx2s3fcst
dx2s3fcst=tmp_dx2s3fcst
next
'ADL Model 6 step ahead
for !horizon=0 to 144-6
smpl 1980m2 2000m12+!horizon
equation Mx2s6_{!horizon}.ls {%d} c {%x2}(-6) {%d}(-6)
Mx2s6_{!horizon}.makeresid dx2s6res
smpl 2000m12+!horizon+12 2012:12
Mx2s6_{!horizon}.forecast(f=na) tmp_dx2s6fcst
series dx2s6fcst
dx2s6fcst=tmp_dx2s6fcst
next
'ADL Model 12 step ahead
for !horizon=0 to 144-12
smpl 1980m2 2000m12+!horizon
equation Mx2s12_{!horizon}.ls {%d} c {%x2}(-12) {%d}(-12)
Mx2s12_{!horizon}.makeresid dx2s12res
smpl 2000m12+!horizon+12 2012:12
Mx2s12_{!horizon}.forecast(f=na) tmp_dx2s12fcst
series dx2s12fcst
dx2s12fcst=tmp_dx2s12fcst
next
'ADL Model 1 step ahead
for !horizon=0 to 144-1
smpl 1980m2 2000m12+!horizon
equation Mx3s1_{!horizon}.ls {%d} c {%x3}(-1) {%d}(-1)
Mx3s1_{!horizon}.makeresid dx3s1res
smpl 2000m12+!horizon+12 2012:12
Mx3s1_{!horizon}.forecast(f=na) tmp_dx3s1fcst
series dx3s1fcst
dx3s1fcst=tmp_dx3s1fcst
next
'ADL Model 3 step ahead
for !horizon=0 to 144-3
smpl 1980m2 2000m12+!horizon
equation Mx3s3_{!horizon}.ls {%d} c {%x3}(-3) {%d}(-3)
Mx3s3_{!horizon}.makeresid dx3s3res
smpl 2000m12+!horizon+12 2012:12
Mx3s3_{!horizon}.forecast(f=na) tmp_dx3s3fcst
series dx3s3fcst
dx3s3fcst=tmp_dx3s3fcst
next
'ADL Model 6 step ahead
for !horizon=0 to 144-6
smpl 1980m2 2000m12+!horizon
equation Mx3s6_{!horizon}.ls {%d} c {%x3}(-6) {%d}(-6)
Mx3s6_{!horizon}.makeresid dx3s6res
smpl 2000m12+!horizon+12 2012:12
Mx3s6_{!horizon}.forecast(f=na) tmp_dx3s6fcst
series dx3s6fcst
dx3s6fcst=tmp_dx3s6fcst
next
'ADL Model 12 step ahead
for !horizon=0 to 144-12
smpl 1980m2 2000m12+!horizon
equation Mx3s12_{!horizon}.ls {%d} c {%x3}(-12) {%d}(-12)
Mx3s12_{!horizon}.makeresid dx3s12res
smpl 2000m12+!horizon+12 2012:12
Mx3s12_{!horizon}.forecast(f=na) tmp_dx3s12fcst
series dx3s12fcst
dx3s12fcst=tmp_dx3s12fcst
next
'ADL Model 1 step ahead
for !horizon=0 to 144-1
smpl 1980m2 2000m12+!horizon
equation Mx4s1_{!horizon}.ls {%d} c {%x4}(-1) {%d}(-1)
Mx4s1_{!horizon}.makeresid dx4s1res
smpl 2000m12+!horizon+12 2012:12
Mx4s1_{!horizon}.forecast(f=na) tmp_dx4s1fcst
series dx4s1fcst
dx4s1fcst=tmp_dx4s1fcst
next
'ADL Model 3 step ahead
for !horizon=0 to 144-3
smpl 1980m2 2000m12+!horizon
equation Mx4s3_{!horizon}.ls {%d} c {%x4}(-3) {%d}(-3)
Mx4s3_{!horizon}.makeresid dx4s3res
smpl 2000m12+!horizon+12 2012:12
Mx4s3_{!horizon}.forecast(f=na) tmp_dx4s3fcst
series dx4s3fcst
dx4s3fcst=tmp_dx4s3fcst
next
'ADL Model 6 step ahead
for !horizon=0 to 144-6
smpl 1980m2 2000m12+!horizon
equation Mx4s6_{!horizon}.ls {%d} c {%x4}(-6) {%d}(-6)
Mx4s6_{!horizon}.makeresid dx4s6res
smpl 2000m12+!horizon+12 2012:12
Mx4s6_{!horizon}.forecast(f=na) tmp_dx4s6fcst
series dx4s6fcst
dx4s6fcst=tmp_dx4s6fcst
next
'ADL Model 12 step ahead
for !horizon=0 to 144-12
smpl 1980m2 2000m12+!horizon
equation Mx4s12_{!horizon}.ls {%d} c {%x4}(-12) {%d}(-12)
Mx4s12_{!horizon}.makeresid dx4s12res
smpl 2000m12+!horizon+12 2012:12
Mx4s12_{!horizon}.forecast(f=na) tmp_dx4s12fcst
series dx4s12fcst
dx4s12fcst=tmp_dx4s12fcst
next
'ADL Model 1 step ahead
for !horizon=0 to 144-1
smpl 1980m2 2000m12+!horizon
equation Mx5s1_{!horizon}.ls {%d} c {%x5}(-1) {%d}(-1)
Mx5s1_{!horizon}.makeresid dx5s1res
smpl 2000m12+!horizon+12 2012:12
Mx5s1_{!horizon}.forecast(f=na) tmp_dx5s1fcst
series dx5s1fcst
dx5s1fcst=tmp_dx5s1fcst
next
'ADL Model 3 step ahead
for !horizon=0 to 144-3
smpl 1980m2 2000m12+!horizon
equation Mx5s3_{!horizon}.ls {%d} c {%x5}(-3) {%d}(-3)
Mx5s3_{!horizon}.makeresid dx5s3res
smpl 2000m12+!horizon+12 2012:12
Mx5s3_{!horizon}.forecast(f=na) tmp_dx5s3fcst
series dx5s3fcst
dx5s3fcst=tmp_dx5s3fcst
next
'ADL Model 6 step ahead
for !horizon=0 to 144-6
smpl 1980m2 2000m12+!horizon
equation Mx5s6_{!horizon}.ls {%d} c {%x5}(-6) {%d}(-6)
Mx5s6_{!horizon}.makeresid dx5s6res
smpl 2000m12+!horizon+12 2012:12
Mx5s6_{!horizon}.forecast(f=na) tmp_dx5s6fcst
series dx5s6fcst
dx5s6fcst=tmp_dx5s6fcst
next
'ADL Model 12 step ahead
for !horizon=0 to 144-12
smpl 1980m2 2000m12+!horizon
equation Mx5s12_{!horizon}.ls {%d} c {%x5}(-12) {%d}(-12)
Mx5s12_{!horizon}.makeresid dx5s12res
smpl 2000m12+!horizon+12 2012:12
Mx5s12_{!horizon}.forecast(f=na) tmp_dx5s12fcst
series dx5s12fcst
dx5s12fcst=tmp_dx5s12fcst
next
'ADL Model 1 step ahead
for !horizon=0 to 144-1
smpl 1980m2 2000m12+!horizon
equation Mx6s1_{!horizon}.ls {%d} c {%x6}(-1) {%d}(-1)
Mx6s1_{!horizon}.makeresid dx6s1res
smpl 2000m12+!horizon+12 2012:12
Mx6s1_{!horizon}.forecast(f=na) tmp_dx6s1fcst
series dx6s1fcst
dx6s1fcst=tmp_dx6s1fcst
next
'ADL Model 3 step ahead
for !horizon=0 to 144-3
smpl 1980m2 2000m12+!horizon
equation Mx6s3_{!horizon}.ls {%d} c {%x6}(-3) {%d}(-3)
Mx6s3_{!horizon}.makeresid dx6s3res
smpl 2000m12+!horizon+12 2012:12
Mx6s3_{!horizon}.forecast(f=na) tmp_dx6s3fcst
series dx6s3fcst
dx6s3fcst=tmp_dx6s3fcst
next
'ADL Model 6 step ahead
for !horizon=0 to 144-6
smpl 1980m2 2000m12+!horizon
equation Mx6s6_{!horizon}.ls {%d} c {%x6}(-6) {%d}(-6)
Mx6s6_{!horizon}.makeresid dx6s6res
smpl 2000m12+!horizon+12 2012:12
Mx6s6_{!horizon}.forecast(f=na) tmp_dx6s6fcst
series dx6s6fcst
dx6s6fcst=tmp_dx6s6fcst
next
'ADL Model 12 step ahead
for !horizon=0 to 144-12
smpl 1980m2 2000m12+!horizon
equation Mx6s12_{!horizon}.ls {%d} c {%x6}(-12) {%d}(-12)
Mx6s12_{!horizon}.makeresid dx6s12res
smpl 2000m12+!horizon+12 2012:12
Mx6s12_{!horizon}.forecast(f=na) tmp_dx6s12fcst
series dx6s12fcst
dx6s12fcst=tmp_dx6s12fcst
next
'ADL Model 1 step ahead
for !horizon=0 to 144-1
smpl 1980m2 2000m12+!horizon
equation Mx7s1_{!horizon}.ls {%d} c {%x7}(-1) {%d}(-1)
Mx7s1_{!horizon}.makeresid dx7s1res
smpl 2000m12+!horizon+12 2012:12
Mx7s1_{!horizon}.forecast(f=na) tmp_dx7s1fcst
series dx7s1fcst
dx7s1fcst=tmp_dx7s1fcst
next
'ADL Model 3 step ahead
for !horizon=0 to 144-3
smpl 1980m2 2000m12+!horizon
equation Mx7s3_{!horizon}.ls {%d} c {%x7}(-3) {%d}(-3)
Mx7s3_{!horizon}.makeresid dx7s3res
smpl 2000m12+!horizon+12 2012:12
Mx7s3_{!horizon}.forecast(f=na) tmp_dx7s3fcst
series dx7s3fcst
dx7s3fcst=tmp_dx7s3fcst
next
'ADL Model 6 step ahead
for !horizon=0 to 144-6
smpl 1980m2 2000m12+!horizon
equation Mx7s6_{!horizon}.ls {%d} c {%x7}(-6) {%d}(-6)
Mx7s6_{!horizon}.makeresid dx7s6res
smpl 2000m12+!horizon+12 2012:12
Mx7s6_{!horizon}.forecast(f=na) tmp_dx7s6fcst
series dx7s6fcst
dx7s6fcst=tmp_dx7s6fcst
next
'ADL Model 12 step ahead
for !horizon=0 to 144-12
smpl 1980m2 2000m12+!horizon
equation Mx7s12_{!horizon}.ls {%d} c {%x7}(-12) {%d}(-12)
Mx7s12_{!horizon}.makeresid dx7s12res
smpl 2000m12+!horizon+12 2012:12
Mx7s12_{!horizon}.forecast(f=na) tmp_dx7s12fcst
series dx7s12fcst
dx7s12fcst=tmp_dx7s12fcst
next
'ADL Model 1 step ahead
for !horizon=0 to 144-1
smpl 1980m2 2000m12+!horizon
equation Mx8s1_{!horizon}.ls {%d} c {%x8}(-1) {%d}(-1)
Mx8s1_{!horizon}.makeresid dx8s1res
smpl 2000m12+!horizon+12 2012:12
Mx8s1_{!horizon}.forecast(f=na) tmp_dx8s1fcst
series dx8s1fcst
dx8s1fcst=tmp_dx8s1fcst
next
'ADL Model 3 step ahead
for !horizon=0 to 144-3
smpl 1980m2 2000m12+!horizon
equation Mx8s3_{!horizon}.ls {%d} c {%x8}(-3) {%d}(-3)
Mx8s3_{!horizon}.makeresid dx8s3res
smpl 2000m12+!horizon+12 2012:12
Mx8s3_{!horizon}.forecast(f=na) tmp_dx8s3fcst
series dx8s3fcst
dx8s3fcst=tmp_dx8s3fcst
next
'ADL Model 6 step ahead
for !horizon=0 to 144-6
smpl 1980m2 2000m12+!horizon
equation Mx8s6_{!horizon}.ls {%d} c {%x8}(-6) {%d}(-6)
Mx8s6_{!horizon}.makeresid dx8s6res
smpl 2000m12+!horizon+12 2012:12
Mx8s6_{!horizon}.forecast(f=na) tmp_dx8s6fcst
series dx8s6fcst
dx8s6fcst=tmp_dx8s6fcst
next
'ADL Model 12 step ahead
for !horizon=0 to 144-12
smpl 1980m2 2000m12+!horizon
equation Mx8s12_{!horizon}.ls {%d} c {%x8}(-12) {%d}(-12)
Mx8s12_{!horizon}.makeresid dx8s12res
smpl 2000m12+!horizon+12 2012:12
Mx8s12_{!horizon}.forecast(f=na) tmp_dx8s12fcst
series dx8s12fcst
dx8s12fcst=tmp_dx8s12fcst
next
mode verbose
Error in sample: bivariate ADL with recursive window
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Error in sample: bivariate ADL with recursive window
The error message is pretty self explanatory.
You've set the sample to:
A quick mental arithmetic tells me that 2000m12+133+12 is equal to 2013m1. That's outside of your workfile.
You've set the sample to:
Code: Select all
2000M12+133+12 2012:12
Re: Error in sample: bivariate ADL with recursive window
well, 144-12=132, where is 133 coming from? that's why i dont understand. please.
Code: Select all
for !horizon=0 to 144-12
smpl 2000m12+!horizon+12 2012:12
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Error in sample: bivariate ADL with recursive window
It looks like there are plenty of places where you have horizon set to 144-6 or 144-3
Who is online
Users browsing this forum: No registered users and 2 guests
