Forecasting U.S. Inflation with Vector Autoregression (VAR)
GDP & Inflation in the U.S. Title: Impact of inflation on the real economic growth
period:1961-2020(1961-2010 training dataset; 2011-2020 testing dataset)
1. Plot the data
2. Remove the trend(take lags/differencing)
3. Choose model(VAR)
4. Forecast (ex-post test, compare with the real life)
1961-2020 quarterly
PCE – Personal Consumption Expenditure (extremely high in 1980)
(https://fred.stlouisfed.org/series/PCE)
Fed Funds Rate
(https://fred.stlouisfed.org/series/FEDFUNDS)
Unemployment Rate
(https://fred.stlouisfed.org/series/UNRATE)
Real GDP Growth Rate
(https://fred.stlouisfed.org/series/GDPC1)
CPI
(https://fred.stlouisfed.org/series/CPIAUCSL)
Core CPI
(https://fred.stlouisfed.org/series/CPILFESL)
Example: https://towardsdatascience.com/multivariate-time-series-forecasting-456ace675971https://www.machinelearningplus.com/time-series/vector-autoregression-examples-python/
https://michael-fuchs-python.netlify.app/2020/10/29/time-series-analysis-regression-extensiontechniques-for-forecasting-multivariate-variables/#vector-autoregression-var
1. Introduction
a. Empirical Question (What are we testing?)
We are interested in: the interrelationship between PCE, Real U.S. GDP, the Federal Funds Rate, and U.S. Unemployment Rate; the individual influences of the latter three variables on inflation, as measured by the PCE; and the combined influence of these factors on forecasting inflation. b. Motivation (Why are we testing this?)
Inflation
c. Literature Review (Relevant papers incorporating VAR models to forecast
inflation)
d. Methodology (How are we going to test our empirical question?)
2. Examine Data
a. Import into Python
b. Plot / Visualize
i. Normal TS
ii. ACF
iii. PACF
3. Check for Stationarity
a. ADF Test
b. KPSS Test
c. Philip-Perron test
4. Testing Causation using Granger Causality
a. Use Python command: from statsmodels.tsa.statstools import
grangercausalitytests
5. Cointegration Test
a. Use Python command: from statsmodels.tsa.vector_ar.vecm import
coint_johansen
6. Split Data Train – Test
7. Run VAR on Training Data to obtain optimal number of lags (AIC, BIC)
a. We iteratively fit increasing orders of the VAR model to determine the order
which minimizes the AIC
8. Train VAR(p) model with optimal number of lags p
9. Check for Serial Correlation of Residuals using Durbin-Watson statistics
a. The value of this statistic ranges from 0 to 4. If it is close to 2, there is no
significant serial correlation; if it is closer to 0, there is a positive serial
correlation; and if it is closer to 4, there is a negative serial correlation. 10. Perform forecast on test dataset
11. Invert the Transformation to obtain the real forecast
12. Plot forecast versus actual (test)
13. Evaluate the forecasts
a. We can compute a comprehensive set of evaluation metrics:
i. MAPE
ii. ME
iii. MAE
iv. MPE
v. RMSE
vi. Corr
vii. Min
viii. Max
14. Conclusion