' set window size
!window = 2500

' get size of workfile
!length = @obsrange
' declare equation for estimation
equation eq01

' set step size
!step = 5
'calculate number of rolls
!nrolls = @round((!length-!window)/!step)
'matrix to store coefficient estimates
matrix(5053,!nrolls) coefmat ' where 5053 is the number of observations

!j=0

' move sample !step obs at a time
for !i = 1 to !length-!window+5-!step step !step
!j=!j+1


	' reset sample to forecast period
	smpl @first+!i+!window-1 @first+!i+!window-2+!step


smpl @first+!i+!window-1 @first+!i+!window-1+5 'set sample for forecast period
eq01.forecast audf1 aud_se aud_var

'store coefficients
colplace(coefmat,aud_var,!j)

next
