当前位置:网站首页>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
边栏推荐
- Definition and application of method
- Maybe I can't escape class! How to use paddlex to point the head?
- Chain stack
- 2021信息科学Top10发展态势。深度学习?卷积神经网络?
- 把LVGL所有控件整合到一个工程中展示(LVGL6.0版本)
- Using or tools to solve the path planning problem with capacity constraints (CVRP)
- Circular queue
- 硬件知识2--协议类(基于百问网硬件操作大全视频教程)
- Pytorch个人记录(请勿打开)
- Ninja startup process
猜你喜欢

ARM架构与编程4--串口(基于百问网ARM架构与编程教程视频)

硬件知識1--原理圖和接口類型(基於百問網硬件操作大全視頻教程)

CPC客户端的安装教程

论文解读:《一种利用二核苷酸One-hot编码器识别水稻基因组中N6甲基腺嘌呤位点的卷积神经网络》

VIO---Boundle Adjustment求解过程

A hundred schools of thought contend at the 2021 trusted privacy computing Summit Forum and data security industry summit

The online seminar on how to help data scientists improve data insight was held on June 8

How to cast?

Check the sandbox file in the real app

How to develop the computing power and AI intelligent chips in the data center of "digital computing in the East and digital computing in the west"?
随机推荐
NVIDIA 英伟达发布H100 GPU,水冷服务器适配在路上
Build "green computing" and interpret "Intelligent Computing Center"
Chaoslibrary · UE4 pit opening notes
机器学习/深度学习必备数学知识
Chain queue
Nt68661 screen parameter upgrade-rk3128-start up and upgrade screen parameters yourself
Interpretation of the paper: using attention mechanism to improve the identification of N6 methyladenine sites in DNA
High level API of propeller realizes image rain removal
笔记 | 百度飞浆AI达人创造营:深度学习模型训练和关键参数调优详解
3D image classification of lung CT scan using propeller
ARM架构与编程4--串口(基于百问网ARM架构与编程教程视频)
时间序列的数据分析(三):经典时间序列分解
Smart pointer shared_ PTR and unique_ ptr
Opencv library installation path (don't open this)
Comparison between pytorch and paddlepaddle -- Taking the implementation of dcgan network as an example
笔记 | 百度飞浆AI达人创造营:数据获取与处理(以CV任务为主)
Vio --- boundary adjustment solution process
BST tree
NVIDIA NVIDIA released H100 GPU, and the water-cooled server is adapted on the road
High level API of propeller to realize face key point detection
