# Working out Granger causality of time series where the series are described mathematically

Previously when doing coursework I would be given say two time series $x,y$ which are sampled for $t=1,\ldots,1000$ (or some other length) and I would be asked to calculate Granger causality from them. What I would do is fit two models for each, so for example for $x$ I would fit

\begin{align} x_1(t) &= a_1x(t-1) + a_2x(t-2) + \ldots + a_px(t-p) + \epsilon_{1}\\ x_2(t) &= b_1x(t-1) + b_2x(t-2) + \ldots + b_px(t-p) + \\ &+ c_1y(t-1) + c_2y(t-2) + \ldots + c_py(t-p) + \epsilon_{2} \end{align}

And then I would say that $y$ granger causes $x$ if and only if $\operatorname{var}(\epsilon_1) > \operatorname{var}(\epsilon_2)$ where $\epsilon$ is the estimated noise. (I would do the same to see the other way round).

Now I am looking at an exam question where instead of being given a sample of a time series I am given two time series mathematically and I am asked to calculate the Granger causalities between them so I guess the approach would be different since there is no need to fit the series or estimate the errors. Unfortunately all of the material I find online deals with the case where you have a sample rather than the entire data set. I'll show you what I have done so far.

The time series are

\begin{align} y(t) &= \frac{1}{10}y(t-1) + e_1(t) \\ x(y) &= \frac{8}{10}x(t-1) + \frac{1}{10}y(t-1) + e_2(t) \end{align}

Where $e_1,e_2$ are independent and standard normal random variables and $t$ is time. First I checked if $(x(t),y(t))$ was a stable time series by looking at the eigenvalues of the matrix $$A = \begin{pmatrix} \frac{1}{10} & 0 \\ \frac{1}{10} & \frac{8}{10} \end{pmatrix}$$ which turned out to be $\frac{1}{10},\frac{8}{10}$. Since both lie in the unit circle the time series is stable.

Now I look at the mean and variance of $x(t)$ and $y(t)$. I find $\mathbb{E}(x)=\mathbb{E}(y) = 0$ and then I find

\begin{align} \operatorname{var}(y) &= \frac{1}{100} \operatorname{var}(y) +1 &\implies \operatorname{var}(y) &=\frac{100}{99} \\ \operatorname{var}(x) &= \frac{64}{100} \operatorname{var}(x) + \frac{1}{100} \operatorname{var}(y) &\implies \operatorname{var}(x) &= \frac{2500}{891} \end{align}

Now I have gotten that out the way, I need to calculate the Granger causality and this is where I get confused. I am unsure of the method because it's different to how I usually do this. Here is my attempt, I put error terms in square brackets for clarity.

To consider the Granger causality from $x$ to $y$ I look at

\begin{align} y_1(t) &= \frac{1}{10}y(t-1) + [e_1(t)] \\ y_2(t) &= \frac{1}{10}y(t-1) + cx(t-1) + \left[e_1(t) -cx(t-1)\right] \end{align}

Here $y_1(t)$ is $y$ without lags of $x$ included, $y_2(t)$ is with a lag of $x$ included at amplitude $c$, but then as to not change the time series I remove this bit in the error term (I'm very unsure of this!).

I observe $\operatorname{var}(e_1) = 1$ and $\operatorname{var}(e_1 - cx(t-1)) = 1 - c^2 \frac{2500}{891} < 1$ so there is no Granger causality from $x$ to $y$ (which aligns with what you would expect looking at the series).

Now looking to see if there is Granger causality from $y$ to $x$

\begin{align} x_1(t) &= \frac{8}{10}x(t-1) + \left[ e_2(t) + \frac{1}{10}y(t-1) \right] \\ x_2(t) &= \frac{8}{10}x(t-1) + \frac{1}{10}y(t-1) + [e_2] \end{align}

Then I find $$\operatorname{var}\left( \frac{1}{10}y(t-1) + e_2(t) \right) = \left( \frac{1}{100} \times \frac{100}{99} + 1 \right) > \operatorname{var}(e_2) = 1$$

And using a formula given to me the Granger causality is $$G_{y \rightarrow x} = \log \left( \frac{\frac{1}{100} \times \frac{100}{99} + 1}{1} \right) = \log \left( \frac{100}{99} \right) \approx 0.01$$

I don't really know how to interpret the $0.01$, but at least there is some Granger causality as expected.

My question is, is this the correct way to calculate Granger causality between the two time series given?

Thanks for your time!