哪位高人能给我解释下下面这段做直线滑动平均模拟的程序?
series [email=id=@trend(1988]id=@trend(1988[/email])
matrix(18,3)dataout=0'18为样本量;3为样本个数
'定义变量
for!num=1 to 3
!count=!num
!a=1989
!b=!a+10'10+1为步长
!t=0
vector(18)trend=0
coef(18)count=0
while!b<2007
smpl!a!b
equation eq.ls xm{!num}c id'xm1、xm2、xm3分别代表莎车县、沙雅县和阿克苏市
eq.makeresid res
series ess=xm{!num}-res
for!k=1 to 11
!n=!t+!k
if ess({!k})<>0 then
trend({!n})=trend({!n})+ess({!n})
count(!n)=count(!n)+1
endif
next
!a=!a+1
!b=!b+1
!t=!t+1
wend
for!p=1 to 18
scalar num=count({!p})
if num=0 then
num=1
endif
dataout(!p,!count)=trend({!p})/num
next
next
[email=smpl@all]smpl@all[/email]