当前位置:网站首页>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
边栏推荐
- Necessary mathematical knowledge for machine learning / deep learning
- 数据挖掘场景-发票虚开
- 论文解读:《利用注意力机制提高DNA的N6-甲基腺嘌呤位点的鉴定》
- 绿色数据中心“东数西算”全面启动
- g2o安装路径记录--为了卸载
- Green data center: comprehensive analysis of air-cooled GPU server and water-cooled GPU server
- Development and deployment of steel defect detection using paddlex yolov3 of propeller
- ARM架构与编程5--gcc与Makefile(基于百问网ARM架构与编程教程视频)
- strand
- 保存实质审查请求书出现Schema校验失败的解决方法
猜你喜欢

论文解读:《i4mC-Deep: 利用具有化学特性的深度学习方法,对 N4-甲基胞嘧啶位点进行智能预测》

How to cast?

论文解读:《利用注意力机制提高DNA的N6-甲基腺嘌呤位点的鉴定》

Comparison between pytorch and paddlepaddle -- Taking the implementation of dcgan network as an example

NVIDIA NVIDIA released H100 GPU, and the water-cooled server is adapted on the road

绿色数据中心:风冷GPU服务器和水冷GPU服务器综合分析

Introduction and use of Ninja

Pytorch个人记录(请勿打开)

Connaissance du matériel 1 - schéma et type d'interface (basé sur le tutoriel vidéo complet de l'exploitation du matériel de baiman)

Analyze the pre integration of vio with less rigorous but logical mathematical theory
随机推荐
数据分析的重要性
Comment se développe le serveur GPU refroidi à l'eau dans le Centre de données dans le cadre de l'informatique est - Ouest?
Gartner调查研究:中国的数字化发展较之世界水平如何?高性能计算能否占据主导地位?
LVGL8.1版本笔记
Linked list related interview questions
保存实质审查请求书出现Schema校验失败的解决方法
Introduction and use of Ninja
论文解读:《基于预先训练的DNA载体和注意机制识别增强子-启动子与神经网络的相互作用》
论文解读:《基于注意力的多标签神经网络用于12种广泛存在的RNA修饰的综合预测和解释》
论文解读:《开发一种基于多层深度学习的预测模型来鉴定DNA N4-甲基胞嘧啶修饰》
Lvgl8.1 version notes
NLP自然语言处理-机器学习和自然语言处理介绍(一)
ARM架构与编程5--gcc与Makefile(基于百问网ARM架构与编程教程视频)
How to build a liquid cooling data center is supported by blue ocean brain liquid cooling technology
Neo4j 知识图谱的图数据科学-如何助力数据科学家提升数据洞察力线上研讨会于6月8号举行
VIO---Boundle Adjustment求解过程
建设“绿色计算”,解读“智算中心”
Notes | (station B) Adult Liu: pytorch deep learning practice (code detailed notes, suitable for zero Foundation)
2021 TOP10 development trend of information science. Deep learning? Convolutional neural network?
Hard disk partition of obsessive-compulsive disorder
