# Forecasting Financial and Macroeconomic Variables Using an Adaptive Parameter VAR-KF Model

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

#### 1.1. Motivation and Related Work

#### 1.2. Contribution

- We present a forecasting technique, the adaptive parameter VAR-KF (APVAR-KF) method, in which the state-space equations are constructed through the VAR model and the optimal state and parameter estimates are achieved using the KF approach.
- A generalized autoregressive conditional heteroskedasticity (GARCH) model was used to generate a measurement noise covariance matrix in the KF step in case of the presence of heteroscedasticity.
- The estimation and prediction performance of the APVAR-KF method was conducted and compared with VAR-based models with time-invariant parameters for the main stock exchange index and macroeconomic indicators in two selected emerging market economies: Thailand and Indonesia.

#### 1.3. Article Structure

## 2. Methodology

#### The Adaptive Parameter VAR-KF Model (APVAR-KF)

**The Forecast Step**

**The Analysis Step**

## 3. Data and Simulation Results

#### 3.1. Granger Causality Analysis

#### 3.2. Results

## 4. Conclusions and Discussion

## Author Contributions

## Funding

## Acknowledgments

## Conflicts of Interest

## Abbreviations

VAR | Vector Autoregressive Model |

KF | Kalman Filter |

GARCH | Generalized Autoregressive Conditional Heteroscedasticity |

SET | Stock Exchange of Thailand |

JKSE | Jakarta Stock Exchange Composite Index |

REER | Real Effective Exchange Rate |

CPI | Consumer Price Index |

MAPE | Mean Absolute Percentage Error |

RMSE | Root Mean Square Error |

## Appendix A

**Figure A1.**Plots of the actual data and the estimated values from three methods for Thailand. (

**a**) Normalized SET index return; (

**b**) normalized real effective exchange rate return; (

**c**) normalized CPI return.

**Figure A2.**Plots of the actual data and the estimated values from three methods for Indonesia. (

**a**) Normalized SET index return; (

**b**) normalized real effective exchange rate return; (

**c**) normalized CPI return.

## References

