Mathematical Modeling--- Forecast Method: 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 Insert picture description here
three parts

  • Describe the past
  • Analysis rule
  • Fortune-telling

Three major models

  • Seasonal decomposition
  • Exponential smoothing method
  • ARIMA model

Components

  1. Time element
  2. Numerical elements

Preprocessing: when there are missing values

Insert picture description here

  • The method when the missing value is in the middle
    Insert picture description here
    Insert picture description here

Model 1 — Time series decomposition model

Time value change decomposition four kinds of changes

  1. Long-term trend TTT
    has been affected by the long-term trend for a long period of time, showing a continuous rise or fall
  2. 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
  3. Cycle change CCC
    takes several years as the cycle, showing wave-like cyclical changes, manifested as increasing and decreasing alternately
  4. Irregular changes III
    can not predict or unpredictable

Insert picture description here

Two models from four changes

T S C I T S C I TSCI
Insert picture description here

  • Product modelInsert picture description here
  • Additive model
    Insert picture description here

SPSS operation

Step 1: Define the time variable

Insert picture description here

Step 2: Make time series diagram and analyze

Insert picture description here
Insert picture description here

  • 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.

Insert picture description here

  • Analysis based on time series graphs
    Insert picture description here

Step 3: Seasonal decomposition

Cycle is less than 1 year
Insert picture description here

  • Result analysis:
    Four new variables will be obtained, corresponding to
    Insert picture description here

  • Seasonal factors in results

  1. 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
    Insert picture description here
  2. Multiplication model— T ∗ S ∗ C ∗ I = = variable T*S*C*I == variable TSCI==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

  1. Modify the name of the new variable Insert picture description here
  2. Analysis -> Time Series Forecast -> Sequence Diagram
    Insert picture description here
    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 salesInsert picture description here

  • 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 TSCI==Variable amount

Model 2-Exponential Smoothing Model-Multiple Model Types

Insert picture description here

Simple model

Disadvantages: because of the principle, only the value of the future period can be predicted
Insert picture description here
Insert picture description here

Linear trend model and Brown (Brown) linear trend model

Insert picture description here

Damping trend model

Proposed on the Holt model
Insert picture description here

Simple seasonal

Insert picture description here

  • [ [ [ ] ] ] Is the rounding symbol

Winter additive model

Insert picture description here

Winter Multiplication Model

Insert picture description here

ARIMA 与 SARIMA

Insert picture description here

  • ξ \ xi ξ is the white noise sequence, and the white noise residual test will generally be performed to obtain the value

Insert picture description here

General steps

Insert picture description here

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
    Insert picture description here

View the optimal model given by SPSS

Insert picture description here
Insert picture description here

  • 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 checkedInsert picture description here

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 )
Insert picture description here

Precautions

Insert picture description here

Evaluation index

Model fit in the output results
Insert picture description here

Write paper

  1. 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)
  2. Eliminate outliers
  3. Draw a sequence diagram
    Analysis -> Time series forecasting -> Sequence diagram
  4. Explain the working principle of SPSS's expert modeler and choose an optimal model
    Insert picture description here
  5. Write the obtained model expression and parameter estimation into the model
    Insert picture description here
    Insert picture description here
  • Other delay values ​​are not displayed, then 0
  • ξ t \xi_{t} XtRepresents residual, predicted value −-- the true value
    Insert picture description here
  1. Residual test for white noise
    Insert picture description here
  • 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
  1. Through smooth R 2 R^2R2 R 2 , R^2, R2 ,or standardize BIC to detect the quality of the model

Guess you like

Origin blog.csdn.net/qq_43779658/article/details/108257108