This is a Time Series problem. I am testing whether I have significance of residues at $lag=3$ using an $ARMA(1,1)$ model. From the $ACF$ plot, the autocorrelation of residues is significant.
The issue is I don't know what dof to use? My understanding is that dof account for the # of parameters I am testing. So if it's $ARMA(1,1)$, then I am testing $3$ parameters, in other words (an intercept, $\phi_1$ for the $AR(1)$ and $\theta_1$ for the $MA(1)$ part.
But when I run the R code, I get $0$ for the $p-value$. And if I test the $ARMA(1,1)$ at $lag=1$, I get
Warning message:
In pchisq(STATISTIC, lag - fitdf) : NaNs produced
This is the Box and Pierce functions, I am running:
residuals(ARMA.101) %>%
features(.resid, box_pierce, lag = 3, dof = 3)
residuals(ARMA.101) %>%
features(.resid, ljung_box, lag = 3, dof = 3)