#
Time Series Graphics
#
Seasonal periods
- Some graphics and some models will use the seasonal period of the data. It is the number of observations before the seasonal pattern repeats
- For quarterly, monthly and weekly data, there is only one seasonal period — the number of observations within each year.
- If the data is observed more than once per week, then there is often more than one seasonal pattern in the data.
from pyconfig.utils import *
import statsmodels.datasets as smd
import matplotlib.pyplot as plt
import darts.timeseries as ts
df = smd.get_rdataset('melsyd', 'fpp2').data
df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 283 entries, 0 to 282
Data columns (total 3 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 First.Class 282 non-null float64
1 Business.Class 176 non-null float64
2 Economy.Class 282 non-null float64
dtypes: float64(3)
memory usage: 6.8 KB
df.shape
(283, 3)
df.head()
First.Class | Business.Class | Economy.Class | |
---|---|---|---|
0 | 1.912 | NaN | 20.167 |
1 | 1.848 | NaN | 20.161 |
2 | 1.856 | NaN | 19.993 |
3 | 2.142 | NaN | 20.986 |
4 | 2.118 | NaN | 20.497 |
plt.plot(df)
plt.legend(['First Class', "Business Class", "Economy Class"])
plt.show()