0

I am working with a tsibble created from a csv file and I have begun following along Rob Hyndman's fpp3 textbook creating ARIMA models with the fable package. My goal is to plot the PACF of the given ARIMA model. This is inspired by following along a Duke University article that details how to find the correct ARIMA() arguments by looking at the ACF() and PACF() plots of the time series, and then of the ARIMA models. I can plot the PACF(), but only of the time series "global_economy", which comes with the tsibble package. And then when it comes to plotting the residuals of my model, I can only view the ACF(). I am not sure if there is another function that returns the PACF() values in a table output. Has anyone plotted the PACF() of your model in R, using these packages below?

library(tidyverse)
library(fpp3)
library(tsibble)
library(feasts)

global_economy %>%
  filter(Code == "CAF") %>%
  gg_tsdisplay(difference(Exports), plot_type='partial', lag_max = 36)

caf_fit <- global_economy %>%
  filter(Code == "CAF") %>%
  model(arima000 = ARIMA(Exports ~ pdq(0,0,0)),
        arima210 = ARIMA(Exports ~ pdq(2,1,0)),
        arima013 = ARIMA(Exports ~ pdq(0,1,3)),
        stepwise = ARIMA(Exports),
        search = ARIMA(Exports, stepwise=FALSE))

caf_fit %>% select(.model = arima000) %>% gg_tsresiduals(lag = 36)

ACF and PACF of my tsibble using gg_tsdisplay, residuals plot of my ARIMA(0,0,0) model using gg_tsresiduals

In summary: I have only been able to plot the PACF() of my tsibble. The gg_tsresiduals() function also only returns the ACF() plot of the ARIMA model. My goal is to plot the PACF() of the given ARIMA model. So far I can't find any documentation that can help with this.

  • 1
    Hi @Daniel Lupercio, could you please share your data using `dput(bx_ts)`? So we can help you better. – Quinten Mar 28 '22 at 17:11
  • Hey @Quinten, I have instead edited my question. I am using a tsibble provided by the tsibble package, for easier reproducibility. – Daniel Lupercio Mar 30 '22 at 18:29
  • Great, but without reproducible data we can’t help you easily. Could you please provide your data in the question? – Quinten Mar 30 '22 at 18:37
  • Users can use the global_economy data can when the tsibble library is loaded. My original data went through some feature engineering to get to this point, that I think I can replicate the results instead with the data and code provided in the question. – Daniel Lupercio Mar 30 '22 at 19:15

0 Answers0