R language vector autoregression VAR model

Original link: http://tecdat.cn/?p=8478

 

Australia 2008 - a situation that occurred during the 2009 global financial crisis. The Australian Government released a stimulus package, including cash payments in December 2008, to coincide with Christmas spending. Therefore, retailers reported strong sales, the economy is stimulated. Therefore, revenue increased.

VAR faced criticism that they are theoretical; that is, they are not based on some economic theory, these theories impose the theoretical structure of the equation. Each variable is assumed that the impact of each of the other variables in the system, which allows direct interpretation of the estimated coefficients difficult. Nevertheless, VAR is useful in several situations:

  1. A collection of related variables to predict, without a clear explanation;
  2. Test help predict whether a variable to another variable (the basis of Granger causality test);
  3. Impulse response analysis, which analyzes a variable to another variable in response to a sudden, but temporary change;
  4. Prediction error variance decomposition, wherein the ratio of the predicted variance of each variable due to the influence of other variables.

Example: for US consumption forecast VAR model

 
VARselect(uschange[,1:2], lag.max=8,
type="const")[["selection"]]
#> AIC(n) HQ(n) SC(n) FPE(n)
#> 5 1 1 5

 

R lag length of each output display selected information available from the standard package vars. There is a big difference between the VAR selected by the AIC (5) and the BIC selected VAR (1). This is not uncommon. Therefore, we first fitting VAR (1) selected by the BIC.

var1 <- VAR(uschange[,1:2], p=1, type="const")
serial.test(var1, lags.pt=10, type="PT.asymptotic")
...

 

Similar univariate ARIMA method, we use Portmanteau test 24 test is not related to residuals. VAR (1) and the VAR (2) have some residual serial correlation, we fit VAR (3).

...
serial.test(...)
#>
#> Portmanteau Test (asymptotic)
#>
#> data: Residuals of VAR object var3
#> Chi-squared = 34, df = 28, p-value = 0.2

 

Residuals of the model through a series of related tests. VAR (3) generated predicted as shown in FIG.

forecast(var3) %>%...

 

R language vector autoregression VAR model

Figure: forecast US consumer income and VAR

If you have any questions, please leave a comment below. 

  

Big Data tribe  - Chinese professional third-party data service providers to provide customized one-stop data mining and statistical analysis consultancy services

Statistical analysis and data mining consulting services: y0.cn/teradat (Consulting Services, please contact the official website customer service )

Click here to send me a messageQQ:3025393450

 

QQ exchange group: 186 388 004 

[Service] Scene  

Research; the company outsourcing; online and offline one training; data reptile collection; academic research; report writing; market research.

[Tribe] big data to provide customized one-stop data mining and statistical analysis consultancy

 

Welcome attention to micro-channel public number for more information about data dry!
 
 

Welcome to elective our R language data analysis will be mining will know the course!

 

 

If you have any questions, please leave a comment below. 

  

Big Data tribe  - Chinese professional third-party data service providers to provide customized one-stop data mining and statistical analysis consultancy services

Statistical analysis and data mining consulting services: y0.cn/teradat (Consulting Services, please contact the official website customer service )

Click here to send me a messageQQ:3025393450

 

QQ exchange group: 186 388 004 

[Service] Scene  

Research; the company outsourcing; online and offline one training; data reptile collection; academic research; report writing; market research.

[Tribe] big data to provide customized one-stop data mining and statistical analysis consultancy

 

Welcome attention to micro-channel public number for more information about data dry!
 
 

Welcome to elective our R language data analysis will be mining will know the course!

 

Big Data tribe  - Chinese professional third-party data service providers to provide customized one-stop data mining and statistical analysis consultancy services

Statistical analysis and data mining consulting services: y0.cn/teradat (Consulting Services, please contact the official website customer service )

Click here to send me a messageQQ:3025393450

 

QQ exchange group: 186 388 004 

[Service] Scene  

Research; the company outsourcing; online and offline one training; data reptile collection; academic research; report writing; market research.

[Tribe] big data to provide customized one-stop data mining and statistical analysis consultancy

 

Welcome attention to micro-channel public number for more information about data dry!
 
 

Welcome to elective our R language data analysis will be mining will know the course!

 

Guess you like

Origin www.cnblogs.com/tecdat/p/11815069.html