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

time_decompose with missing values #21

Open
cdeterman opened this issue Nov 5, 2018 · 1 comment
Open

time_decompose with missing values #21

cdeterman opened this issue Nov 5, 2018 · 1 comment

Comments

@cdeterman
Copy link

My dataset is much larger but this error is trivially reproduced with the following sample data.

tmp <- structure(list(ds = structure(c(16482, 16483, 16484, 16485, 16486, 
16487), class = "Date"), y = c(2.16618784530387, NA, NA, 1.95971962616822, 
NA, NA)), .Names = c("ds", "y"), row.names = c(NA, -6L), class = c("tbl_df", 
"tbl", "data.frame"))

Obviously there are NA values. I have been using the prophet package to build some forecast models which handles NA values without an issue. There are likely outliers in my datasets that I would like to leverage anomalize. However, there are various NA values that cause an error to be through with the first time_decompose function. For example

tmp %>%
  time_decompose(y)

Converting from tbl_df to tbl_time.
Auto-index message: index = ds
frequency = 1 days
trend = 6 days
Error in na.fail.default(as.ts(x)) : missing values in object

Thoughts on how to address this?

@srgorelik
Copy link

I've been having the same problem. Has anyone found a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants