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)?

  • $\begingroup$ 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. $\endgroup$ Mar 2, 2022 at 2:15
  • $\begingroup$ @kjetilbhalvorsen thank you for the feedback, hopefully it's clear now. $\endgroup$
    – sir.edward
    Mar 2, 2022 at 8:40
  • $\begingroup$ 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? $\endgroup$
    – benja616
    Mar 4, 2022 at 7:53
  • $\begingroup$ @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? $\endgroup$
    – sir.edward
    Mar 4, 2022 at 9:22

1 Answer 1


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.

You can run multiple linear regression on as many independent variables as you want, though visualising it with a plot is difficult.

  • $\begingroup$ Great, thank you! $\endgroup$
    – sir.edward
    Mar 4, 2022 at 10:07
  • $\begingroup$ I'm assuming the example you used was for the right side of the comma? $\endgroup$
    – sir.edward
    Mar 6, 2022 at 8:40
  • $\begingroup$ Yes and you can do the same for the left side $\endgroup$
    – benja616
    Mar 8, 2022 at 7:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.