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

Problem with predict() in Time Series chapter #114

Open
cmusso86 opened this issue Jun 16, 2022 · 2 comments
Open

Problem with predict() in Time Series chapter #114

cmusso86 opened this issue Jun 16, 2022 · 2 comments

Comments

@cmusso86
Copy link

cmusso86 commented Jun 16, 2022

While translating the book to the Portuguese version, we have found some problems with chunk 19: nb_reg in Time series chapter.

Line 590
observed <- predict(fitted_model, simulate_pi = FALSE)

returned an error about the tsible object, suggesting the use of bind_cols... (which dint help me a lot), but after some research and some trials, I corrected the error in the Portuguese version by transforming the "counts" object to a simple data.frame (not a tibble) prior to fitting the model, by creating auxiliary objects (count_f) to fit the models. That is, I dit it basically every time the model was fitted when there was a Fourier term.

I don't know if it was the best solution... but as far as my research on the matter went, it was the solution I could find that you cause less changes to the original code....

@babayoshihiko
Copy link

Is your solution like this?

fitted_model <- trending::fit(model, data.frame(counts))

Related to:
https://stackoverflow.com/questions/72017511/problem-fitting-a-regression-to-time-series-with-trending-package

@aspina7
Copy link
Contributor

aspina7 commented Nov 19, 2022

sorry for delayed response - see this discussion #89

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

3 participants