Time series analysis
Time series analysis — time series data
For data: time series data
For the same object data from different time continuous observation made in
three parts
- Describe the past
- Analysis rule
- Fortune-telling
Three major models
- Seasonal decomposition
- Exponential smoothing method
- ARIMA model
Components
- Time element
- Numerical elements
Preprocessing: when there are missing values
- The method when the missing value is in the middle
Model 1 — Time series decomposition model
Time value change decomposition four kinds of changes
- Long-term trend TTT
has been affected by the long-term trend for a long period of time, showing a continuous rise or fall - Seasonal Trend SSThe change of S
from season (it can be in quarter, month, week and other time units, but not in year) makes the indicator change periodically - Cycle change CCC
takes several years as the cycle, showing wave-like cyclical changes, manifested as increasing and decreasing alternately - Irregular changes III
can not predict or unpredictable
Two models from four changes
T S C I T S C I TSCI
- Product model
- Additive model
SPSS operation
Step 1: Define the time variable
Step 2: Make time series diagram and analyze
- The timeline label is the time variable defined in the previous step
- Timeline option: You can mark the corresponding timeline in the generated graph
- Format: the format of the drawing
After drawing the picture, you can modify the fill color of the picture, etc.
- Analysis based on time series graphs
Step 3: Seasonal decomposition
Cycle is less than 1 year
-
Result analysis:
Four new variables will be obtained, corresponding to
-
Seasonal factors in results
- Cumulative model— T + S + C + I = = variable T+S+C+I == variable T+S+C+I==Variable amount
Seasonal factor SS of cumulative modelThe sum of S is 0
In the cycle, each seasonal factor represents the relationship with the annual average value. The value higher or lower than the seasonal factor is
set as the sales volume
- Multiplication model— T ∗ S ∗ C ∗ I = = variable T*S*C*I == variable T∗S∗C∗I==Variable amount
Seasonal factor SS of the multiplicative modelThe product of S is 1
In the cycle, each seasonal factor represents the relationship with the annual average, the percentage value higher or lower
Step 4: Draw a time series diagram after seasonal decomposition
- Modify the name of the new variable
- Analysis -> Time Series Forecast -> Sequence Diagram
Pay attention to modify the line color of the diagram and the graphic background
Step 5: Forecast
If it is difficult to predict directly, it is more difficult to directly predict sales
- However, the straight line (I) (T+C+I) (S) (T+C) in the figure can be predicted
. T + S + C + I = = variable T+S+C+I == variable T+S+C+I==Variable amount
Multiplication model— T ∗ S ∗ C ∗ I = = variable T*S*C*I == variable T∗S∗C∗I==Variable amount
Model 2-Exponential Smoothing Model-Multiple Model Types
Simple model
Disadvantages: because of the principle, only the value of the future period can be predicted
Linear trend model and Brown (Brown) linear trend model
Damping trend model
Proposed on the Holt model
Simple seasonal
- [ [ [ ] ] ] Is the rounding symbol
Winter additive model
Winter Multiplication Model
ARIMA 与 SARIMA
- ξ \ xi ξ is the white noise sequence, and the white noise residual test will generally be performed to obtain the value
General steps
Import data, time variable must be defined
Draw a time series graph
- Difference: First-order difference can be obtained.
If it is ARIMA(p,1,q), the graph after first-order difference can be drawn
View the optimal model given by SPSS
- Only select the dependent variable because it is a univariate sequence analysis
- Will get an optimal model, and then the analysis can be based on the optimal model analysis
- All outlier options can be checked
Need to check option
Statistics -> Parameter Estimated Value
Graph -> Fitted Value, ACF PACF, Predicted Confidence Interval and Fitted Confidence Interval-plus the latter two graphs may be
stored vaguely -> Predicted value, upper limit of confidence interval, confidence interval Lower limit
forecast -> you can specify the date and confidence interval of the forecast (the significance level in the figure is α = 5 \alpha = 5%a=5 )
Precautions
Evaluation index
Model fit in the output results
Write paper
- Describe the data-whether there are missing values, data trends, whether there are seasonal changes in the data
(you can write according to the optimal model) - Eliminate outliers
- Draw a sequence diagram
Analysis -> Time series forecasting -> Sequence diagram - Explain the working principle of SPSS's expert modeler and choose an optimal model
- Write the obtained model expression and parameter estimation into the model
- Other delay values are not displayed, then 0
- ξ t \xi_{t} XtRepresents residual, predicted value −-- the true value
- Residual test for white noise
- There are no more than two straight lines in the PCF and PACF graphs, indicating that there is no significant difference from 0 (that is, white noise ξ = 0 \xi=0X=0)
- When the significance of the Q test is greater than 0.5, we say that the null hypothesis cannot be rejected
- Through smooth R 2 R^2R2, R 2 , R^2, R2 ,or standardize BIC to detect the quality of the model