全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 EViews专版
1369 2
2014-03-21
悬赏 5 个论坛币 未解决

This code I poste from the IDC Web , It is to hard to read for me, because I just a begginger for Eviews,

Can you decode into the Chinese (English)  language fully clear, easlier

Sincerly !

' set window size

!window = 142

' set step size

' declare equation for estimation

equation eq01

' get size of workfile

!length = @obsrange

%cmnd = _this.@command 'EDIT: get theequation specification stored in eviews

!step = 4

'calculate number of rolls

!nrolls = @floor((!length-!window)/!step)

'matrix to store coefficient estimates

matrix(!nrolls ,3) coeff  ' where 3 is the number of coefficients

'series to store forecast estimates

series fcast

'redundant series for catching start andend points

%start = "@first"'@otod(@ifirst(ser))

%end = "@last"'@otod(@ilast(ser))

'variable keeping track of how many rollswe'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 for estimation period-recursive window

%first = @otod(@dtoo(%start))

%last = @otod(@dtoo(%start)+!i+!window-1)

smpl {%first} {%last}

' estimate equation -

!maxerr = @maxerrcount

setmaxerrs !maxerr+1

_this.{%cmnd} 'estimated equation

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

' 4-period-ahead forecast

%4pers = @otod(@dtoo(%start)+!i+!window-1)'start point

%4pere = @otod(@dtoo(%start)+!i+!window+3)'end point

if @dtoo(%end) < @dtoo(%4pere) then'check whether the forecast end point is greater than the workfile end point

exitloop

endif

' set smpl for forecasting period

smpl {%4pers} {%4pere}

' forecast with command *forecast* (seealso *fit*)

eq01.forecast(f=na) yf

' set sampl to obtain the 4th periodobservation

smpl {%4pere} {%4pere}

' store forecasts

fcast = yf

next

smpl @all

show coefmat

show fcast.line

d(noerr) yf

'calculate RMSE

scalar rmse=@rmse(y, fcast)

' plot actual and recursive forecasts

graph graph1.line y fcast

graph1.addtext(t) forecast

show graph1

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2014-3-21 15:44:28
不难啊
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-3-22 09:43:08
大师 :有空可否帮小弟解读这个老外的程序代码是在干嘛 ?
         诚心请求协助 !
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群