-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Using boxcox transforamtion #647
Comments
If I understand this code and description correctly, then you are applying the inverse transformation to each component separately. The components will sum appropriately in the transformed space, but not in the untransformed space. Suppose
But
in general. Any strictly convex or concave transformation will not give equality in that last step there. So the overall estimate If you want interpretability of the components post-transform and are trying to handle the skew in the noise, you might consider just using a log transform.
That is, the inverse transform here converts additive seasonality to multiplicative seasonality. So you can still inverse transform each component independently, and then just interpret it as multiplicative instead of additive. |
Thanks for the quick response. Ok this explanation makes a lot of sense, that the components do not maintain their additive properties when converting back and forth from the transformed space. The log/exp transformation worked great, thanks for the tip. |
Hi, thanks for the great forecasting tool. Though this is not directly a part of the forecasting code, I saw an issue regarding applying boxcox and transformations, so maybe this is an ok forum to ask my question.
I am currently having some trouble configuring the boxcox transformation to normalize data. When applying boxcox, I get better a better loss (mean average error) than not applying it. However, even after applying the inverse boxcox transformation, I get values in the seasonality decomposition part that do not seem to be correct. Specifically, the sum of trend+yearly+weekly do not add up to yhat. Below is an example of not applying boxcox:
And the results of (yhat-trend-yearly-weekly).plot() is a flat line at zero. Perfect, as expected. However, when applying box cox, predicting a forecast, inverting, then plotting, I get this. Notice how the trend, yearly, and weekly components do not add up to yhat.
I can prove this by plotting (yhat-trend-yearly-weekly).plot() in blue. I also overlayed an orange plot of yearly*5000 to show that the residual still models the yearly trend.
I wrapped prophet in my own class, but here is the psudeo code of what I am doing:
Any insight is appreciated. Thanks.
The text was updated successfully, but these errors were encountered: