phi1<-0.2 u<-1 x1<-c() x1[1]<-u/(1-phi1) for(i in 2:100) { x1[i]<-u+phi1*x1[i-1]+rnorm(1,0,1) } ar.ols(x1,order.max=1,demean=F,intercept=T)