I want to conduct the Ljung-Box test on residuals of the ARIMA model with
Box.test(e, type = "Ljung-Box", fitdf = degrees_of_freedom)
where N = 3064, with 8 variables and additional 1 adjustmend from ar(1) in ARIMA model.
But I get weird results
X-squared = 20.134, df = -3055, p-value = NA
Obviously df and p-value are off and I know it has to do something with the
lag parameter in Box.test function. But I don't know what this parameter really does nor how to determine it.