1 year ago

#345773

test-img

Daniel Lupercio

Is there an R function that can plot the PACF() of an ARIMA model in the fable, feasts or fpp3 packages?

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.

r

time-series

arima

fable-r

0 Answers

Your Answer

Accepted video resources