Help with THEIL

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.
timduy
Posts: 50
Joined: Sun Jan 15, 2012 12:24 am

Help with THEIL

Unread post by timduy »

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)
*
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Help with THEIL

Unread post by TomDoan »

The CAPUTLG3361T3S doesn't seem to exist (any longer?). Take that out of the list and it seems to work.
timduy
Posts: 50
Joined: Sun Jan 15, 2012 12:24 am

Re: Help with THEIL

Unread post by timduy »

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)
timduy
Posts: 50
Joined: Sun Jan 15, 2012 12:24 am

Re: Help with THEIL

Unread post by timduy »

Odd - if I set STEP = something great than 4, it doesn't crash. 4 or less it crashed.
timduy
Posts: 50
Joined: Sun Jan 15, 2012 12:24 am

Re: Help with THEIL

Unread post by timduy »

Odder - apparently all of my programs crash when I set STEPS to 4 or less.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Help with THEIL

Unread post by TomDoan »

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).
Post Reply