Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faceted decomposition graphs for Classic, STL, and X-13 ARIMA SEATS similar to default plotting of class "stl" #1

Closed
paulhendricks opened this issue Feb 11, 2016 · 2 comments
Milestone

Comments

@paulhendricks
Copy link

Great package. What would you think of possibly implementing functionality that provides a facet of decomposition similar to the default plotting of an "stl" class.

In code, something that mimics this:

some_ts <- ts(rnorm(100), frequency = 12)
plot(stl(some_ts, s.window = "periodic"))

But with ggplot2 styles and similar to your API. Maybe a facet = TRUE flag?

library(ggseas)
# make demo data
ap_df <- data.frame(
   x = as.numeric(time(AirPassengers)),
   y = as.numeric(AirPassengers)
)

ggplot(ap_df, aes(x = x, y = y)) +
   geom_line(colour = "grey80") +
   stat_decomp(frequency = 12, facet = TRUE)
@ellisp
Copy link
Owner

ellisp commented Feb 14, 2016

I've got an idea to do this but I don't think it will be a stat or a geom; more a wrapper like GGally::ggpairs. The most obvious thing to do is to use facets, which means it won't fit simply into the ggplot structure. Will have a go some time soonish.

@ellisp ellisp added this to the 0.2.0 milestone Feb 14, 2016
@ellisp
Copy link
Owner

ellisp commented Feb 21, 2016

I've had a go at this and created a new ggsdc() function which you

can access in the GitHub version

devtools::install_github("ellisp/ggseas/pkg")
ggsdc(ldeaths_df, aes(x = YearMon, y = deaths, colour = sex), method = "seas", 
      frequency = 12, start = c(1949, 1)) +
      geom_line()

unnamed-chunk-6-3

Let me know what you think - and any stress tresting you can think of would be appreciated too. I'm not sure how robust it is, particularly for the X13-SEATS-ARIMA connection.

@ellisp ellisp closed this as completed in 9c315d6 Feb 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants