Stata中关于while函数的语法报错

用Stata做Arima模型,我做分训练集以及测试集,但是while函数中一直报语法错误,是怎么回事?下面是代码


. arima y, arima(2,0,0)

gen f1=. 
gen e1=. 
gen std1=.

local obs=_N
local i=_N-51 
local j=`i'+1
local n=`j'+1
quietly {
while `j'<`obs' {
arima y if tin(,`j'), ar(1/2) 
predict pred if tin(,`n'), xb
predict std if tin(,`n'), stdp
replace f1=pred in `n'
replace e1=y-f1 in `n'
replace std1=std in `n'
drop pred std
local i=`i'+1
local j=`j'+1
local n=`n'+1
}
}