# How to find the Autocorrelation function and Covaraince

I had to find the autocorrelation function in the following time series model

$X_t = a+ bt+ Z_t + 0.6Z_{t-1}$ where $a$ and $b$ are constants.

I used that $\gamma (k)$ = $Cov(X_t, X_{t+k})$.

Then $Cov(a+ b t+ Z_t + 0.6 Z_{t-1}, a+ b(t+k)+ Z_{t+k} + 0.6 Z_{t+k-1})$ but I am not sure how to evaluate that please help me on that. Any help would be appreciated.

• The answer depends on the "nature" of the $Z_t$'s. What are they? Maybe i.i.d. random variables? In any case, can you compute $Cov(a,b)$, $Cov(a,Z_{t+k})$? Jun 27, 2013 at 12:09
• Yes they are iids yes I think since a is a constant you can ignore that can't you? I expanded it to $Cov(bt,b(t+k)) + cov (bt,Z_t) +Cov(bt,0.6Z_{t-1})+Cov(Z_t,Z_t)+0 +Cov(0.6Z_{t-1},b(t+k)+ Cov(Z_{t-1},Z_{t-}) +0$ Jun 27, 2013 at 12:16
• Let us do it slowly, ok? A constant random variable $a$ has mean $E[a]=a$. So $Cov(a,a)=E[(a-E[a])(a-E[a])]=0$. Similarly, $Cov(a,Y)=E[(a-E[a])(Y-E[Y])]=0$ for any random variable $Y$. One more question: are the $Z_i$ with some special distribution? Maybe normal with mean=0 and variance=1? Jun 27, 2013 at 12:27
• @user83369 Do you have values for mean and variance of $Z_t$ please? Jun 27, 2013 at 13:04
• Ok Its given as a White noise with a constant variance $\sigma^{2}$ and mean zero, Jun 27, 2013 at 13:06

## 2 Answers

Let $X, Y$ and $Z$ be any random variables; then

$$Cov(X+Y,Z)=Cov(X,Z)+Cov(Y,Z)$$

from the very definition of covariance. Let us consider the given time series model $$X_t=a+bt+Z_t+0.6Z_{t-1},$$

with $Z_t$ i.i.d. random variables with variance $\sigma^2$.

As preliminary result we have

$$Cov(a,a)=Cov(bt,bt)=Cov(a,X)=Cov(bt,X)=0,$$

for any random variable $X$ because $E[a]=a$ and $E[bt]=bt$. Here $a$ denotes the random variable $a\cdot \mathbf{1}$, with $\mathbf{1}$ the identity r.v.. Similar considerations hold for $bt$, i.e. $bt:=bt\cdot \mathbf{1}$.

Using the above results we can write for $k\neq 0$

$$Cov(X_t,X_{t+k})=Cov(a,X_{t+k})+Cov(bt,X_{t+k})+Cov(Z_t,X_{t+k})+0.6Cov(Z_{t-1},X_{t+k})=\\ Cov(Z_t,X_{t+k})+0.6Cov(Z_{t-1},X_{t+k})=\\ Cov(Z_t,a)+Cov(Z_t,b(t+k))+Cov(Z_t,Z_{t+k})+0.6Cov(Z_t,Z_{t+k-1})+\\ 0.6Cov(Z_{t-1},a)+0.6Cov(Z_{t-1},b(t+k))+0.6Cov(Z_{t-1},Z_{t+k})+0.36Cov(Z_{t-1},Z_{t+k-1}),$$

i.e.

$$Cov(X_t,X_{t+k})= Cov(Z_t,Z_{t+k})+0.6Cov(Z_t,Z_{t+k-1})+0.6Cov(Z_{t-1},Z_{t+k})+0.36Cov(Z_{t-1},Z_{t+k-1}).$$

If $k\pm 1$, then

$$Cov(X_t,X_{t\pm 1})= 0.6Cov(Z_t,Z_{t})=0.6\sigma^2.$$

If $k\neq \pm 1$, then

$$Cov(X_t,X_{t+k})= 0.$$

$E[X_t]=a+bt$,

therefore we may find the variance as:

$$Var[X_t]=E[(Z_t+0.6Z_{t-1})(Z_t+0.6Z_{t-1})]=\sigma^2(1+0.36),$$

and covariance as:

$$Cov[X_t,X_{t+k}]=E[(X_t-(a+bt))(X_{t+k}-(a+b(t+k)))]$$ $$=E[(Z_t+0.6Z_{t-1})(Z_{t+k}+0.6Z_{t-1+k})].$$

Let $k=0$, then$$Cov[X_t,X_t]=Var[X_t]=\sigma^2(1+0.36).$$

Let $k= + 1$, then$$Cov[X_t,X_{t+1}]=E[(Z_t+0.6Z_{t-1})(Z_{t+1}+0.6Z_{t})]$$$$=E[(Z_t\cdot0.6Z_{t})]=0.6\sigma^2.$$ You may see that the same holds for $k=-1$.

Finally for $k>1$ and $k<-1$ $$Cov[X_t,X_{t+k}]=E[(Z_t+0.6Z_{t-1})(Z_{t+k}+0.6Z_{t-1+k})]=0,$$ since, in the expansion there will be no random variable products with same time index and since different time indexes are independent and mean is zero, the result will be zero.

• Thanks a lot for the answer Jun 27, 2013 at 18:51