Closed beloteloff closed 7 years ago
This is a bug, fixed in #28. Can you install the latest version from Github and check if it is working for you?
fcst: pd.DataFrame output of self.predict.
ax: Optional matplotlib Axes to plot on. One will be created if this
is not provided.
uncertainty: Optional boolean to plot uncertainty intervals.
Returns
-------
a list of matplotlib artists
"""
artists = []
if not ax:
fig = plt.figure(facecolor='w', figsize=(10, 6))
ax = fig.add_subplot(111)
df_s = fcst.copy()
df_s['dow'] = df_s['ds'].dt.weekday_name
df_s = df_s.groupby('dow').first()
days = pd.date_range(start='2017-01-01', periods=7).weekday_name
y_weekly = [df_s.loc[d]['weekly'] for d in days]
y_weekly_l = [df_s.loc[d]['weekly_lower'] for d in days]
y_weekly_u = [df_s.loc[d]['weekly_upper'] for d in days]
artists += ax.plot(range(len(days)), y_weekly, ls='-',
c='#0072B2')
if uncertainty:
artists += [ax.fill_between(range(len(days)),
y_weekly_l, y_weekly_u,
color='#0072B2', alpha=0.2)]
ax.grid(True, which='major', c='gray', ls='-', lw=1, alpha=0.2)
ax.set_xticks(range(len(days)))`
in source code
Or, I can't understand correctly, how you can do weekly plot, if I have only 1st values for each month. In this case, weekly plots is a good choice for time series analysis?
Thanks for your job!
The weekly plot always starts on Sunday.
Except there is a bug in the version on pip which is affecting your plot so that the axes are shifted by one - You can see that there is a tick at the end with no label. That one should be Saturday, and all of the other ticks should be shifted one to the right, and then the first tick is Sunday. This is a bug only in the plot labels, everything else is correct.
I'd really recommend installing the latest version from Github to fix this. Download the code, and then in the python
directory run sudo python setup.py install
. We're planning to push a bugfix update to pip once we squash out a couple more issues.
ok, last question about weekly plots, I hope: why values can be negative? what it mean? Log from value?Thanks!
It's an additive model, so the value in the weekly seasonality plot is the difference in the value on that day. So, -0.2 on Monday means that on Tuesdays we subtract 0.2 from the time series, whereas on Sunday we add 0.1.
Hi! I saw,that days don't match in weekly plots with real days of the week, in source code I didn't saw the reference to the calendar. What day is the first in weekly decomposition plot?