Bvartools

  • An Introduction to Factor-Augmented Vector Autoregression (FAVAR)

    Introduction

    As we saw in the post on vector autoregressive (VAR) models, traditional VAR models suffer from a so-called curse of dimensionality. Each additional variable adds a further equation and a further lag polynomial to every other equation, so the number of coefficients grows with the square of the number of variables. With the few decades of quarterly data that are usually available this limits a VAR to a handful of variables. Policy makers, however, base their decisions on a much larger set of indicators than a VAR can accommodate, and leaving that information out of the model can distort the results.

  • How Long Will Services Inflation in Austria Stay High?

    Services inflation in Austria has been stubborn. Energy and food prices have long stopped rising at the pace of 2022, but services, which make up half of the Austrian consumer basket, are still getting more expensive by more than 4% a year. Hochmuth and Petz (2026) offer an explanation for the euro area: before the pandemic, services became steadily more expensive relative to goods, the surge of goods prices in 2021 and 2022 pushed this relative price far below its trend, and part of today’s services inflation is services prices catching up. Their error correction model says how fast that happens.

    This post applies their model to Austria. The reproduction of the paper covers the euro area in detail, and its results serve as the benchmark here. The short answer is that the explanation does not carry over: in Austria the relative price of services has already returned to its trend and gone beyond it. A closer look shows that most of this is due to one item that weighs much more in Austria than elsewhere: restaurants and cafés.

  • Is Services Inflation a Catch-Up Story Everywhere in the Euro Area?

    Hochmuth and Petz (2026) explain why services inflation in the euro area has come down so slowly: before the pandemic, services became steadily more expensive relative to goods, the surge of goods prices in 2021 and 2022 pushed this relative price far below its trend, and part of today’s services inflation is services prices catching up. In the reproduction of the paper the euro area results hold up, but in Austria the story does not fit: the relative price of services is already above its trend. This post estimates the model for all 21 countries of the euro area to find out where the explanation holds and where it does not. The short answer: the mechanism is there almost everywhere, but it explains little of why services inflation has differed so much between countries since 2023.

  • Reproduction: Hochmuth, P., & Petz, N. (2026). On the persistence of services inflation and the price of services relative to goods.

    This post reproduces results from Hochmuth and Petz (2026) with bvartools, including the brief’s three descriptive charts: the composition of euro area inflation, and the relative price of services in the euro area and the United States.

  • Reproduction: Koop, G., León-González, R., & Strachan, R. W. (2011). Bayesian inference in a time varying cointegration model.

    The Fisher hypothesis says that nominal interest rates move one for one with expected inflation, so that the real interest rate is stationary. In a vector error correction model (VECM) of a short-term interest rate \(r_t\) and inflation \(\pi_t\) it implies a single cointegrating relationship with the vector \((1, -1)'\). Tests of it on long samples give mixed results, and one reason may be that the relationship is not the same throughout: a hypothesis that holds in some decades and fails in others is rejected by a model that insists on one answer for all of them.

    Koop, León-González and Strachan (2011) develop a VECM whose cointegration space is allowed to change over time, and use it on exactly this question. The difficulty they solve is not computational but conceptual. The natural extension of a time varying parameter VAR – letting the cointegrating vectors follow a random walk – does not work, because only the space spanned by the vectors is identified, and a random walk on a normalised vector says nothing sensible about how that space moves. Their state equation instead implies that the space in one period is centred on the space of the period before, and that its marginal prior is uniform in every period.

    This post reproduces the two results of the application with bvartools: the path of the cointegrating coefficient in the paper’s preferred model (Fig. 1) and the log predictive likelihoods of the model variants (Tables 1 and 2).

  • Can a Bayesian VAR Beat Professional Forecasters?

    A comparison between the models one happens to have written down answers a narrow question: which of them fits and forecasts best. It does not answer whether any of them is worth using. The benchmark for that is the forecast somebody actually published and was held to. This post runs that comparison for Austria, where three Bayesian VAR models compete against the projections of the European Commission, the ECB, the IHS, the IMF, the Austrian central bank and WIFO – and against the simplest competitor of them all, which is to carry the last observation forward.

  • Reproduction: Koop, G., & Korobilis, D. (2014). A new index of financial conditions.

    A financial conditions index (FCI) compresses a large number of financial market series – spreads, prices, volatilities, survey measures – into a single series that is meant to say whether financial conditions are tight or loose. The obvious tool for that job is a factor model. The harder question is which series should count towards the index, and by how much, given that the answer plainly changes over time: the TED spread said something quite different about the state of the financial system in 2008 than it did in 1995.

    Koop and Korobilis (2014) answer it by letting the factor loadings drift. Their index comes out of a factor augmented VAR (FAVAR) in which both the loadings and the transition coefficients follow random walks, so a series can enter and leave the index as the sample proceeds. What makes the paper more than a large state space model is how it is estimated: the priors on the innovation variances are replaced by forgetting factors, which reduces the whole estimation to two passes of a Kalman filter and smoother. No posterior simulation is involved, and the entire index over 175 quarters and 18 financial series is obtained in a hundredth of a second.

    This post reproduces the two exercises the paper is built around – the index itself and its real-time counterpart – using the fincond package.

  • Bayesian Inference of Structural Vector Autoregressions (SVAR) with the `bvartools` package

    The bvartools allows to perform Bayesian inference of Vector autoregressive (VAR) models, including structural VARs. This post guides through the Bayesian inference of SVAR models in R using the bvartools package.

    Data

    For this illustration we generate an artificial data set with three endogenous variables, which follows the data generating process

    \[y_t = A_1 y_{t - 1} + B \epsilon_t,\]

    where

    \[ A_1 = \begin{bmatrix} 0.3 & 0.12 & 0.69 \\ 0 & 0.3 & 0.48 \\ 0.24 & 0.24 & 0.3 \end{bmatrix} \text{, } B = \begin{bmatrix} 1 & 0 & 0 \\ -0.14 & 1 & 0 \\ -0.06 & 0.39 & 1 \end{bmatrix} \text{ and } \epsilon_t \sim N(0, I_3). \]

  • An Introduction to Bayesian VAR (BVAR) Models

    Bayesian methods have significantly gained in popularity during the last decades as computers have become more powerful and new software has been developed. Their flexibility and other advantageous features have made these methods also more popular in econometrics. This post gives a brief introduction to Bayesian VAR (BVAR) models and provides the code to set up and estimate a basic model with the bvartools package.

  • Bayesian Error Correction Models with Priors on the Cointegration Space

    Introduction

    This post provides the code to set up and estimate a basic Bayesian vector error correction (BVEC) model with the bvartools package. The presented Gibbs sampler is based on the approach of Koop et al. (2010), who propose a prior on the cointegration space.

    Data

    To illustrate the estimation process, the dataset E6 from Lütkepohl (2007) is used, which contains data on German long-term interest rates and inflation from 1972Q2 to 1998Q4.

  • Stochastic Search Variable Selection

    Introduction

    A general drawback of vector autoregressive (VAR) models is that the number of estimated coefficients increases disproportionately with the number of lags. Therefore, fewer information per parameter is available for the estimation as the number of lags increases. In the Bayesian VAR literature one approach to mitigate this so-called curse of dimensionality is stochastic search variable selection (SSVS) as proposed by George et al. (2008). The basic idea of SSVS is to assign commonly used prior variances to parameters, which should be included in a model, and prior variances close to zero to irrelevant parameters. By that, relevant parameters are estimated in the usual way and posterior draws of irrelevant variables are close to zero so that they have no significant effect on forecasts and impulse responses. This is achieved by adding a hierarchial prior to the model, where the relevance of a variable is assessed in each step of the sampling algorithm.