## Introduction

This vignette provides the code to set up and estimate a 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. The
estimated model has the following form

\[\Delta y_t = \Pi y_{t - 1} + \sum_{l =
1}^{p - 1} \Gamma_l \Delta y_{t - l} + C d_t + u_t,\]

where \(\Pi = \alpha
\beta^{\prime}\) with cointegration rank \(r\), \(u_t \sim
N(0, \Sigma)\) and \(d_t\)
contains an intercept and seasonal dummies. For an introduction to
vector error correction models see https://www.r-econometrics.com/timeseries/vecintro/.

## Data

To illustrate the workflow of the analysis, data set E6 from
Lütkepohl (2006) is used, which contains data on German long-term
interest rates and inflation from 1972Q2 to 1998Q4.

```
library(bvartools)
data("e6")
plot(e6) # Plot the series
```