Forming a series

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

mjfl
Posts: 49
Joined: Mon Jul 18, 2011 8:18 am

Re: Forming a series

Postby mjfl » Thu Nov 17, 2011 6:24 pm

Code: Select all

=@wlookup("*1", "scalar")
works for me.

http://forums.eviews.com/viewtopic.php?f=5&t=18
dear Gareth,

thks for the viewtopic. i find it very useful. for the scalar it still doesnt work. hmm.
ok have another enquiry. i have been looking at forum for wls or expo weight and found the best would be

Code: Select all

ls.(w=weight) y x1 c
i would like to weight more on latest onservation and have set-up a weight series for doing so. i shuld be using "variance, weight and eviews default" in my option to get w*y= w*x1 + w*c am i correct?

and if i would like to forecast using these set of estimate, i would just continue forecasting correct?

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

Re: Forming a series

Postby EViews Glenn » Fri Nov 18, 2011 2:35 pm

"Inverse standard deviation" weighting (probably with "none" scaling, though that depends on what you view the purpose of weighting).

mjfl
Posts: 49
Joined: Mon Jul 18, 2011 8:18 am

Re: Forming a series

Postby mjfl » Sat Nov 19, 2011 6:54 am

"Inverse standard deviation" weighting (probably with "none" scaling, though that depends on what you view the purpose of weighting).
hi glenn,

just to confirm w*y=w*x+w*c where weight=w is as u mentioned above? can i know what is the scaling abt and how do i program it?
eq.ls(w=weights,scale=none) y x c correct?
and can i ask can i do the same for VAR estimation?

what im trying to do is to weight all observation of y and x by w and us it for estimation and after getting the parameters estimators, use it for forecasting y using usual y and x. the same is for VAR.

do u have any suggestion how to do it?
alt, should i store estimates afterwhich forecast? pls advice.

mjfl
Posts: 49
Joined: Mon Jul 18, 2011 8:18 am

Re: Forming a series

Postby mjfl » Mon Nov 21, 2011 9:11 am

"Inverse standard deviation" weighting (probably with "none" scaling, though that depends on what you view the purpose of weighting).
hi glenn,

just to confirm w*y=w*x+w*c where weight=w is as u mentioned above? can i know what is the scaling abt and how do i program it?
eq.ls(w=weights,scale=none) y x c correct?
and can i ask can i do the same for VAR estimation?

what im trying to do is to weight all observation of y and x by w and us it for estimation and after getting the parameters estimators, use it for forecasting y using usual y and x. the same is for VAR.

do u have any suggestion how to do it?
alt, should i store estimates afterwhich forecast? pls advice.

hi Gareth, Glenn and team eviews, can the above be done? is there any way to var(w=weights).ls or how shld i write it so that it does weighting in the var where w=weights? i will use it for forecast thereafter. this is the last part of the paper im sending in for review. pls kindly advice.

bebebe
Posts: 3
Joined: Fri Jun 22, 2012 6:41 pm

Re: Forming a series

Postby bebebe » Sun Jun 24, 2012 1:45 am

Hi all,

I am using eviews 5 and have written a code by modifying from the rolling regression code posted in this forum, for rolling GARCH (1,1) forecasts for next 20 steps, for example, for period 1, observations 1 to 500 are using in GARCH model estimation, and variance forecasted sample is 501 to 520, and period 2 is observations 2 to 501 for estimation, and variance forecast is from 502 to 521. However, the matrix which i obtained shows 521 values in total, which i suppose the 1st 500 are actuals, while 501-521 are forecasts. Code as below.

I would like to calculate the annualised variance for this 20 steps for each period, using formula sqrt(sum of last 20 values*252/20)? Any idea how can i do this?

Thanks in advance....


' set window size
!window = 500
' set step size
!step = 1
' get size of workfile
!length = @obsrange
' declare equation for estimation
equation eq1
'calculate number of rolls
!nrolls = @round((!length-!window)/!step)
'matrix to store coefficient estimates
matrix(782,!nrolls) coefmat ' where 782 is the number of observations
'variable keeping track of how many rolls we've done
!j=0

' move sample !step obs at a time
for !i = 1 to !length-!window+1-!step step !step
!j=!j+1
' set sample to estimation period
smpl @first+!i-1 @first+!i+!window-2
' estimate arch equation
eq1.arch audr c

smpl @first+!i+!window-1 @first+!i+!window-1+20 'set sample for forecast period
eq1.forecast audf1 aud_se aud_var

'store coefficients
colplace(coefmat,aud_var,!j)

next

show coefmat

bebebe
Posts: 3
Joined: Fri Jun 22, 2012 6:41 pm

Re: Forming a series

Postby bebebe » Sun Jun 24, 2012 3:08 am

solution found, using scalar. :D


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest