Time Series Forecasting EViews

time series forecasting

 

brief description

Time series forecasting is the result of observing the underlying process of time series data. Since time series data is a variable with a random process, time series forecasting is more sufficient for mining time series data than regression analysis of random sampling of cross-sectional data.

Time Series Data Properties

The main feature of time series data is time sequence, which is the natural carrier of various dynamic information. It can reflect trend, periodicity and hysteresis effects, etc.

From the perspective of probability and statistics, a time series is a sample realization of a set of random variables at a series of moments.

According to whether the statistical characteristics of the sequence change with time, it can be divided into non-stationary sequence and stationary sequence. If the series is stationary, it means that the correlation of this set of series remains stable at both moments. Therefore, the future can be well predicted based on statistical regularities presented by historical data. Conversely, if the sequence is non-stationary, it means that the correlation between the two moments of this set of sequences is unstable, that is, the mining of the influencing factors of the data is not correct or sufficient, and it is difficult to predict future data.

time domain analysis

The basic idea is that the development of events usually has a certain inertia, which is described by statistical language as the correlation relationship between sequences. And this correlation has a certain statistical nature. The focus of time domain analysis is to find this statistical law, and fit an appropriate mathematical model to describe this law, and then use this fitting model to predict the future trend of the sequence.

Characteristic Statistics for Event Sequences

99a9989e73cb4273b8aa9f16bd2c5c78.png

Usually the covariance function and the correlation coefficient measure the degree to which two different events influence each other, while the autocovariance and the correlation coefficient measure the degree of correlation between the same event in two different periods, that is, to measure one's own past behavior impact on yourself now.

Covariance represents the overall error of two variables, as opposed to variance, which represents the error of only one variable. If the change trend of the two variables is consistent (that is, one of them is greater than its own expected value, and the other is also greater than its own expected value), then the covariance of the two variables is positive, and vice versa.

Stationarity

Wide and stable

Wide stationary is a kind of stationarity defined by the statistics of the sequence. It believes that the statistical properties of the sequence are mainly determined by its low-order moments (the first-order moment is the expected value, and the second-order moment is the variance), so as long as the sequence is low-order Moment stationary can ensure that the main properties of the sequence are approximately stationary.

condition

  1. The expectation of the square of the sequence value is less than positive infinity
  2. mean is constant
  3. The number autocovariance functions of two groups with the same time interval are equal

The meaning of stationarity

The constant mean property of the stationary sequence makes the mean sequence become a constant sequence. The original mean value is only estimated by a single observation value. When the overall mean value constant replaces the original mean value, each sample observation value can be regarded as the mean value constant. observation value. Therefore, the stationary sequence greatly reduces the number of random variables, increases the sample size with estimated variables, and simplifies the difficulty of time series analysis. Improved estimation accuracy for feature statistics.

stationarity test

  1. Timing diagram test: According to the nature of the mean value and variance of the stationary sequence being constant, the timing diagram of the stationary sequence should show that the sequence always fluctuates randomly around a constant value, and the fluctuation range is bounded, without obvious trend and periodic characteristics.
  2. Autocorrelation graph test: The stationary sequence usually has a short-term correlation, which is described by the autocorrelation coefficient. As the number of delay periods increases, the autocorrelation coefficient of the stationary sequence will quickly decay to zero.
  3. unit root test

The most common method for testing for a unit root is the Dickey-Gauler test (ADF)

 7b6afb7e6b14417caaed2545ae9aa957.png

 2bd627bcf2534d2387871ad4c213b228.png

randomness test

Properties of White Noise Sequences

  1. There is a mean
  2. The correlation coefficient of series values ​​at different times is zero, and the correlation coefficient at the same time is equal to the variance.

Conversely, if the sequence shows a relatively significant correlation, that is, the autocorrelation coefficient is not zero, it means that the sequence is not a pure random sequence.

Demo eViews Time Series Analysis

(The data is compiled, don't care)

raw data visualization

4a829357daf64094bab04ede0fa998f0.png

1. Unit root test

There are three types of unit root tests:

29576c4da81843b0a36bc3dddde17fd0.png

For eviews operation, check in the order of case 3-case 2-case 1.

34ac6f11b0e4462fba95e64f34bc05a5.png

1、View-unit root test--trend and intercept

2、View-unit root test--intercept

3、View-unit root test--none

The result is as follows:

1:

d41a64a1e4ba49e5b7b35646af3ee7fb.png

2:

5854f741f00d424eab30db2c0cafe2e9.png

3:

ddd8977d17d34cffbb256931775888fa.png

Observe the prob value in the first table. If it is less than or equal to 0.05, it means that the null hypothesis is rejected, that is, the unit root is not equal to 1, and the model is stable. In the case of this question, View-unit root test--trend and intercept and View-unit root test--intercept are stable.

Then according to the goodness of fit: compare the three indicators of akaike info criterion; schwarz criterion; hannan-quinn creter (the smaller the better), in View-unit root test--trend and intercept and View-unit root test--intercept Select View-unit root test--intercept in.

If the sequence is a special case and does not pass the stationarity test, the difference is made to construct a stationary sequence. By observing whether the first-order or second-order differences pass the stationarity test. If both pass the stationarity test, compare the goodness of fit of the two to select the most appropriate model.

611fd4fbc41f43239a7d3782f19e80d3.png

View-unit root test--1st difference

View-unit root test--2nd difference

e779042ea97142caa0141b309784b174.png

Comparison of goodness of fit through three indicators: akaike info criterion; schwarz criterion; hannan-quinn creter (the smaller the better)

2. Model identification

 Autocorrelogram view-correlogram

c00ea455b17e40a7816162a581a6b77c.png

Judgment of censoring and tailing:

Censoring: K-order censoring is the one that quickly tends to 0 after being greater than a certain constant K.

Tailing: There is always a non-zero value, and it will not be equal to 0 after being greater than a certain constant (or fluctuate around 0)

AR: The autocorrelation coefficient is tailed, and the partial correlation coefficient is truncated

MA: The autocorrelation coefficient is truncated, and the partial correlation coefficient is tailed

ARMA: both trailing

If the correlation coefficients are all 0—prove it is a white noise sequence

By observing the autocorrelation diagram, it can be determined as an AR model, because it is controlled within the confidence interval from n=2, and it is initially judged to be an AR(2) model.

3. Determine the lag order

Serial correlation test:

Serial correlation, in econometrics, means that for different sample values, random disturbances are no longer completely independent of each other, but there is a certain correlation. Also known as autocorrelation, it means that there is a correlation between the random error items of the overall regression model.
If some important explanatory variables are omitted in the model or the form of the model function is incorrect, systematic errors will occur, which exist in the random error term, thus bringing about autocorrelation. Autocorrelation due to specification errors often occurs in econometric analysis.

Downward test method: test whether the significance of the lagging order is 0 from large to small. Because the preliminary judgment model is 2nd order. Therefore, the classification establishes 3rd-order, 2nd-order, and 1st-order models.

The time series variable is named x

Click【quick】----【estimate equation】

Input respectively: xcx(-3) x(-2) x(-1)

                  x c x(-2) x(-1)

                  x c x(-1)

 Compare the goodness of fit of these three order models (comparison of goodness of fit through akaike info criterion; schwarz criterion; hannan-quinn creter three indicators (the smaller the better)) to determine the best goodness of fit of the 3rd order model good.

Since then, the residual serial correlation test has been completed.

Heteroscedasticity test for residuals (ARCH test)

The ARCH test is an autoregressive process of the second moment of the error term (the second moment is the variance).

点击【view】--【residual diagnostics】--【heteroskedasticity tests】

 Set the lag order to 1, 2, 3 respectively.

 Compare the goodness of fit of these three order models (comparison of goodness of fit through the three indicators of akaike info criterion; schwarz criterion; hannan-quinn creter (the smaller the better)) to determine the best goodness of fit.

Select the ARCH test data with the best goodness of fit

Prob=0.9844>0.05 does not reject H0, it is considered that there is no ARCH effect.

Since the test is complete, the autoregressive model functional relationship can be determined:

yt=0.004384yt-1 + 0.406774yt-2 + 0.545224yt-3+2.824598 + error term

Guess you like

Origin blog.csdn.net/weixin_64589302/article/details/127896436