6

I am confused about how to calculate p of ACF and q of PACF in AR, MA, ARMA and ARIMA. For example, in R, we use acf or pacf to get the best p and q.

However, based on the information I have read, p is the order of AR and q is the order of MA. Let's say p=2, then AR(2) is supposed to be y_t=a*y_t-1+b*y_t-2+c. We can calculate acf function (in R) when lag=1,2,3.... to find which lag brings the biggest acf function value. The same thing happens to MA for deciding q. But, does this mean that p and q have already been set up?

I guess here is the steps. But I am not sure if I am right. So, let's say in R's functions acf and pacf, is this the real process: 1. For p=1, set lag=1,2,3,...max to see which lag has the biggest autocorrelation value. 2. For p=2,3,4..., do the same thing to find the lags. 3. Compare those values with each other. Let's say the biggest autocorrelation value comes when p=2 and lag=4, when we say the order of AR, ie. p, is 2?

Cloud anyone please give me an example showing exactly how to estimate p and q?

meW
  • 3,832
  • 7
  • 27
Feng Chen
  • 2,139
  • 4
  • 33
  • 62

2 Answers2

0

This isn't a good stackoverflow question. You want to be on the Math site for this. To answer your question, though, there isn't one single generally accepted method for finding the optimal p and q.

Generally, what most people tend to do, is eyeball it using pacf visualizations (in which case, as you observe, you can't distinguish whether to put time into p or q) and set p == q.

An alternative way to do it, would be to try estimating your time series with different values of p and q, in a grid search, and pick the combination that maximizes some estimator like log likelihood or out-of-sample error, or whatever makes sense on your dataset.

If I might suggest, however, you probably want to start by looking at the rather extensive body of research on arima models and see how others have done this - that really should be your first step for questions like this.

Bob
  • 1,274
  • 1
  • 13
  • 26
  • This should not be on the mathematics site but rather on the statistics site [Cross Validated](https://stats.stackexchange.com). – Richard Hardy Nov 22 '21 at 06:10
-1

PACF plot for most optimal in the AR(p) model, ACF plot for most optimal in the MA(q) model