Produces either a dygraph (see the online documentation for more detail) or a ggplot/plotly object for objects of class persephone.

plotResiduals(
  x,
  which = c("res", "acf", "acf2", "pacf", "sreshist", "nqq"),
  main = NULL,
  interactive = TRUE,
  ...
)

Arguments

x

an object of class persephone.

which

character ("res","acf","acf2", "pacf","sreshist", "nqq") selecting the preferred type of plot, see Details. A numeric value (1:6) corresponding to one of these characters is also accepted.

main

plot title

interactive

If the return value would be a ggplot object, wrap it in plotly::ggplotly before returning.

...

other plotting parameters to affect the plot. Not currently used.

Value

Returns an object of class dygraphs, ggplot or plotly

Details

The following options are available for the parameter which.

  • res: residuals (1)

  • acf: autocorrelations of the residuals (2)

  • pacf: partial autocorrelations of the residuals (3)

  • acf2: autocorrelations of the squared residuals (4)

  • sreshist: histogram of standardized residuals including normal curve (5)

  • nqq: normal q-q plot of standardized residuals (6)

Examples

data(AirPassengers, package = "datasets")
# Generate a persephone object, in this case an x13Single object
obj <- perX13(AirPassengers, "RSA1")

obj$run()
# Plot the residuals after run
plotResiduals(obj)
# Plot the autocorrelations of the residuals plotResiduals(obj, which="acf") #> Warning: `gather_()` was deprecated in tidyr 1.2.0. #> Please use `gather()` instead. #> This warning is displayed once every 8 hours. #> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.