- Ariyo, A.A.; Adewumi, A.O.; Ayo, C.K. Stock price prediction using the ARIMA model. In Proceedings of the 2014 UKSim-AMSS 16th International Conference on Computer Modelling and Simulation, Cambridge, UK, 26–28 March 2014; pp. 106–112. [Google Scholar] [CrossRef]
- Junior, P.R.; Salomon, F.L.R.; de Oliveira Pamplona, E. ARIMA: An applied time series forecasting model for the Bovespa stock index. Appl. Math.
**2014**, 5, 3383. [Google Scholar] [CrossRef] - Moghaddam, A.H.; Moghaddam, M.H.; Esfandyari, M. Stock market index prediction using artificial neural network. J. Econ. Financ. Adm. Sci.
**2016**, 21, 89–93. [Google Scholar] [CrossRef] - Qiu, M.; Song, Y.; Akagi, F. Application of artificial neural network for the prediction of stock market returns: The case of the Japanese stock market. Chaos Solit. Fract.
**2016**, 85, 1–7. [Google Scholar] [CrossRef] - Shen, S.; Jiang, H.; Zhang, T. Stock Market Forecasting Using Machine Learning Algorithms; Department of Electrical Engineering, Stanford University: Stanford, CA, USA, 2012; pp. 1–5. [Google Scholar]
- Ren, R.; Wu, D.D.; Liu, T. Forecasting stock market movement direction using sentiment analysis and support vector machine. IEEE Syst. J.
**2018**, 13, 760–770. [Google Scholar] [CrossRef] - Yang, E.; Kim, S.H.; Kim, M.H.; Ryu, D. Macroeconomic shocks and stock market returns: The case of Korea. Appl. Econ.
**2018**, 50, 757–773. [Google Scholar] [CrossRef] - Antonakakis, N.; André, C.; Gupta, R. Dynamic spillovers in the United States: Stock market, housing, uncertainty, and the macroeconomy. South. Econ. J.
**2016**, 83, 609–624. [Google Scholar] [CrossRef] - Vrugt, E.B. US and Japanese macroeconomic news and stock market volatility in Asia-Pacific. Pac.-Basin Financ. J.
**2009**, 17, 611–627. [Google Scholar] [CrossRef] - Sims, C.A. Macroeconomics and reality. Econom. J. Econom. Soc.
**1980**, 1–48. [Google Scholar] [CrossRef] - Suharsono, A.; Aziza, A.; Pramesti, W. Comparison of vector autoregressive (VAR) and vector error correction models (VECM) for index of ASEAN stock price. AIP Publ.
**2017**, 1913, 020032. [Google Scholar] [CrossRef] [Green Version] - Öğünç, F.; Akdoğan, K.; Başer, S.; Chadwick, M.G.; Ertuğ, D.; Hülagü, T.; Kösem, S.; Özmen, M.U.; Tekatlı, N. Short-term inflation forecasting models for Turkey and a forecast combination analysis. Econ. Model.
**2013**, 33, 312–325. [Google Scholar] [CrossRef] - Primiceri, G.E. Time varying structural vector autoregressions and monetary policy. Rev. Econ. Stud.
**2005**, 72, 821–852. [Google Scholar] [CrossRef] - D’Agostino, A.; Gambetti, L.; Giannone, D. Macroeconomic forecasting and structural change. J. Appl. Econom.
**2013**, 28, 82–101. [Google Scholar] [CrossRef] - Bekiros, S.; Gupta, R.; Paccagnini, A. Oil price forecastability and economic uncertainty. Econ. Lett.
**2015**, 132, 125–128. [Google Scholar] [CrossRef] - Kumar, M. A time-varying parameter vector autoregression model for forecasting emerging market exchange rates. Int. J. Econ. Sci. Appl. Res.
**2010**, 3, 21–39. [Google Scholar] - Korobilis, D. VAR forecasting using Bayesian variable selection. J. Appl. Econom.
**2013**, 28, 204–230. [Google Scholar] [CrossRef] - Kalman, R.E. A new approach to linear filtering and prediction problems. J. Basic Eng.
**1960**, 82, 35–45. [Google Scholar] [CrossRef] - Bekiros, S. Forecasting with a state space time-varying parameter VAR model: Evidence from the Euro area. Econ. Model.
**2014**, 38, 619–626. [Google Scholar] [CrossRef] - Koop, G.; Korobilis, D. Large time-varying parameter VARs. J. Econom.
**2013**, 177, 185–198. [Google Scholar] [CrossRef] - Bollerslev, T. Generalized autoregressive conditional heteroskedasticity. J. Econom.
**1986**, 31, 307–327. [Google Scholar] [CrossRef] - Engle, R.F.; Kroner, K.F. Multivariate simultaneous generalized ARCH. Econom. Theory
**1995**, 11, 122–150. [Google Scholar] [CrossRef] - Bollerslev, T.; Wooldridge, J.M. Quasi-maximum likelihood estimation and inference in dynamic models with time-varying covariances. Econom. Rev.
**1992**, 11, 143–172. [Google Scholar] [CrossRef] - Stock Exchange of Thailand Website. 2021. Available online: https://classic.set.or.th/en/market/market_statistics.html (accessed on 5 October 2021).
- Bank of Thailand Website. 2021. Available online: https://bot.or.th (accessed on 5 October 2021).
- Investing Website. 2022. Available online: https://www.investing.com/indices/idx-composite-historical-data (accessed on 5 October 2021).
- Federal Reserve Economic Data website. 2022. Available online: https://fred.stlouisfed.org/ (accessed on 5 October 2021).
- Kang, S.H.; Yoon, S.M. Long memory features in the high frequency data of the Korean stock market. Phys. Stat. Mech. Its Appl.
**2008**, 387, 5189–5196. [Google Scholar] [CrossRef] - Granger, C.W. Investigating causal relations by econometric models and cross-spectral methods. Econom. J. Econom. Soc.
**1969**, 424–438. [Google Scholar] [CrossRef] - Engle, R.F.; Granger, C.W. Co-integration and error correction: Representation, estimation, and testing. Econom. J. Econom. Soc.
**1987**, 55, 251–276. [Google Scholar] [CrossRef] - Dickey, D.A.; Fuller, W.A. Distribution of the estimators for autoregressive time series with a unit root. J. Am. Stat. Assoc.
**1979**, 74, 427–431. [Google Scholar] [CrossRef] - Dickey, D.A.; Fuller, W.A. Likelihood ratio statistics for autoregressive time series with a unit root. Econom. J. Econom. Soc.
**1981**, 49, 1057–1072. [Google Scholar] [CrossRef]

