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.

# How to explain Y axis values of plot_components for yearly, monthy, weekly. #876

Closed
opened this issue Mar 5, 2019 · 6 comments

### akbaramed commented Mar 5, 2019 • edited

 How to explain Y axis values of plot_components for yearly, monthly, weekly graphs. Question1: the values for y axis for the above 3 plots is different or same. Question2: what scale are the y axis values ? Can it be taken as the x% change in values or x times the amount added or subtracted Thanks
Contributor

### bletham commented Mar 9, 2019

 If you have additive seasonality (the default), then the values on the Y axis can be seen as the incremental effect on `y` of that seasonal component. For instance, in the plot at the bottom here: https://facebook.github.io/prophet/docs/quick_start.html, the number "0.25" for Monday indicates that every Monday, 0.25 of the `y` is attributed to the fact that it is Monday. Alternatively, you could think of it like Monday has a +0.25 effect on `y`. If you use multiplicative seasonality, then the meaning will be the same but it will be in terms of a % instead of a raw number, and the axis label will actually show a % sign like in https://facebook.github.io/prophet/docs/multiplicative_seasonality.html
Author

### akbaramed commented Mar 12, 2019 • edited

 Hello, thank you for the reply. to give some more background to what I am asking. my Y value is usually in thousands (19,000 ; 12,852, 4583, so on) for example if I add the value from my weekend plot which are in a range of (-1.6 to 27.6) to the Y value is the change in the Y on a particular day of the week. Confusion here is that the Y value is so high compared to the value from the weekly plot. Could you please elaborate more on " Alternatively, you could think of it like Monday has a +0.25 effect on y". with the above Y value and weekly values. Another point where there is major confusion. Using Additional Seasonality Model 1 (RMSE = 430.9) method = 'logistic', where there is no transformation done on Y, I get values of weekly between (-1.6 to 27.6). Model 2 (RMSE 360.8) method= 'logistic', I take log transformation of Y and then the anti log of the fbprohept predict object to show the values in the graphs, here the value of weekly column does not convert back to the model 1 values or anywhere close. For method 2 After taking anti log I get Y back as (19,000 ; 12,852, 4583, so on) but weekly values are between (0.99 to 1.6) after taking anti log. The affect is very small here as compared to the Method 1 for weekly. why is this ? Preferred use is model 2. There is something which I am missing or my fundamental understanding of the weekly values is wrong. Can you please throw some light on this problem of mine. thanks
Contributor

### bletham commented Mar 13, 2019

 If you post the `m.plot` and `m.plot_components` plots I may be able to comment more on it, but it sounds like the fitted weekly effect is just very small then. As for the log transform: If you take the inverse transform of each component, this will not give you the effect of the component in the untransformed space because log is a concave function. I give a discussion of that issue here: #647 (comment) . In (2), the exp() of the individual components now correspond to multiplicative seasonality, as described in my comment there.
Author

### akbaramed commented Mar 14, 2019

Many thanks for the reply. Please find m.plot and m.plot_components

## The Y value is in log. No inverse transformations have been done on the plots above.

But to show the results I take anti log and plot them and then create my own plots in tableau
So as per your comments if it becomes multiplicative seasonality then the effect is in % of the value
example looking at the graphs above after transforming the values for weekly and yhat to anti log

here the
weekly value is exp(model_forecasted.weekly)

finding the Y axis for weekly plot
[dataOutput.groupby([dataOutput['ds'].dt.weekday])['weekly'].mean(),'Weekly'] ## weekly 6 is sunday; 0 is Monday
the results I get is
[ds
0 1.001709
1 1.003528
2 1.000097
3 1.000368
4 0.996843
5 0.999944
6 0.997527
Name: weekly, dtype: float64, 'Weekly']

After transformation and the above logic, similar plot to the one mode created

Would I be right in saying that on Monday there is a 1% change in the value of Y (5,438)

thanks

Contributor

### bletham commented Mar 16, 2019

 In the last plot there, the correct intepretation is that on Monday, ``````y = 1.002 * trend `````` which is 0.2% seasonality. Yeah, looking at the plot of the forecast, there really doesn't seem to be much weekly effect going on there. For instance if you look at 2017-11 through 2018-01, it's pretty much a straight line; there aren't any visible weekly oscillations in the time series.
Author

### akbaramed commented Mar 18, 2019

 Thank you very much for your help and clarification.

### akbaramed closed this Mar 18, 2019

to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.