# How to turn many variables into one for the PACF equation

I have been trying to calculate the PACF manually, but I encountered some issues with the following equation:

$$PACF = \frac{Covariance ([Y_{t}|Y_{t-1}, Y_{t-2},...,Y_{t-k+1}],[Y_{t-k}|Y_{t-1}, Y_{t-2},...,Y_{t-k+1}])}{\sigma_{[Y_{t}|Y_{t-1}, Y_{t-2},...,Y_{t-k+1}]} \sigma_{[Y_{t-k}|Y_{t-1}, Y_{t-2},...,Y_{t-k+1}]} }$$

Let's supposed we are trying to calculate the PACF for lag 3, so k=3.

Nominator: To be able to calculate the Covariance we need two variables. The equation for covariance requires cov(x, y).

Denominator: To be able to calculate the standard deviation we need one variable.

With lag = 3 on the nominator, there would be 6 variables in total, three on the left and 3 on the right side of the comma.

For lag 2 the way we turn 4 variables into two is by plotting the two variables on each side of the formula against each other, finding a line of best fit using OLS, and then finding the residuals. This then gives us one variable, so two in total for the nominator.

How would I do this for lag 3, I could maybe plot 3 variables and find that correlation, but that clearly isn't it because what about lag 4 or lag 5.

So how do I turn the list of variables into two for the nominator (or one for each standard deviation on the denominator)?

• Hi, there are blind and visually impaired users of this site who interact with it using screen readers. The screen readers can't handle the equation in your screenshot. Please edit the post to include the equation as LaTeX. If it helps, we have some resources on using LaTeX on Cross Validated. Mar 2, 2022 at 2:15
• @kjetilbhalvorsen thank you for the feedback, hopefully it's clear now. Mar 2, 2022 at 8:40
• Hoping to understand your question better. You're saying to calculate the PACF at lag 2, you run a regression on Yt and a regression on Yt-k to find the residuals, which can be used in the covariance function. And you're wondering how to extend this to a higher number of lags? Mar 4, 2022 at 7:53
• @BenjaminRichards, yes, precisely. With 2 lags it's easy because I just have to plot one against the other, but what happens when it's lag=4, then you have 4 variables, how do you plot those to end up with one set of data? Hopefully this clarifies it? Mar 4, 2022 at 9:22

The solution to your problem is multiple linear regression. You can easily regress $$Y_t$$ and $$Y_{t-k}$$ on multiple lags. For example, for lag 4 you would run $$\hat Y_{t-4} = \beta_1 Y_{t-1} + \beta_2 Y_{t-2}+\beta_3 Y_{t-3}$$ and use that to calculate the residuals.