当前位置:网站首页>Data analysis of time series (I): main components
Data analysis of time series (I): main components
2022-07-23 12:18:00 【-Send gods-】
A time series is a group arranged in the order of time , And a sequence of data points containing some information , The development trend of data is usually included in time series data ( Up 、 Down 、 keep ) And the changing law of data ( Seasonality ) Other characteristics . These characteristics often have certain regularity and predictability , Specifically, time series data has the following characteristics :
- Trend : A variable changes over time or an independent variable , It presents a relatively slow and long-term continuous rise 、 falling 、 Keep the same trend , But the range of change may not be equal .
- Seasonality : Due to external influences, such as the law of peaks and valleys with the alternation of natural seasons .
- Randomness : Individual moments show random changes , The whole is in a statistical law .
In some application scenarios, it is necessary to predict time series data , For example, in retail , E-commerce and other industries need the sales amount for a period of time in the future , passenger flow , Forecast the order quantity , Accurate prediction results can provide decision-making reference for the leadership of enterprises , And help to improve the human efficiency of the enterprise , Bring more profits to the enterprise .
One , trend (Trend)
Time series data often contain certain data development trends , For example, the data in the figure below has a very obvious trend :

Two , Seasonality (Seasonal)
Seasonality in time series data refers to the regularity of periodic changes contained in the data , These cyclical changes are often related to the year , month , quarter , Week and other seasonal time points are closely related . Usually, seasonal factors can be divided into 1. Additive seasonality ,2. Multiplicative seasonality .
2.1 Additive seasonality (Additive)
The so-called additive seasonality means that the amplitude of periodic change of time series data will not change with the development of time , In other words, the magnitude of data changes is not affected by time ( The amplitude remains unchanged ) As shown in the figure below :

As you can see from the above figure , The data shows a seasonal change law , But the magnitude of this change has not changed with the development of time , That is, time has no effect on seasonal changes .
2.2 Multiplicative seasonality (Multiplicative)
The so-called multiplicative seasonality means that the amplitude of periodic change of time series data will change with the development of time , In other words, the magnitude and time of data change show a linear relationship, as shown in the figure below :

As you can see from the above figure , The data shows a seasonal change law , And the amplitude of this seasonal change changes with the development of time ( Such as getting bigger or smaller ).
3、 ... and , residual (Residual)
Residual refers to the remaining part after the trend and seasonal characteristics are deleted from the time series data , We generally believe that the mean value of the residuals of time series data with seasonal characteristics is 0 The positive distribution of , Residuals are generally considered as white noise signals , We can get the residual by gradually deleting the trend and seasonal characteristics in the time series data :

As shown in the above figure, when the trend is deleted from the original data , The remaining ingredient is : Seasonality + residual , Next we will start from the seasonal + The residual is obtained by deleting seasonal components from the components of the residual .

So let's go through python Third party Library of statsmodes Of seasonal_decompose To decompose time series data :
from statsmodels.tsa.seasonal import seasonal_decompose
df=pd.read_csv("airline_Passengers.csv")
df.set_index('Period',inplace=True)
df.index = pd.to_datetime(df.index)
data = df["#Passengers"]
seasonal_decomp = seasonal_decompose(data, model="additive")
seasonal_decomp.plot();summary
The main components of time series data include : trend 、 Seasonality 、 residual . Seasonality is divided into additive seasonality and multiplicative seasonality . have access to statsmodes Bag seasonal_decompose Method to decompose time series .
Reference material
边栏推荐
- Tips for using textviewdidchange of uitextview
- Notes | Baidu flying plasma AI talent Creation Camp: detailed explanation of deep learning model training and key parameter tuning
- Solve Sudoku puzzles with Google or tools
- 使用pycaret来进行数据挖掘:关联规则挖掘
- Six trends and eight technologies of high-performance computing in data centers under "data center white paper 2022" and "computing from the east to the west"
- 生命科学领域下的医药研发通过什么技术?冷冻电镜?分子模拟?IND?
- After the VR project of ue4.24 is packaged, the handle controller does not appear
- NVIDIA 英伟达发布H100 GPU,水冷服务器适配在路上
- 论文解读:《一种利用二核苷酸One-hot编码器识别水稻基因组中N6甲基腺嘌呤位点的卷积神经网络》
- strand
猜你喜欢

数据分析(二)

2021 TOP10 development trend of information science. Deep learning? Convolutional neural network?

Pytorch个人记录(请勿打开)

笔记 | 百度飞浆AI达人创造营:数据获取与处理(以CV任务为主)

2021可信隐私计算高峰论坛暨数据安全产业峰会上百家争鸣

Using Google or tools to solve logical problems: Zebra problem

Ninja startup process

论文解读:《基于预先训练的DNA载体和注意机制识别增强子-启动子与神经网络的相互作用》

Tips for using textviewdidchange of uitextview

使用pycaret来进行数据挖掘:关联规则挖掘
随机推荐
2021 TOP10 development trend of information science. Deep learning? Convolutional neural network?
Gartner调查研究:中国的数字化发展较之世界水平如何?高性能计算能否占据主导地位?
论文解读:《基于预先训练的DNA载体和注意机制识别增强子-启动子与神经网络的相互作用》
Practical convolution correlation trick
论文解读:《功能基因组学transformer模型的可解释性》
数字经济“双碳”目标下,“东数西算”数据中心为何依靠液冷散热技术节能减排?
“東數西算”下數據中心的液冷GPU服務器如何發展?
数据挖掘场景-发票虚开
“东数西算”下数据中心的液冷GPU服务器如何发展?
After the VR project of ue4.24 is packaged, the handle controller does not appear
for循环
virtual function
Introduction and practice of Google or tools for linear programming
液冷数据中心如何构建,蓝海大脑液冷技术保驾护航
Six trends and eight technologies of high-performance computing in data centers under "data center white paper 2022" and "computing from the east to the west"
2021信息科学Top10发展态势。深度学习?卷积神经网络?
Solve Sudoku puzzles with Google or tools
Using or tools to solve the path planning problem (TSP)
Smart pointer shared_ PTR and unique_ ptr
CPC client installation tutorial
