Time series analysis model explained in detail

time series analysis

Time series, also known as dynamic series, refers to a numerical sequence in which the index values ​​of a certain phenomenon are arranged in chronological order.

Time series analysis can be roughly divided into three parts, which are describing the past, analyzing laws and predicting the future.

This article mainly includes three commonly used models:

  • Seasonal breakdown
  • exponential smoothing model
  • ARIMA model

Seasonal breakdown

Variation law of numerical value of time series

Numerical change law represent letters features
long-term trend T Statistical indicators have been affected by long-term trend factors for a long period of time, showing a continuous upward or downward trend.
seasonal trend S Refers to the periodic changes in the index value due to the change of seasons. Generally, the unit of time is month, quarter, and week, not year.
Periodic variation law (cyclical variation) C Cyclic changes usually take several years as a cycle, and they appear as wave-like periodic changes on the graph. The most typical cycle cases are the business cycle of the market economy and the business cycle of the entire country.
Irregular changes (random disturbance items) I The numerical changes caused by some random factors are unpredictable and irregular (also known as disturbance items in regression).

A time series is often a superposition of the above four types of changes. The relationship between the four changes and the final change of the indicator value may be a superposition relationship or a product relationship. Due to the uncertainty of the combination of changes, the numerical changes of the time series are so ever-changing.

  • If the four changes are independent of each other, then the superposition model can be expressed as: Y = T + S + C + I
  • If there are interactions among the four movements, then the product model should be used: Y = T × S × C × T

insert image description here

SPSS data preprocessing

order method step
1 Handling Missing Values ​​in Time Series The middle position of the sequence: conversion -> replacement; both ends of the missing value sequence: direct deletion
2 define time variable Data —> Define date and time —> Select the appropriate format in “Case is” and set the start time
3 Draw a Time Series Diagram (Sequence Diagram) Analysis —> Time Series Forecasting —> Sequence Diagram (the "Difference" option is to perform several orders of difference)

SPSS Seasonal Decomposition

  • seasonal decomposition

seasonal decomposition

  • Interpretation of results

Interpretation of results

  • Draw the decomposed timing diagram
    Draw the decomposed timing diagram

The specific steps of time series analysis

  1. Make a time series graph —> SPSS software solution
  2. Determine the variable components contained in the time series
  3. Time series decomposition (periodic and contains long-term trends, seasonal changes or cyclical changes) —> SPSS software solution
    • Time series decomposition can only be used when the data has periodicity within a year , and time series decomposition cannot be performed if the period is greater than one year
  4. Build time series analysis models
  5. Exponential indicators for predicting the future

Build time series analysis models

SPSS Expert Simulator can help us find the best fitting model (exponential smoothing model or ARIMA model).

That is, how to choose this part is determined by SPSS for us.

exponential smoothing model

name English name Conditions of Use An ARIMA model similar to
Simple Exponential Smoothing Simple model Free of trend and seasonal ingredients ARIMA(0,0,1)
(Holt) Linear Trend Model linear trend Linear trend, no seasonal component ARIMA(0,2,2)
damped trend model Damped trend Linear trend diminishes with no seasonal component ARIMA(1,1,2)
simple seasonality Simple seasonal Contains steady seasonal ingredients, no trends SARIMA(0,1,1)×(0,1,1) s
Winter Addition Model Winters’ additive Contains a linear trend and a stable seasonal component SARIMA(0,1,0)×(0,1,1) s
Winter's multiplicative model Winters’ multiplicative Contains a linear trend and an unstable seasonal component does not exist

ARIMA model

Model form illustrate
ARIMA model ARIMA(p,d,q) Dealing with non-seasonal data, also known as "differential autoregressive moving average model"
SARIMA model SARIMA(p,d,q) (P,D,Q) m The first half of the model form is the non-seasonal part, and the second half is the seasonal part

ARIMA (p, d, q) model - differential autoregressive moving average model, SARIMA ( Seasonal ARIMA ) model ARIMA (p, d, q) (P, D, Q) m The first half is the non-seasonal part, the second half for the seasonal part.

Notice:

  • Model selection: AIC and BIC criteria (selection of small principles)

  • Residual autocorrelation function (ACF), residual partial autocorrelation function (PACF), used to determine whether the residual is white noise

  • The significance of the Q test is used to judge whether the residual is white noise: if it is significant, the residual is white noise, indicating that the model we selected can fully identify the regularity of the time series data, that is, the model is acceptable. Otherwise, the model needs to be revised.

Time series analysis problem solving steps (paper writing)

Essay Writing Steps

  1. Since the data is complete (or processed) and quarterly, time series graphs can be made.
  2. Analyzing the results in the graph: It can be seen from the graph that the sales data has an upward trend, and the sales data has obvious seasonal fluctuations. Therefore, time series decomposition can be considered. Because the data are stationary, you can use an additive time-series decomposition and then explain a wave-additive time-series decomposition.
  3. Using SPSS's expert modeler (can explain a wave of expert modelers), SPSS's expert modeler selects the most suitable model for us is the Winter addition model, and then explains a wave of Winter addition model, SPSS for us Estimated estimates can also be written in a paper.
  4. White noise test: Write the output image of white noise, and the result of Q test (the significance of Q test > 0.05 means that the residual value is white noise).
  5. Prediction results: We considered the 95% prediction level, and at the 95% prediction level, write the prediction results output by SPSS, and the 95% probability falls between which and which. To add forecast graphs, you can use SPSS output, or you can use the analysis-time series forecasting-sequence graph drawing after processing the data yourself.
  6. Report whether the prediction results are good or bad: put the stable R 2 , R 2 , and standardized BIC in the paper (the larger the stable R 2 , R 2 , the better, and the smaller the standardized BIC, the better).

example:

If SPSS chooses the Winter addition model, this part of the data of the Winter addition model can be written in the paper:

insert image description here

Write the output image of the white noise, and the result of the Q test, plus the text on the right.

insert image description here

Actual SPSS operation steps

  1. Handle missing values, generate time variables
  2. Data preprocessing (descriptive statistics on the data)
  3. Generating Sequence Diagram Analysis
  4. First use expert simulation test (not to remove outliers first), if a model such as Winters additive is given, it shows that the four changes of time series decomposition are superimposed, and then seasonal decomposition can be performed.
  5. Seasonal decomposition: At this time, the output seasonal factor can be displayed in the paper, mainly to analyze which cycle is positive, which cycle is negative, and which cycle has the largest and smallest absolute value.
  6. Making a Seasonal Decomposition Series Plot
  7. You can perform linear fitting on the seasonally adjusted series to find R 2 and SSE, then remove the outliers and fit again, indicating that the effect is not good, and then use the SPSS expert modeler.
  8. SPSS expert modeler: embodies the model, model fitting degree, model statistics, outliers, residual ACF, PACF image, prediction result image and other information obtained by expert inspection in the paper; put the data prediction result in the paper , emphasizing that the confidence level of the confidence interval is 95%.

Guess you like

Origin blog.csdn.net/qq_61539914/article/details/126810852