Eviews 9 - convergence problems

For notifying us of what you believe are bugs or errors in EViews.
Please ensure your copy of EViews is up-to-date before posting.

Moderators: EViews Gareth, EViews Moderator

lfpazevedo
Posts: 3
Joined: Mon Apr 27, 2015 11:10 am

Eviews 9 - convergence problems

Postby lfpazevedo » Wed Apr 29, 2015 11:33 am

Hi.
The following program was working normally on Eviews 6 and 8, but not in Eviews 9.
With !obs=100 it works a few times.
But never with !obs=1000

'=====================================
!obs = 100

wfcreate u !obs
rndseed 1

smpl 25 !obs
series e = nrnd
series x1 = 100*rnd
series x2 = 30*nrnd
series x3 = -4*rnd
group xs x1 x2 x3

smpl 25 !obs-1
series y = 3 + 2*x1 + 4*x2 + 5*x3 + e

smpl @all

' set window size
!window = 35

' set step size
!step = 1

' get size of workfile
!length = @obsrange

' declare equation for estimation
equation eq01

'calculate number of rolls
!nrolls = @floor((!length-!window)/!step)

'matrix to store coefficient estimates
matrix(4,!nrolls) coefmat ' where 7 is the number of coefficients

'series to store forecast estimates
series eq01fcast

'redundant series for catching start and end points
series ser = 1
%start = @otod(@ifirst(ser))
%end = @otod(@ilast(ser))

'variable keeping track of how many rolls we've done
!j=0

' move sample !step obs at a time
for !i = 25 to !length-!window+1-!step step !step
!j=!j+1

' set sample for estimation period
%first = @otod(@dtoo(%start)+!i-1)
%last = @otod(@dtoo(%start)+!i+!window-2)
smpl {%first} {%last}

' estimate equation - where the equation is y=c(1) + c(2)*x1 + c(3)*x2
eq01.ls y = c(1)*x1 + c(2)*x2 + c(3)*x3 + [AR(1)=C(18)]

' store coefficients
colplace(coefmat,eq01.@coefs,!j)

' 4-period-ahead forecast
%4pers = @otod(@dtoo(%start)+!i+!window-1) 'start point
%4pere = @otod(@dtoo(%start)+!i+!window-1) 'end point: %4pere - %4pers +1 = 1
if @dtoo(%end) < @dtoo(%4pere) then 'check whether the forecast end point is greater than the workfile end point
return
endif

' set smpl for forecasting period
smpl {%4pers} {%4pere}

' forecast with command *forecast* (see also *fit*)
eq01.fit(f=na) yf

' set sampl to obtain the 4th period observation
smpl {%4pere} {%4pere}

' store forecasts
eq01fcast = yf
next

'FORECAST IN-SAMPLE
smpl @all

eq01.ls y = c(1)*x1 + c(2)*x2 + c(3)*x3 + [AR(1)=C(18)]
eq01.fit(f=actual) yf2

d(noerr) ser

series yf3 = y

smpl !obs !obs
series yf3 = yf2

smpl @all
'==================================

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Eviews 9 - convergence problems

Postby EViews Glenn » Wed Apr 29, 2015 4:40 pm

We're testing a fix for this. Stay tuned.

