Monetary policy, financial frictions and structural changes in Uganda: a Markov-switching DSGE approach

Abstract This paper considers the use of regime-switching dynamic stochastic general equilibrium models for monetary policy analysis and forecasting purposes. The objective is to determine whether or not the inclusion of these regime-switching features provide a more accurate description of the economy in a particular low income country. All of the models incorporate financial frictions that are introduced through the activities of heterogeneous agents in the household and several other features that are incorporated in most small open-economy models. Two variants of regime-switching models are considered: one includes switching in the monetary policy rule (only) and the other employs switching in both the monetary policy rule and the volatility of the shocks. The models are applied to the quarterly macroeconomic data for Uganda and most of the parameters are estimated with the aid of Bayesian techniques. The results of the extensive in- and out-of-sample evaluation suggest that the model parameters do not remain constant over the two regimes. In addition, the transition probabilities suggest that there are three distinct periods where the central bank response has been more aggressive. These periods relate to a change in policy framework and significant shocks that have affected the Ugandan economy. It is also noted that the forecasting performance of the regime-switching models are possibly superior to the model that excludes these features over certain horizons.


Introduction
Many macroeconomic and financial time-series variables that are used in quantitative macroeconomic models may be subject to a number of regime-switching events that could influence the data-generating process. Some of these changes in regime could be attributed to shifts in policy, economic transformations or the effects of unusually large shocks that are more prevalent in low-income countries (LICs). 1 In addition, the periodic revision of data collection and compilation practices, which arise more frequently in low-income countries, may also give rise to a number of structural breaks. 2 To consider the potential impact of these phenomena, the objective of this study is to determine whether or not the inclusion of specific regime-switching features may provide a more accurate description of economic activity that is summarised by the data generating process of a particular LIC. Given this objective, the case of Uganda is of particular interest, as it has been affected by extremely large shocks and the central bank has recently moved away from targeting monetary aggregates to implementing a modern inflation-targeting framework, which could result in different regimes for monetary policy. All of these factors could influence the values for the estimated structural parameters and the volatility that is associated with the model variables.
The early literature that has made use of dynamic stochastic general equilibrium (DSGE) models to analyse business cycle fluctuations assume the presence of timeinvariant structural parameters and constant variations in structural shocks over the entire sample period. 3 However, a number of studies have recently introduced Markov-switching (MS) to the DSGE framework, which allows for possible regimeswitching behaviour in structural macroeconomic models. These models may also be used to contain the effects of large shocks that arise over particular periods of time. Notable contributors to this strand of literature include, Liu et al. (2009), Farmer et al. (2009), Farmer et al. (2011, Liu and Mumtaz (2011) and , which have been applied to developed-world economies. 4 In this paper we extend the literature on structural models for LICs, to include MS-DSGE models that incorporate financial frictions and small open-economy features to describe the sources of macroeconomic fluctuations in Uganda. 5 Hence, the model postulated in this paper should be able to show whether or not there is any regime-switching behaviour in the response of the central bank to changes in financial frictions or other factors that influence the reaction function. 6 In addition, we considered whether the source of any potential changes in conducting monetary policy may be attributed to changes in the volatility of structural shocks. To the best of our knowledge, this is the first example of a MS-DSGE model that incorporates financial frictions, in both developed-and developing-country settings, while it is also the first example of a MS-DSGE that has been applied to the data of a LIC. 7 To evaluate whether the addition of regime-switching behaviour provides a more accurate description of the data, we consider the estimated transition probabilities, which suggest that the application of monetary policy has been subject to a number changes between 2000Q1 and 2018Q3. In addition, these results also suggest that a number of particularly large shocks have also influenced economic activity over this period. This analysis is then complemented by an extensive in-sample and out-ofsample evaluation, where we have compared the statistics for models that incorporate various regime-switching specifications against a model that does not include these features. The in-sample evaluation makes use of log-posterior, log-likelihood, logprior and log-marginal data density Laplace statistics. When conducting the out-ofsample evaluation for the nested models, we reported on the respective root-mean squared-error (RMSE) statistics before we conduct the tests of Clark and West (2007) and McCracken (2007). In addition, we evaluate the distributions of the various forecasts after computing the probability integral transforms (PITs).
The results show that while the in-sample statistics of the competing models are largely comparable, the out-of-sample forecasting results suggest that the regimeswitching models may provide a more accurate description of the data over certain horizons. For example, the regime-switching models provide superior inflation forecasts over the short-term, while similar results may be provided for the interest rate over the same horizon. In addition, the regime-switching models also provide superior forecasts for output over various selected horizons. The transition probabilities of the regime-switching models also appear to capture important economic events that relate to the data-generating processes.
The remainder of the paper is organised as follows. Section 2 provides an overview of monetary policy in Uganda, before describing the features of the specific model that is utilised in this paper. Section 3 includes a discussion on the data that has been used and the estimation methodology that has been employed. The results from the estimation and model evaluation are contained in Section 4. The conclusion is presented in Section 5.

Ugandan monetary policy and financial crises
Monetary policy plays an important role in the economies of both developed and developing countries. For example, by changing the short-term interest rates, the central bank influences the cost and availability of credit, which has a subsequent effect on economic activity and the level of inflation. In addition, it also affects the balance of payments and other measures of economic activity through various monetary policy transmission mechanisms (c.f. Bernanke & Blinder, 1988;Gertler & Karadi, 2015;Kashyap & Stein, 1994). To successfully implement monetary policy, most central banks rely on supporting tools, which include quantitative macroeconomic models that can be used to evaluate the effect of monetary policy actions on the economy. In addition, these models can also be used to generate forecasts for key macroeconomic variables.
When constructing macroeconomic models that are to be used to describe important aspects of monetary policy in low-income countries (LICs), there are several unique aspects that need to be considered. 8 This is partly due to the fragile macroeconomic environment that exists in LICs, which may influence the data generating processes that could subsequently differ to those of their developed world counterparts. In addition, financial markets, which influence monetary policy transmission, have largely remained underdeveloped in LICs and are mostly dominated by commercial banks. This contributes to one of the potential ways in which a LIC is able to interact with other economies (and would differ from the case of advanced emerging market and developed economies). These features would need to be incorporated into the design of macroeconomic models. As a result, these models may need to incorporate a number of unique features.
In terms of the application of monetary policy, the Bank of Uganda (BOU) made use of a monetary targeting approach that was implemented through the Reserve Monetary Programme (RMP), between May 1993 and July 2011. This framework made use of base money and broad money as the operating and intermediate targets, respectively. The implementation of the RMP was motivated by three reasons. First, information on the real economy was limited over this period of time, and it was only available with a considerable lag, while the data on base money and other monetary aggregates was available with a shorter lag. Second, there existed underlying economic relationships between monetary aggregates, output and inflation, as was noted in studies such as Mugume (2011). Third, empirical evidence at the time had indicated a stable money demand function and a predictable money multiplier.
In July 2011, the BOU adopted an inflation targeting lite monetary policy framework, which were intended to strengthen the implementation of Uganda's medium term macroeconomic framework. Despite the use of a new framework, the primary policy objective of monetary policy in Uganda remains unchanged, which is focussed on the control of core inflation over a medium-term horizon. As part of the process of introducing an inflation targeting lite monetary policy framework, the BOU makes use of the interest rate as the main policy instrument for the implementation of monetary policy. The interest rate that is under the direct control of the central bank is called the Central Bank Rate (CBR) and it is used to guide the seven day interbank interest rate. The CBR is set once a month and is publicly announced, so that it clearly signals the current stance of monetary policy. The CBR is set at a level which is consistent with moving core inflation towards the BOU's current policy target of 5% over the medium-term.
At present there are only a few dynamic stochastic general equilibrium (DSGE) models that incorporate features of the Ugandan economy. Early contributions were made by Berg, Gottschalk et al. (2010) and Berg, Unsal et al. (2010), where in their first study, the authors make use of a multi-sector DSGE model to investigate the impact of aid on selected macroeconomic variables, as well as the effect of different policy responses. In their second study, the authors extend the DSGE literature to provide a role for money in two LICs, in a calibrated model. Both models are based on a money targeting policy set-up, which was replaced by an inflation targeting (IT) monetary policy framework, where the interest rate rule is used as the main policy instrument. One study that considers the use of IT central bank for Uganda is contained in Anguyo et al. (forthcoming), which also contains a more extensive review of other studies that make use of structural macroeconomic models for LICs within Sub-Saharan Africa.
Given the effect of the Global Financial Crisis on economic activity, it not surprising to note that this event and its aftermath has had an enormous impact on the construction of DSGE models, which have more recently sought to include mechanisms for financial imperfections. 9 One of the important contributions in this regard include those of Curdia and Woodford (2010), while Christiano et al. (2018) and Lind e (2018) contain useful reviews of the models that have been developed in response to this crisis.

Structural model
The model structure incorporates several features that may characterise a small openeconomy, as described in Justiniano and Preston (2010) and Gali and Monacelli (2005). This basic framework is then extended to incorporate financial frictions, where we allow for a heterogeneous household sector that distinguishes between savers and borrowers, as per the methodology of Curdia and Woodford (2010). The model also incorporates a number of other nominal and real rigidities that influence the behaviour of the monopolistically competitive firms, which produce intermediate goods, while perfectly competitive firms produce the final goods. It is also assumed that there is habit formation in consumption, as well as incomplete asset markets that allow for the identification of country risk premia. Financial intermediaries are assigned the task of bridging the gap between savers and borrowers, while the government sector incorporates a central bank that is responsible for monetary policy. The foreign economic sector is constructed as a trade-weighted average of key trading partners. In what follows, we present details of the basic model in log-linearised form before providing details of how the model is augmented to incorporate various Markov-switching processes.
The first order optimisation condition for the intertemporal maximisation problem for heterogeneous households yields a partially forward-looking consumption equation that describes current consumption as a function of past and expected future levels of consumption. In addition, the current level of consumption is affected by the real interest rate and a demand (or preference) shock.
Note that s 2 b, s ½ denotes household borrowers and savers, c t is the level of consumption in the current period, r s captures the inverse elasticity of intertemporal substitution, and h s refers to the habits in consumption behaviour. The real interest rate is derived from R t ÀE t p tþ1 , where R t , is the nominal interest rate and p tþ1 represents the expected inflation rate for the next period. The parameter e c t denotes the exogenous demand shock, which is assumed to follow a first-order autoregressive process.
Domestic firms that produce intermediate goods for the economy are subject to a Calvo-type price setting mechanism. Therefore, a proportion of domestic firms, ð1 À h H Þ, have an opportunity to change prices in a particular period, while the remaining proportion are not able to adjust their prices. When allowed to change prices, agents make use of information relating to past price movements (i.e. indexation) and future expected price movements. This behaviour allows for the derivation of a forwardlooking new Keynesian Phillips curve that describes the evolution of domestic price inflation in terms of past inflation, expected future inflation, and the effects of real marginal costs. Hence, this relationship could be expressed as, where p H, t is domestic price inflation and b denotes the time-discount factor. The parameter d H measures the degree of price indexation to past inflation in the domestic economy, and h H is the Calvo price setting parameter for domestic firms. The term mc t represents the real marginal cost of firms, which is derived as, where, s t represents the terms of trade and z t captures the exogenous productivity shock that follows a first-order autoregressive process. The inverse of the elasticity of labour supply is represented by u and c is the import share of consumption. The term y t in the above equation represents domestic output that is related to consumption through the goods market clearing condition, In this case, y Ã t represents foreign output, g refers to the elasticity of substitution between domestic and foreign output, and w denotes the measure of the gap from the law of one price. 10 The terms of trade (TOT), s t , can then be expressed as the ratio of the foreign price level, p F, t , to the domestic price level, p H, t : When expressed in a log-linearised form we have, After applying time differencing to Equation (5), we are able to obtain the stationary TOT as, s t Às tÀ1 ¼ p F, t Àp H, t : The gap from the law of one price in Equation (4) plays an important role in the small open-economy literature, as it captures the degree of monopolistic competition among retail firms in the domestic economy. Consequently, the log-linearised equation that represents the gap from the law of one price in the model is given by, where q t denotes the real exchange rate, which is derived from the measure of nominal exchange rate, e t , after it is deflated by the price differential between the foreign and domestic economy. This relationship may be expressed in levels as, q t ¼ e t þ p Ã t Àp t . After time differencing, we obtain the stationary real exchange rate equation, q t Àq tÀ1 ¼ ᭝e t þ p Ã t Àp t : The equation that describes the relationship between the real exchange rate, the TOT and the law of one price gap may then be expressed as, q t ¼ ð1 À cÞs t þ y Ã t : The optimisation problem for firms in the foreign economy provides a similar forward-looking new Keynesian Phillips curve for foreign goods inflation: where, d F measures the degree of price indexation to past inflation in the foreign economy, h F is the Calvo price-setting parameter, which measures the probability that foreign firms will not adjust prices in a given period, and e cp t denotes the import cost-push shock, which follows a first-order autoregressive process. Since the overall consumer goods inflation in the domestic economy comprises both domestic goods inflation and foreign goods inflation, it may be expressed as, The uncovered interest rate parity (UIP) condition in the model relies on the assumption of incomplete asset substitution between domestic and foreign bonds, such that, where, R t and R Ã t relate to the domestic and foreign interest rate, respectively. The p Ã t parameter refers to the foreign rate of inflation, while / uip represents debt elasticity for the interest rate premium. The net foreign asset position for the domestic economy is denoted by a t , and e rp t is the risk premium shock. It is assumed that shocks to the foreign interest and inflation rate, and the risk premium shock all follow independent first-order autoregressive processes.
The net-foreign-asset position from Equation (8) could then be expressed as: Heterogeneous households differ in their marginal utility of consumption, creating a role for financial intermediation. In this case, the households that deposit their excess financial resources with financial institutions are termed savers, while the borrowing households experience resource deficiencies and borrow money from financial intermediaries to finance their consumption needs. Thus, financial frictions are introduced into the model through the first-order condition that describes the evolution of the borrowing behaviour of households, l t , which in log-linearised form may be expressed as; where r is the average intertemporal elasticity of substitution for the two household types, X is the probability of changing between household types, and x t is the interest rate spread. The p b parameter denotes the probability that a borrowing household is drawn in the next period, g t refers to government expenditure, and g c t denotes an exogenous financial shock. Government expenditure takes the form of a simple firstorder autoregressive process.
The optimal first-order condition for the interest rate spread was then obtained from the financial intermediaries optimisation problem and it evolves according to the following expression; where g v is the elasticity of non-performing loans, v is the steady state of non-performing loans, and l g v t is an exogenous shock to the interest rate spread, which also follows an autoregressive process. Non-performing loans, v t , are affected by the current state of economic conditions, which may be described by output and the rate of inflation. The log-linearised form of this expression is given by; where g v t is the innovation to non-performing loans. The relationship between the interest rate spread, the borrowing rate, R b t , and the savings rate, R t , may be expressed as The relationships that describe the evolution of the inflation rate, output and the interest rate in the foreign economy are specified as: where, q pÃ , q y Ã and q R Ã are the parameters measuring persistence in foreign inflation, output and the nominal interest rate, respectively. Then finally, it is assumed that the central bank conducts monetary policy through a generalisation of the rule that was proposed in Taylor (1993). Hence, in addition to the factors that affect output and inflation, the central bank reacts to changes in the exchange rate and interest rate spreads: where, ᭝e represents nominal exchange rate depreciation, y t is the domestic output gap, and e R t is the monetary policy shock, which is assumed to follow a first-order autoregressive process. The term q R is the interest rate smoothing parameter, while q p , q y , q e and q x are parameters that measure the size of the central bank response to changes in the associated variables.

Markov switching
We considered two variants of regime-switching models, where the first model allows for the presence of Markov-switching in the domestic monetary policy rule. Hence the formulation of Equation (16) may be expressed as, where the subscript h denotes the unobserved regimes in the monetary policy rule that are described as two-state discrete Markov processes, which may be expressed as h 2 1, 2 ½ : The probability of moving from one regime to the other may be denoted by j 1À2 and j 2À1 , respectively. In this case, the superscripts in the first of these terms indicate the transition from regime one to regime two, while the second term refers to the transition probability of moving from regime two to regime one. Note that the current state of the economy may be influenced by the values of the variables in the monetary policy rule, where we could possibly allow for the central bank to respond either strongly or weakly to deviations of variables from their steady-state values, by allowing for two separate regimes. 11 The second variant of the model incorporates regime-switching in both the monetary policy rule and the volatility of the structural shock processes. Therefore, in addition to the earlier modification in the monetary policy rule that is contained in Equation (17), the second scenario also incorporates an additional independent two-state discrete Markov process which is attached to the variances of the structural shock processes. Thus, the regime switches in the volatility of the shock processes, may be expressed as g j , where the superscript j denotes a given type of structural shock. The subscript is then used to denote the discrete two-state Markov process, which may be expressed by 2 1, 2 ½ : In this case it is assumed that the volatility of the shock process also contains two regimes, where the first volatility regime is denoted ð ¼ 1Þ and the second ð ¼ 2Þ: In this case, the transition probability of moving from the first volatility regime to the second is denoted f 1À2 , and the transition probability of moving from the second volatility regime to the first one is f 2À1 : 12

Data
The data for the ten observed variables comprises quarterly measures for the Ugandan economy and its main trading partners over the period 2000Q1-2018Q3. This includes all available quarterly measures of official output data for Uganda. All of the variables are stationary and include measures for the nominal interest rate, inflation rate, foreign inflation rate and foreign interest rate. The terms of trade and real exchange rate are expressed as growth rates and are used to identify the country risk premium, while the lending rate and non-performing loans as a ratio of total loans are used to identify the parameters that pertain to the financial frictions.
The measures for output, which include domestic and foreign gross domestic product (GDP), are expressed as growth rates, and those variables that exhibit seasonality were adjusted accordingly. 13 The domestic data was sourced from the Bank of Uganda (BoU) and the Uganda Bureau of Statistics (UBOS), while the foreign data was sourced from the Organisation for Economic Co-operation and Development (OECD) and the International Monetary Fund (IMF). 14

Estimation methodology
In the models that incorporate rational expectations and Markov-switching, the solution in each state will be a function of the solution in all other states, and vice versa. This interdependence precludes the use of traditional rational expectations solution methods, which assume that all the parameters are constant. Therefore, we followed the approach that is based on a higher-order perturbation strategy, which is described in Maih (2015). This approach is largely based on the Newton techniques that follow the concept of minimum state variables (MSV), while the stable parameters were obtained from a characterisation that is based on the concept of mean square stability (MSS). 15 Similar techniques that are closely related to this approach may be found in Davig and Doh (2014), Farmer et al. (2008) and Farmer et al. (2011). To apply this methodology, all the model equations were log-linearised, and the first-order Markov chains maintained constant transition probabilities for the two regimes. Thus, the general form of the Markov-switching rational expectations model may be summarised as; where x t is a n Â 1 vector of all the observed and unobserved endogenous variables and e t $Nð0, 1Þ is the vector of structural shock processes. In the case where we do not employ any regime-switching, we are able to summarise the model with twentyfour endogenous variables, for which we have twenty-four equations. The stochastic regime index, s t , contains the states of the different Markov chains, which switch between a finite number of possibilities with cardinality h, where s t ¼ 1, 2, :::, h: In the case where there were two possible regimes, we assumed that these probabilities are constant, so that s t represents the current period state and s tÀ1 denotes the previous period state. Hence, the Markov transition probabilities may be expressed as p ij ¼ p s tÀ1, s t , where the subscripts denote the probability of moving from the previous period state, s tÀ1 , to the current period state, s t . Therefore, the first expectational term from Equation (18) may be defined as; The model likelihood function was evaluated with the aid of a filtering procedure, as this class of model assumes the presence of unobserved states and variables. 16 Bayesian techniques were used to estimate the model parameters, as this procedure allows one to treat the model parameters, unobserved variables and unobserved states as random variables. Therefore, information from the likelihood function was combined with the prior densities of the parameters to form the posterior kernel, which was used to derive the mode of the posterior distribution. The estimates of the mode were also used to internalise the Markov Chain Monte Carlo (MCMC) algorithm, from which we obtained the full posterior distribution and log marginal data density (MDD) that was estimated with the aid of a Laplace approximation.  Table 2 presents the results of the prior and posterior parameter estimates, together with details relating to the posterior parameter distribution for the model with regime-switching in the monetary policy rule (only). For each parameter, the priors for the two regimes were assumed to be equivalent. The posterior results suggest that there are substantial differences between the first regime ðh ¼ 1Þ and the second ðh ¼ 2Þ: For instance, the results suggest that there is a greater degree of interest rate smoothing during the second regime. In addition, we noted that the central bank responds at least two-and-a-half times more strongly to changes in each of the monetary policy rule coefficients in the first regime, relative to the second. For example, the central bank response to changes in the inflation rate is ð1 À q R Þq p ¼ 0:5921 in the first regime and 0.2114 in the second. Similarly, the central bank response to changes in output in the first regime is ð1 À q R Þq y ¼ 0:1645 and 0.0573 in the second. However, the response to changes in the exchange rate and the interest rate spread in the first regime are 0.0092 and 0.1121, compared with respective responses of 0.0032 and 0.0432 in the second. Therefore, these results suggest that when regimeswitching features are incorporated in the monetary policy rule (only), the central bank response will be more aggressive when in the first regime, as there is less interest rate smoothing and a much stronger response to changes in inflation and output (while the response to the exchange rate and interest rate spread is also slightly stronger).

Prior and posterior estimates
The posterior parameter estimates for the model that incorporates regime-switching features in both the monetary policy rule and the volatility of the shocks are presented in Table 3. These results suggest that there are substantial differences in the posterior estimates, when comparing the two regimes. For example, there would appear to be more interest rate smoothing in the first regime, in comparison with the second. Hence, the results suggest that the central bank responds more aggressively in the second regime, relative to the first. For instance, the measure for the central bank response to changes in inflation is 0.2237 in the first regime, compared with a response of 0.5871 in the second. In addition, the central bank response to changes in output, the exchange rate and interest rate spreads during the first regime may be summarised by the coefficients: 0.0607, 0.0034 and 0.0454, respectively. These should be compared with responses of 0.1567, 0.0096 and 0.1089 in the second regime. This result is contrary to those that are reported in Table 2, as they suggest that the central bank response in the first regime may be characterised by higher degrees of interest rate smoothing and a weaker response to changes in inflation, output, the exchange rate and the interest rate spread.
In terms of the volatility of the shock processes, the results suggest that there is generally higher volatility in the second regime. While such a result is plausible, it is not easy to interpret without the information from the transition probabilities, which is included below. 18

Transition probabilities
The results of the smoothed transition probabilities for the models that include regime-switching features are displayed in Figures 1-3. The first two of these figures display the results of the transition probabilities that pertain to the monetary policy rule, which utilise information from and j. In both figures, when the value of the transition probability (represented by the shaded area) is one (as seen from the right-hand axis), it would represent a more aggressive central bank response (i.e. ¼ 1). These results suggest that the smoothed transition probabilities that capture changes in the behaviour of the monetary authority show notable shifts in the behaviour of the monetary authority that occurred in 2001-2004 and after 2013. In addition, the transition probabilities suggest that there was also a change in regime that arises around 2011, when the region was affected by a severe drought that gave rise to an inflationary spike. The rapid rise in inflation was then subdued after the central bank adopted an inflation targeting framework later that year, which gave rise to a complete behavioural change in the conduct of monetary policy after 2013. During the two periods when there are changes in the behaviour of the monetary authority (towards the beginning and end of the sample), the output gap is less volatile and the rate of inflation is relatively low, while the central bank interest rate is relatively high. For instance, during the early part of the sample, when the value of the transition probability is one (corresponding to a change in the behaviour of the monetary authority), the output gap was less volatile and the rate of inflation was low, while the interest rate was relatively high. Thereafter, we appear to observe a transition into an alternative regime where the volatility in the output gap increased, while the rate of inflation was relatively high and the interest rate was relatively low. This regime included the period of the Global Financial Crisis and its after-effects, where there were few changes in the stance of monetary policy. Looking at the latter part of the sample, when the value of the transition probability is again one, we note that the output gap is less volatile, the rate of inflation is low, and the policy rate is relatively high.
It is also worth noting that the smoothed transition probabilities for the two variants of regime-switching models, which are contained in Figures 1 and 2, are extremely similar.
Turning our attention to the smoothed transition probabilities for the volatility of the shock processes, which are contained in Figure 3, we note that the model finds itself mostly in regime one. However, there are distinct periods when the smoothed transition probabilities for the variances of the shock processes spike. These appear to capture key events, such as the period of a relatively large exchange rate shock in 2000Q1, the period of a heightened interest rate shock in 2004Q1, and the period in which both output and the exchange rate shocks were relatively high in 2008Q4. There also appear to be spikes during the period of 2011Q3 when inflation and interest rates increased, as well as the transition to a more aggressive monetary policy stance that started around 2013.
Therefore, these results suggest that the smoothed transition probabilities for the variants of the regime-switching models capture a number of important events that have affected the state of the Ugandan economy, as described by the data generating process for key macroeconomic variables.

In-sample evaluation
The in-sample statistics for the three models -i.e. the no-switching model, the model that incorporates regime-switching in the monetary policy rule (only), and the model that incorporates regime-switching in both the monetary policy rule and the volatility of shocks -are reported in Table 4. These results for the log-posterior, the log-likelihood, log-prior and log-MDD Laplace statistics may be used to identify the model that would provide a superior explanation of the macroeconomic data for Uganda. They suggest that the in-sample statistics for all three models are highly comparable and when considering the log-prior and log-MDD Laplace, we note that there is a relatively small difference in favour of the model that excludes regime-switching features. However, the model that includes regime-switching in monetary policy rule and the volatility of shocks is responsible for the superior log-posterior and log-likelihood statistics.   Table 5 contains the results of the evaluation of the out-of-sample performance based on the RMSEs. The forecasts were generated by assuming that the in-sample period for each of the estimated models initially ends in 2008Q4. Thereafter, one-to eightstep-ahead forecasts were generated by first updating the in-sample data to 2009Q1, before a new set of model parameters were estimated to generate the second forecast. All the recursive forecasts were then used in the evaluation exercise for each stepahead forecast, over the entire out-of-sample period for the three models that are described above.

Out-of-sample evaluation
When considering the results of the RMSEs, we note that there are some considerable differences in the respective out-of-sample statistics over the short-term horizon. However, the differences appear to be very small when we consider the forecasts that were generated for the longer horizons. More specifically, when forecasting future values for output, the results suggest that the model that does not incorporate regimeswitching features and the model that includes switching in both the monetary policy and volatility of shocks are responsible for superior out-of-sample forecasting properties at various different horizons. With regard to the forecasts for the rate of inflation, the performance of the model that does not include regime-switching features provide superior results over the medium horizon, while the model with regime-switching in the monetary policy rule provides superior results over other horizons. Similarly, the interest rate forecasts for the model that does not include regime-switching features are responsible for improved out-of-sample forecasting results over the longer horizon, whereas the regime-switching model with switching in the monetary policy rule provides superior results over shorter horizons.
To consider whether the differences in the RMSEs are potentially significant, we tested the null hypothesis of equal predictive ability, where the model that does not include regime-switching behaviour was compared with the two regime-switching models. This investigation makes use of the methodology that has been proposed by Clark and West (2007) and McCracken (2007), which are usually referred to as the CW and MSE-F tests, respectively. 19 The CW test statistics are reported in Table 6, where the results for the output forecasts suggest that the model that includes regime-switching features in both the monetary policy rule and the volatility of shock processes significantly outperforms the model that excludes these features at the two-, five-and eight-step-ahead horizons (at the 5% and 10% significance levels). For inflation forecasts, the improved forecasting performance of the model with regime-switching features in the monetary policy rule is significant over the one-and two-step-ahead horizons, at the 1% and 10% level of significance. Then, lastly, for the interest rate forecasts, the difference in the performance of the models that include regime-switching features is not significant.  Table 7 includes the results for the MSE-F test for equal predictive ability between the null of no regime-switching and the alternative for the two regime-switching models. The results support those of the CW test, but would imply that there are more quarters in which the variants of the regime-switching model significantly outperform the model that excludes these features (particularly with regards to the forecasting performance of these models over shorter horizons). For example, for the inflation rate forecasts, the regime-switching model is now responsible for significant improvements over the one-and two-step-ahead horizons, at the 1% level of significance, while the model that incorporates regime-switching in the monetary policy rule provides significant performance gains when forecasting interest rates over the one-and two-step-ahead horizons (at the 5% and 1% level of significance). In the case of output forecasts, the regime-switching model is no longer able to provide a significant improvement over the 8-step-ahead forecasting horizon.
The out-of-sample evaluation of the forecast densities are performed with the aid of the probability integral transform (PIT). 20 These statistics are used to compare the distribution of the respective forecasts in relation to the underlying data-generating process. As part of this analysis, we reported on the results of the histograms of the PITs at the one-, four-and eight-step-ahead forecasting horizons. These are displayed for measures of output, inflation and interest rates in Figures 4, 5 and 6, respectively. To interpret these results, it is worth noting that the variants of the models that are responsible for superior predictive distributions would generate a density that approximates a uniform distribution. Overall, the results suggest that there is no single model that provides superior forecasting densities for all variables and forecasting horizons. However, there are a few instances where certain models generate forecast densities that are more representative of the features of the underlying data-generating process of the respective variables.
The results in Figure 4 suggest that the PITs for output are relatively uniform as they fall within the confidence intervals for the entire forecasting horizon and for all the model variants. This would imply that the three variants of the model are able to generate reasonably accurate forecast densities for output, which match the  distribution of the true underlying data generation process. In terms of the relative performance of the three models, the results are fairly similar, with the model that includes regime-switching in both the policy rule and volatility of the shocks outperforming the others over the longer horizon. Figure 5 suggests that the PITs do not take the form of a uniform forecasting distribution at the four-step-ahead and eight-step-ahead forecasting horizons. This result is consistent across all models, where there is a concentration around the mean and a general scarcity of observations on the extreme left-hand side of the distribution. The results in Figure 6 suggest that all the PITs are relatively uniform at the one-stepahead horizon. However, as in the case of inflation, there is a slight concentration around the mean over longer horizons, where there is also a scarcity of observations on the left-hand side.
In summary, the evaluation of the out-of-sample point-forecasting results suggest that the variants of the regime-switching model may exhibit superior predictive ability for the three key macroeconomic variables (output, inflation rate and interest rate) over certain forecasting horizons. When considering the forecasting densities of the three models, we note that in most cases they are comparable and in the case of the output forecasts, they appear to provide a fairly reasonable characterisation of the higher moments of the underlying data.

Conclusion
This paper considers the use of regime-switching dynamic macroeconomic models that may be used for monetary policy analysis and forecasting purposes in Uganda. The motivation for this study is based on the premise that many LICs, such as Uganda, are affected by large domestic and external shocks that may influence the data generation process of key macroeconomic variables over particular time periods. We considered two variants of regime-switching models: one that incorporates regime-switching features in the monetary policy rule (only) and another that incorporates regime-switching in both the monetary policy rule and in the volatility of shock processes. After estimating most of the parameters in the models that incorporate regimeswitching, we note that there are significant differences in application of monetary policy when comparing the estimation results for the two regimes. These transition probabilities also suggest that there are only a number of instances where the central bank response was particularly aggressive, where there was less interest rate smoothing and a much stronger response to changes in inflation and output. Such behaviour is consistent with the underlying events that affected the Ugandan economy at particular points in time. For example, during the start of the sample period, we note that the output gap is less volatile and the inflation rate is relatively low, while the policy interest rate is relatively high and volatile. Thereafter, during the period  2006-2010 the volatility in the output gap and the exchange rate increased, while interest rates were relatively low. This period of benign central bank activity was brought to an end as a result of the large spike in inflation in 2011. After the rate of inflation declined to more acceptable levels, interest rates followed suit, and the transition probabilities suggest that the central bank was no longer implementing an aggressive policy. From 2013 onwards, the effects of the implementation of the IT framework appear to suggest that the central bank has been prepared to make relatively large changes to interest rates in response to other economic developments, which include shocks to the nominal exchange rate. In terms of the volatility of the shock processes, the model that incorporates regime-switching features in these variables suggest that there have been only a few instances where there were extremely large shocks. These may have impacted on the observed values of the exchange rate, the interest rate, and possibly output. The results would also appear to suggest that when the volatility in one of shocks is particularly high, then the volatility in most of the other shocks is also relatively high, Figure 6. Histogram of the probability integral transforms (PITs) for interest rate with h ¼ 1, 4&8: which would imply that there may be a relatively fluid transmission between the individual shocks.
The relative performance of the respective models was subsequently evaluated with the aid of in-sample and out-of-sample statistics. While the in-sample results suggest that the two variants of the regime-switching model are largely comparable to the model that excludes these features, the out-of-sample results suggest that the regimeswitching models could be responsible for more accurate forecasts over particular horizons. For example, the regime-switching models provide superior out-of-sample statistics for inflation (and possibly interest rates) over shorter horizons, while they also provide improved forecasting results for output over selective horizons. When considering the results of the out-of-sample forecasting distributions, all of the models appear to provide predictive densities that are highly comparable.
Together, these results suggest that incorporating regime-switching features in a structural macroeconomic model for Uganda may provide interesting insights as they provide an admirable in-sample and out-of-sample description of the data. Subsequent research may consider the role of other forms of regime-switching, as this study is limited to an investigation of only a small subset of regime-switching possibilities. In addition, it would also be interesting to consider the effects of structural changes on forecasts using other methodologies, such as those described in D' Agostino et al. (2013) and Carriero et al. (2015). Notes 1. These shocks include those that are due to external economic events, such as the Global Financial Crisis, which are transmitted to the domestic economy through movements in the terms of trade, export demand and volatile financial flows. 2. Aron et al. (2015) describe a number important changes that have affected the macroeconomic data for Uganda. For example, coverage of the consumer price index (CPI) and gross domestic product (GDP) data was amended on two occasions between 2000 and 2015, while the base periods changed from 2000 to 2007, and recently to 2016. These changes were partly motivated by the need to account for the various structural transformations that had taken place in the domestic economy, where the service sector's contribution to GDP had increased, while the contribution of the agricultural sector had declined. 3. See, Christiano et al. (2005), Wouters (2003, 2007) and Adolfson et al. (2007), among others. 4. Balcilar et al. (2017) apply this methodology to South Africa, which is a relatively developed emerging market economy that is affected by shocks that are of a much smaller magnitude, and of a lower frequency. 5. Anguyo et al. (forthcoming) contains an extensive review of other studies that make use of structural macroeconomic models for LICs within Sub-Saharan Africa. 6. The monetary policy rule that is employed in the analysis is the modified Taylor-type rule that incorporates interest rate spreads, and which in turn is used to capture the central bank response to financial frictions. 7. There are very few studies that have considered regime-switching behaviour in Uganda. One example is due to Hisali (2012), who makes use of a univariate model and nominal exchange rate data to consider whether there are structural breaks in the exchange rate for Uganda. 8. According to the World Bank's classification, LICs have a GNI per capita of $1,025 or less in 2018, where the Atlas method is used to calculate a countries gross nation income (GNI) per capita.
9. See Gaban (2016), Batrancea et al. (2013), Dragan et al. (2013) and Batrancea et al. (2009) for a discussion of roots of the financial crisis and the risks that are presented by the banking sector. 10. Note that the relationship in Equation (4) implies that domestic output equals the sum of domestic consumption and net exports. 11. Thus, we use the notation ðh ¼ 1Þ to denote the first monetary regime, and the notation ðh ¼ 2Þ to denote the second monetary regime. 12. We also estimated models that were restricted to MS in the financial frictions only, to consider whether the recommendations made by the banking supervision and stability divisions of the central bank to the monetary policy divisions could be describe by regime-switching behaviour. Vlcek and Roger (2012) note that the institutional arrangements in most central banks separate the monetary policy analysis divisions from the banking supervision and stability divisions, which could be a source of potential regime-switching when the subordinate division becomes dominant. In addition, we also considered the use of another model that was restricted to the response of regimeswitching open-economy features, and found that there was no MS in any of these additional models. 13. When conducting an out-of-sample forecasting exercise, a measure of output growth is usually preferred to measures of the output gap, as it does not make any assumptions about the stochastic trend in the respective variables. 14. Additional details relating to the statistical properties, tests for stationarity, and specific transformations for each variable have been included in the online appendix (Supplementary material). 15. Extensive use of this terminology may be found in the field of engineering. In the area of structural macroeconomic models, another notable contribution can be found in Svensson and Williams (2005). 16. The algorithms that we used to solve the model are contained in the Rationality In Switching Environments (RISE) package, which is an object-oriented Matlab toolbox (Maih, 2014). 17. The stochastic term g Rb refers to the measurement error that is associated with the lending rate. 18. Additional details relating to the properties of the shocks have been included in the online appendix (Supplementary material). 19. As the model that does not include regime-switching is nested within the regimeswitching alternatives, the use of the Diebold and Mariano (1995) and West (1996), equal predictive ability tests would tend to be severely undersized and would often lead to too few rejections of the null hypothesis. 20. More detailed discussions on the applications of the PIT methodology and how it may be applied to evaluate forecast densities can be found in Diebold et al. (1998) and Wolters (201543).