T-1
p(S|Y, λ) = p(Sτ|Y, λ) ɪɪ p(S,∣S,+ι, yt, λ). (2.5)
t=1
The probabilities p(ST|Y, λ) can be calculated using the filter introduced by Hamilton (1989),
after having chosen initial values for p(S0 |Y). As we are not able to say anything about St for
t < 1, we assume that the economy was in a steady state in t = 0. This enables us to choose
steady-state probabilities for p(S0 |Y), which are easy to compute4. We then may generate
p(ST|Y, λ), which allows us to compute p(St|St+1, yt, λ) by
p(St∖St+1,yt,λ)
p(St,St+1∖yt,λ)
P(St+ι∖yt,λ)
p(St+1∖St)p(St∖yt, λ)
p(st+ι∖yt,λ)
(2.6)
The regimes can now be jointly generated according to (2.5). It is then possible to draw the
unknown parameters from the conditional densities
p(Θj∖S, Θ-j,Y) α L(Y∖S,λ) ∙ p(Θj)
(2.7)
(2.8)
T
p(P∖S, Θ,Y) a p(Sq∖P) ∏ p(St∖St-ι,P) • p(P).
t=q+1
Some further details on the mathematical backgrounds of Bayesian analysis of Markov-switching
models may be found in the appendix.
2.2 Data
All data used corresponds to statistics of the International Monetary Fund except for German
GDP, which is taken from the Federal Statistical Office Germany. All data is denoted in nominal
terms and has a quarterly frequency. For τt and Gt we use total government revenues and
expenditures. Government debt Bt is represented by total government debt, which includes in
the case of Germany both debt of federal and federal state authorities. We use the Hodrick-
Prescott filter to detrend GDP data. Output deviations Y are then given by the percentage
deviation of GDP from its trend component5. The data starts for Germany with the 1st quarter
1970 and ends with the 4th quarter 2003. Unfortunately, the corresponding data for Spain is
only partially available before 1986 so that the analysis of Spanish fiscal policy has to rely on
the period 1986-2003. As all data is not seasonally adjusted and the seasonal pattern is also not
offset by the division by GDP. Therefore, we introduced a set of seasonal dummy variables to
capture the seasonal pattern.
4The procedure is explicitly described in section 4.1.3 of the appendix.
5We applied the Hodrick-Prescott filter in the case of Germany separately to the period before and after its
reunification to avoid a bias in the trend component.