**Figure 1.**A comparison between the actual data and the estimated values from three methods for Thailand during July 2018–May 2021. (

**a**) Normalized SET index return; (

**b**) normalized real effective exchange rate return; (

**c**) normalized CPI return.

**Figure 2.**A comparison between the actual data and the estimated values from three methods for Indonesia during July 2018–May 2021. (

**a**) Normalized JKSE index return; (

**b**) normalized real effective exchange rate return; (

**c**) normalized CPI return.

Dependent Variable | F-Statistics Test | ||
---|---|---|---|

SET Index (Prob. Values) | REER (Prob. Values) | CPI (Prob. Values) | |

SET index | 21.2505 | 1.6713 | |

(0.0000) *** | (0.1971) | ||

REER | 1.0583 | 0.2262 | |

(0.3045) | (0.6347) | ||

CPI | 10.6046 | 15.7289 | |

(0.0013) *** | (0.0000) *** |

Dependent Variable | F-Statistics Test | ||
---|---|---|---|

JKSE Index (Prob. Values) | REER (Prob. Values) | CPI (Prob. Values) | |

JKSE index | 21.0083 | 4.3218 | |

(0.0000) *** | (0.0385) ** | ||

REER | 0.5960 | 93.2368 | |

(0.4408) | (0.0000) *** | ||

CPI | 6.5980 | 5.8258 | |

(0.0107) ** | (0.0164) ** |

Variable | Stock Index | REER | CPI |
---|---|---|---|

Thailand | |||

Skewness | −0.4037 | −1.7799 | −0.8021 |

Kurtosis | 6.1646 | 25.6633 | 11.7886 |

Maximum | 3.5321 | 5.5006 | 4.6552 |

Minimum | −4.5314 | −7.9811 | −5.8710 |

Jarque–Bera | 128.8900 *** | 6359.4434 *** | 964.3984 *** |

ARCH test | 8.1017 *** | 37.2224 *** | 29.8895 *** |

ADF | −11.2860 *** | −11.1884 *** | −9.4615 *** |

Indonesia | |||

Skewness | −1.2042 | −3.5107 | 4.7035 |

Kurtosis | 8.6444 | 39.2024 | 31.6584 |

Maximum | 3.1898 | 3.6852 | 8.6086 |

Minimum | −5.0722 | −9.8602 | −1.3426 |

Jarque–Bera | 455.0480 *** | 16432.3347 *** | 10993.3566 *** |

ARCH test | 5.7372 ** | 20.9877 *** | 47.8145 *** |

ADF | −12.2780 *** | −12.8950 *** | −7.2100 *** |

**Table 4.**Mean absolute percentage errors and root mean square errors during the training phase (January 1997–March 2021).

Variable | MAPE | RMSE | ||||
---|---|---|---|---|---|---|

VAR(1) | VAR-KF | APVAR-KF | VAR(1) | VAR-KF | APVAR-KF | |

Thailand | ||||||

SET index | 5.5705 | 5.0223 | 3.4655 | 54.8660 | 50.5360 | 34.8130 |

REER | 1.1547 | 0.8920 | 0.5892 | 2.0094 | 1.5422 | 1.1419 |

