Help with THEIL
Help with THEIL
Working with the THEIL instruction in this code:
**SET UP FORECAST EVALUATION**
*
BOXJENK(AR=2,MA=4,CONSTANT,DEFINE=PORTMOD1) PORTHOME * 2012:12
THEIL(MODEL=PORTMOD1,SETUP,STEPS=4,TO=2015:8)
DO J = 2013:1, 2015:4
THEIL J
BOXJENK(AR=2,MA=4,CONSTANT,DEFINE=PORTMOD1) PORTHOME * J
END DO J
THEIL(DUMP)
RATS crashes when it hits THEIL(DUMP). Frustrating because I have run this kind of code many times and never had this problem. I am just not seeing the error in the code. Relevant code below.
Any thoughts? What am I missing?
***
CALENDAR(M) 1900:1
ALLOCATE 2020:12
***
***
***
DATA(FORMAT=FRED) * * USREC NAPM UMCSENT PPILFE POXRSA CAPUTLG3361T3S EXUSUK
***
SET LOGPRICES = LOG(PPILFE)
SET COMINF = (LOG(PPILFE)-LOG(PPILFE{1}))*100
SET PORTHOME = (POXRSA/POXRSA{1}-1)*100
SET POUND = (EXUSUK/EXUSUK{1}-1)*100
***
*
**SET UP FORECAST EVALUATION**
*
BOXJENK(AR=2,MA=4,CONSTANT,DEFINE=PORTMOD1) PORTHOME * 2012:12
THEIL(MODEL=PORTMOD1,SETUP,STEPS=4,TO=2015:12)
DO J = 2013:1, 2015:8
THEIL(PRINT) J
BOXJENK(AR=2,MA=4,CONSTANT,DEFINE=PORTMOD1) PORTHOME * J
END DO J
THEIL(DUMP)
*
**SET UP FORECAST EVALUATION**
*
BOXJENK(AR=2,MA=4,CONSTANT,DEFINE=PORTMOD1) PORTHOME * 2012:12
THEIL(MODEL=PORTMOD1,SETUP,STEPS=4,TO=2015:8)
DO J = 2013:1, 2015:4
THEIL J
BOXJENK(AR=2,MA=4,CONSTANT,DEFINE=PORTMOD1) PORTHOME * J
END DO J
THEIL(DUMP)
RATS crashes when it hits THEIL(DUMP). Frustrating because I have run this kind of code many times and never had this problem. I am just not seeing the error in the code. Relevant code below.
Any thoughts? What am I missing?
***
CALENDAR(M) 1900:1
ALLOCATE 2020:12
***
***
***
DATA(FORMAT=FRED) * * USREC NAPM UMCSENT PPILFE POXRSA CAPUTLG3361T3S EXUSUK
***
SET LOGPRICES = LOG(PPILFE)
SET COMINF = (LOG(PPILFE)-LOG(PPILFE{1}))*100
SET PORTHOME = (POXRSA/POXRSA{1}-1)*100
SET POUND = (EXUSUK/EXUSUK{1}-1)*100
***
*
**SET UP FORECAST EVALUATION**
*
BOXJENK(AR=2,MA=4,CONSTANT,DEFINE=PORTMOD1) PORTHOME * 2012:12
THEIL(MODEL=PORTMOD1,SETUP,STEPS=4,TO=2015:12)
DO J = 2013:1, 2015:8
THEIL(PRINT) J
BOXJENK(AR=2,MA=4,CONSTANT,DEFINE=PORTMOD1) PORTHOME * J
END DO J
THEIL(DUMP)
*
Re: Help with THEIL
The CAPUTLG3361T3S doesn't seem to exist (any longer?). Take that out of the list and it seems to work.
Re: Help with THEIL
But if I cut it down to this, it still crashes on me:
CALENDAR(M) 1900:1
ALLOCATE 2020:12
***
***
***
DATA(FORMAT=FRED) * * USREC POXRSA
***
SET PORTHOME = (POXRSA/POXRSA{1}-1)*100
***
*
**SET UP FORECAST EVALUATION**
*
BOXJENK(AR=2,MA=4,CONSTANT,DEFINE=PORTMOD1) PORTHOME * 2012:12
THEIL(MODEL=PORTMOD1,SETUP,STEPS=4,TO=2015:12)
DO J = 2013:1, 2015:8
THEIL(PRINT) J
BOXJENK(AR=2,MA=4,CONSTANT,DEFINE=PORTMOD1) PORTHOME * J
END DO J
THEIL(DUMP)
CALENDAR(M) 1900:1
ALLOCATE 2020:12
***
***
***
DATA(FORMAT=FRED) * * USREC POXRSA
***
SET PORTHOME = (POXRSA/POXRSA{1}-1)*100
***
*
**SET UP FORECAST EVALUATION**
*
BOXJENK(AR=2,MA=4,CONSTANT,DEFINE=PORTMOD1) PORTHOME * 2012:12
THEIL(MODEL=PORTMOD1,SETUP,STEPS=4,TO=2015:12)
DO J = 2013:1, 2015:8
THEIL(PRINT) J
BOXJENK(AR=2,MA=4,CONSTANT,DEFINE=PORTMOD1) PORTHOME * J
END DO J
THEIL(DUMP)
Re: Help with THEIL
Odd - if I set STEP = something great than 4, it doesn't crash. 4 or less it crashed.
Re: Help with THEIL
Odder - apparently all of my programs crash when I set STEPS to 4 or less.
Re: Help with THEIL
The problem is with:
THEIL(MODEL=PORTMOD1,SETUP,STEPS=4,TO=2015:12)
MODEL=PORTMOD1 makes a temporary copy of PORTMOD1, which is fine for all other forecasting instructions, but not THEIL which needs to keep referencing that. Whether the temporary information gets overwritten will depend upon all kinds of things in the program, so sometimes it will work, sometimes not.
The fix is to add
GROUP ARMAMOD PORTMOD1
THEIL(MODEL=ARMAMOD,...)
to make ARMAMOD a permanent model. (There's also an alternative form of THEIL which takes EQUATIONS rather than MODELS as inputs).
THEIL(MODEL=PORTMOD1,SETUP,STEPS=4,TO=2015:12)
MODEL=PORTMOD1 makes a temporary copy of PORTMOD1, which is fine for all other forecasting instructions, but not THEIL which needs to keep referencing that. Whether the temporary information gets overwritten will depend upon all kinds of things in the program, so sometimes it will work, sometimes not.
The fix is to add
GROUP ARMAMOD PORTMOD1
THEIL(MODEL=ARMAMOD,...)
to make ARMAMOD a permanent model. (There's also an alternative form of THEIL which takes EQUATIONS rather than MODELS as inputs).