[Edit: a fix is available in today's patch].

lfpazevedo
Posts: 3
Joined: Mon Apr 27, 2015 11:10 am

Re: Eviews 9 - convergence problems

Postby lfpazevedo » Mon May 04, 2015 7:53 am

The problem was not solve.
Try this code. It is working well on Eviews 6, but not on Eviews 9

wfcreate m 2005M01 2015M12
rndseed 1

smpl @first+25 @last
series e = nrnd
series x1 = 100*rnd
series x2 = 30*nrnd
series x3 = -4*rnd
group xs x1 x2 x3

smpl @first+25 @last-1
series y = 3 + 2*x1 + 4*x2 + 5*x3 + e

'=================================
smpl @all

' set window size
!window = 35

' set step size
!step = 1

' get size of workfile
!length = @obsrange

' declare equation for estimation
equation eq01

'calculate number of rolls
!nrolls = @floor((!length-!window)/!step)

'matrix to store coefficient estimates
matrix(16,!nrolls) coefmat ' where 7 is the number of coefficients

'series to store forecast estimates
series eq01fcast

'redundant series for catching start and end points
series ser = 1
%start = @otod(@ifirst(ser))
%end = @otod(@ilast(ser))

'variable keeping track of how many rolls we've done
!j=0

' move sample !step obs at a time
for !i = 25 to !length-!window+1-!step step !step
!j=!j+1

' set sample for estimation period
%first = @otod(@dtoo(%start)+!i-1)
%last = @otod(@dtoo(%start)+!i+!window-2)
smpl {%first} {%last}

' estimate equation - where the equation is y=c(1) + c(2)*x1 + c(3)*x2
eq01.ls y = c(1)*x1 + c(2)*x2 + c(3)*x3(-1) + [AR(1)=C(4)] + C(11) + C(12)*@SEAS(1) + C(13)*@SEAS(2) + C(14)*@SEAS(3) + C(15)*@SEAS(4) + C(16)*@SEAS(5) + C(17)*@SEAS(6) + C(18)*@SEAS(7) + C(19)*@SEAS(8) + C(20)*@SEAS(9) + C(21)*@SEAS(10) + C(22)*@SEAS(11)

' store coefficients
colplace(coefmat,eq01.@coefs,!j)

' 4-period-ahead forecast
%4pers = @otod(@dtoo(%start)+!i+!window-1) 'start point
%4pere = @otod(@dtoo(%start)+!i+!window-1) 'end point: %4pere - %4pers +1 = 1
if @dtoo(%end) < @dtoo(%4pere) then 'check whether the forecast end point is greater than the workfile end point
return
endif

' set smpl for forecasting period
smpl {%4pers} {%4pere}

' forecast with command *forecast* (see also *fit*)
eq01.fit(f=na) yf

' set sampl to obtain the 4th period observation
smpl {%4pere} {%4pere}

' store forecasts
eq01fcast = yf
next

'FORECAST IN-SAMPLE
smpl @all

eq01.ls y = c(1)*x1 + c(2)*x2 + c(3)*x3(-1) + [AR(1)=C(4)] + C(11) + C(12)*@SEAS(1) + C(13)*@SEAS(2) + C(14)*@SEAS(3) + C(15)*@SEAS(4) + C(16)*@SEAS(5) + C(17)*@SEAS(6) + C(18)*@SEAS(7) + C(19)*@SEAS(8) + C(20)*@SEAS(9) + C(21)*@SEAS(10) + C(22)*@SEAS(11)
eq01.fit(f=actual) yf2

d(noerr) ser

series yf3 = y

smpl @last @last
series yf3 = yf2

smpl @all

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: Eviews 9 - convergence problems

Postby startz » Mon May 04, 2015 8:15 am

edit to delete unhelpful advice
Last edited by startz on Mon May 04, 2015 9:50 am, edited 1 time in total.

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Eviews 9 - convergence problems

Postby EViews Glenn » Mon May 04, 2015 9:49 am

The previous bug was fixed. What you are reporting now is a different issue than the previous post.

What's going on now is that the syntax parser is no longer handling the "[ar(1)=c(4)] in the middle of the expression. I'll work on tracing down the change and getting a fix. For now, if you move that part of the expression to the end of the line, your program will run to completion.

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Eviews 9 - convergence problems

Postby EViews Glenn » Mon May 04, 2015 10:12 am

Sorry, that one was me. The earlier fix caused problems when you had, as in the example, an explicit AR regression with the AR portion of the specification in the middle of the expression. That one wasn't in my set of tests.

As I said, for now, if you put the AR portion at the end of the spec, you'll be fine. You'll find a fix in the next patch. Sorry for the inconvenience.

lfpazevedo
Posts: 3
Joined: Mon Apr 27, 2015 11:10 am

Re: Eviews 9 - convergence problems

Postby lfpazevedo » Mon May 04, 2015 10:15 am

Thanks!
It is working now.


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest