当前位置:网站首页>Time series ARIMA model
Time series ARIMA model
2022-07-27 16:15:00 【Carrot eating crocodile】
Data stationarity and difference method
Stability :
- Stationarity is the fitting curve obtained through the sample time series In the future, we can still follow the existing form “ inertia ” Underground continuation
- Stationarity requires that the mean and variance of the sequence do not change significantly
Strict stability and weak stability :
- Yan pingwen : The distribution of strict stationary representation does not change with time . Such as : White noise ( normal ), No matter how you take , It's all about expectations 0, The variance of 1
- Weakly stationary : Expectation and correlation coefficient ( Dependence ) unchanged At some point in the future t Value Xt It depends on its past information , So we need dependence
The difference method : Time series in t and t-1 Time difference

Autoregressive model (AR)
- Describe the relationship between current value and historical value , Use the historical time data of variables to predict themselves
- Autoregressive model must satisfy the requirement of stationarity
- p The formula definition of order autoregressive process : y t = μ + ∑ i = 1 p γ i y t − 1 + ϵ t y_{t}=\mu+\sum^{p}_{i=1}\gamma_{i}y_{t-1}+\epsilon_{t} yt=μ+∑i=1pγiyt−1+ϵt
- y t y_{t} yt It's the current value μ \mu μ It's a constant term , P P P It's order γ i {\gamma}_{i} γi It's an autocorrelation function ϵ t {\epsilon}_{t} ϵt It's error
Limitations of autoregressive models
- Autoregressive model uses its own data to predict
- Must be stable
- Must have autocorrelation , If the autocorrelation coefficient (φi) Less than 0.5, ... should not be used
- Autoregression is only applicable to predict the phenomenon related to its own early stage
Moving average model (MA)
- Moving average model focuses on the accumulation of error terms in autoregressive model
- q The formula definition of order autoregressive process : y t = μ + ϵ t + ∑ i = 1 q θ i ϵ t − 1 y_{t}=\mu+\epsilon_{t}+\sum^{q}_{i=1}\theta_{i}\epsilon_{t-1} yt=μ+ϵt+∑i=1qθiϵt−1
- The moving average method can effectively eliminate the random fluctuation in prediction
Autoregressive moving average model (ARMA)
- The combination of autoregressive and moving average
- Formula definition : y t = μ + ∑ i = 1 p γ i y t − 1 + ϵ t + ∑ i = 1 q θ i ϵ t − 1 y_{t}=\mu+\sum^{p}_{i=1}\gamma_{i}y_{t-1}+\epsilon_{t}+\sum^{q}_{i=1}\theta_{i}\epsilon_{t-1} yt=μ+∑i=1pγiyt−1+ϵt+∑i=1qθiϵt−1
ARIMA
- ARIMA(p,d,q) The model is called differential autoregressive moving average model (Autoregressive Integrated Moving Average Model, Brief notes ARIMA
- AR It's autoregression , p Is the autoregressive term ; MA For moving average q Is the moving average number of items ,d It is the difference number of times when the time series becomes stationary
- principle : The non-stationary time series is transformed into stationary time series, and then the dependent variable The model established by regressing only its lag value and the present value and lag value of random error term
Autocorrelation function ACF(autocorrelation function)
- An ordered sequence of random variables is compared to itself The autocorrelation function reflects the correlation between the values of the same sequence in different sequences
- The formula : A C F ( k ) = ρ k = C o v ( y t , y t − k ) V a r ( y t ) ACF(k)=\rho_{k}=\frac{Cov(y_{t},y_{t-k})}{Var(y_{t})} ACF(k)=ρk=Var(yt)Cov(yt,yt−k)
- ρ k \rho_{k} ρk The value range of is [-1,1]
Partial autocorrelation function (PACF)(partial autocorrelation funtion)
- For a smooth AR§ Model , Find the lag k Autocorrelation coefficient p(k) when In fact, it's not x(t) And x(t-k) A simple correlation between
- x(t) At the same time, it will suffer from the middle k-1 Random variables x(t-1)、x(t-2)、……、x(t-k+1) Influence And this k-1 All random variables and x(t-k) There is a correlation So the autocorrelation coefficient p(k) It's actually adulterated with other variables x(t) And x(t-k) Influence
- Cut out the middle k-1 Random variables x(t-1)、x(t-2)、……、x(t-k+1) After the interference of x(t-k) Yes x(t) The relevance of the impact .
- ACF It also includes the effects of other variables The partial autocorrelation coefficient PACF Is strictly the correlation between these two variables
ARIMA(p,d,q) Order determination :

truncation : Fall within the confidence interval (95% All of the points conform to the rule )
ARIMA Modeling process :
- Smooth the sequence ( Determination by difference method d)
- p and q Order determination :ACF And PACF
- ARIMA(p,d,q)
ARIMA example ( be based on python Realization )
Model selection AIC And BIC: Choose a simpler model
- AIC: Red pool information criterion (Akaike Information Criterion,AIC)
??? = 2? − 2ln(?) - BIC: Bayesian information rule (Bayesian Information Criterion,BIC)
??? = ??? ? − 2ln(?) - k There are several parameters in the model ,n Is the number of samples ,L Is the likelihood function
Model residual test :
- ARIMA Whether the residual error of the model is the average value 0 And the variance is a constant normal distribution
- QQ chart : Linear or normal distribution
Model selection and residual examples
边栏推荐
猜你喜欢

: 0xC0000005: 写入位置 0x01458000 时发生访问冲突----待解

Openwrt adds support for SD card

Introduction to JWT

Characters generated by JMeter function assistant in jmeter5.3 and later versions cannot be copied when they are grayed out

MySQL index

DRF学习笔记(一):数据序列化

mysql设置密码时报错 Your password does not satisfy the current policy requirements(修改·mysql密码策略设置简单密码)

时间序列-ARIMA模型
![[sword finger offer] interview question 50: the first character that appears only once - hash table lookup](/img/72/b35bdf9bde72423410e365e5b6c20e.png)
[sword finger offer] interview question 50: the first character that appears only once - hash table lookup

Addition, deletion, query and modification of MySQL table data
随机推荐
Firefox old version
ARIMA模型选择与残差
逗号操作符你有用过吗?
Makefile specifies the path of the library file loaded when the program runs
Understand │ what is cross domain? How to solve cross domain problems?
Live broadcast software development, customized pop-up effect of tools
The new JMeter function assistant is not under the options menu - in the toolbar
Mapreduce实例(二):求平均值
Baidu picture copy picture address
无线网络分析有关的安全软件(aircrack-ng)
Determine the exact type of data
DRF学习笔记(三):模型类序列化器ModelSerializer
Common Oracle statements
MySQL index
Six capabilities of test and development
Nacos
SQL multi table query
__ The difference between typeof and typeof
[sword finger offer] interview question 52: the first common node of two linked lists - stack, hash table, double pointer
Excel extract duplicates