{"word_count": 201, "character_count": 1603}
In the case where  are i.i.d. random variables, thenNow, what if  are identically distributed, but no longer independent. What if we have an autoregressive process? Assume thatThencan be writtenHere, we will express the variance as a function of  and , but it is possible to use also , since, in the context of an ,Now, since  we getwhich can be simplified, sincei.e.So, the variance of the mean can be writen asObserve that if  is large enough,This asymptotic relationship is well known actually. A simple way to get it is the following. One can can writeor equivalentlyBut actually, the first relationship is probably more interesting to get an asymptotic approximation,In the context of an  process, this can be writenThus, we get the following well-known relationshipIn the case where  is an i.i.d. sequence, i.e. , then we get the relationship mentioned initially. And in the case of a random walk... unfortunately, we cannot use that relationship. But observe thati.e.which can be writtenIf we compare the true value and the approximation, we get the following graph,&#62; V=function(phi,s2=1,n=100){+ g0=s2/(1-phi^2)+ if(phi&#60;1){+ if(phi==0){v1=g0/n}+ if(phi&#62;0){v1=g0/n^2*(n+2*((n-1)*+ phi^(-1)-n+phi^(n-1))/(phi^(-1)-1)^2)}+ v2=g0/n*(1+phi)/(1-phi)+ }+ if(phi==1){+ v1=(2*n+1)*(n+1)*s2/(6*n)+ v2=NA+ }+ return(c(v1,v2))}&#62; &#62; Vphi=function(phi) V(phi,1,100)&#62; x=seq(.01,1,by=.02)&#62; M=matrix(unlist(lapply(x,V)),nrow=2)&#62; plot(x,M[1,],type="l",col="red",log="y",+ ylab="Variance of the average (log scale)",+ xlab="Autoregressive coefficient")&#62; lines(x,M[2,],col="blue")