CPI | 0.3129 | 0.2525 | 0.1721 | 0.4243 | 0.3529 | 0.2415 |

Average error | 2.3460 | 2.0556 | 1.4089 | 31.6991 | 29.1913 | 20.1106 |

Indonesia | ||||||

JKSE index | 5.2524 | 2.8055 | 2.7349 | 158.7900 | 70.9540 | 69.4390 |

REER | 2.7593 | 1.6239 | 1.4992 | 3.3597 | 2.3697 | 2.2680 |

CPI | 0.5095 | 0.3356 | 0.2279 | 0.4702 | 0.2827 | 0.1906 |

Average error | 2.8404 | 1.5883 | 1.4873 | 91.6984 | 40.9885 | 40.1122 |

Variable | MAPE | RMSE | ||||
---|---|---|---|---|---|---|

VAR(1) | VAR-KF | APVAR-KF | VAR(1) | VAR-KF | APVAR-KF | |

Thailand | ||||||

SET index | 1.0765 | 0.6936 | 0.1845 | 17.0420 | 10.9800 | 2.9212 |

REER | 0.6606 | 0.6199 | 0.5341 | 0.7087 | 0.6650 | 0.5730 |

CPI | 1.3333 | 1.1776 | 1.1454 | 1.3397 | 1.1832 | 1.1509 |

Average error | 1.0235 | 0.8303 | 0.6213 | 9.8780 | 6.3876 | 1.8427 |

Indonesia | ||||||

JKSE index | 0.9919 | 0.5629 | 0.4873 | 59.4720 | 33.7510 | 29.2170 |

REER | 0.9884 | 0.0666 | 0.0844 | 0.8703 | 0.0586 | 0.0743 |

CPI | 0.3198 | 0.3065 | 0.2595 | 0.3773 | 0.3616 | 0.3062 |

Average error | 0.7667 | 0.3120 | 0.2771 | 34.3405 | 19.4873 | 16.8694 |

Variable | MAPE | RMSE | ||||
---|---|---|---|---|---|---|

VAR(1) | VAR-KF | APVAR-KF | VAR(1) | VAR-KF | APVAR-KF | |

Thailand | ||||||

SET index | 0.8830 | 0.2855 | 0.3552 | 14.0720 | 4.5503 | 5.6597 |

REER | 2.4384 | 2.3650 | 2.2208 | 2.5718 | 2.4943 | 2.3423 |

CPI | 0.2959 | 0.0811 | 0.0415 | 0.2946 | 0.0807 | 0.0413 |

Average error | 1.2058 | 0.9105 | 0.8725 | 8.2608 | 2.9963 | 3.5365 |

Indonesia | ||||||

JKSE index | 2.8246 | 2.3965 | 2.2698 | 167.9900 | 142.5300 | 135.0000 |

REER | 0.0547 | 1.2434 | 1.4632 | 0.0486 | 1.1049 | 1.3002 |

CPI | 0.5235 | 0.5752 | 0.5049 | 0.6197 | 0.6809 | 0.5977 |

Average error | 1.1343 | 1.4050 | 1.4126 | 96.9897 | 82.2931 | 77.9467 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Promma, N.; Chutsagulprom, N.
Forecasting Financial and Macroeconomic Variables Using an Adaptive Parameter VAR-KF Model. *Math. Comput. Appl.* **2023**, *28*, 19.
https://doi.org/10.3390/mca28010019

**AMA Style**

Promma N, Chutsagulprom N.
Forecasting Financial and Macroeconomic Variables Using an Adaptive Parameter VAR-KF Model. *Mathematical and Computational Applications*. 2023; 28(1):19.
https://doi.org/10.3390/mca28010019

**Chicago/Turabian Style**

Promma, Nat, and Nawinda Chutsagulprom.
2023. "Forecasting Financial and Macroeconomic Variables Using an Adaptive Parameter VAR-KF Model" *Mathematical and Computational Applications* 28, no. 1: 19.
https://doi.org/10.3390/mca28010019