Sigma Point Filters for Dynamic Nonlinear Regime Switching Models
Abstract
EconStor is a publication server for scholarly economic literature, provided as a non-commercial public service by the ZBW.
Full text
Binning, Andrew; Maih, Junior Working Paper Sigma Point Filters for Dynamic Nonlinear Regime Switching Models Working Paper, No. 10/2015 Provided in Cooperation with: Norges Bank, Oslo Suggested Citation: Binning, Andrew; Maih, Junior (2015) : Sigma Point Filters for Dynamic Nonlinear Regime Switching Models, Working Paper, No. 10/2015, ISBN 978-82-7553-867-1, Norges Bank, Oslo, https://hdl.handle.net/11250/2495864 This Version is available at: https://hdl.handle.net/10419/210077 Standard-Nutzungsbedingungen: Die Dokumente auf EconStor dürfen zu eigenen wissenschaftlichen Zwecken und zum Privatgebrauch gespeichert und kopiert werden. Sie dürfen die Dokumente nicht für öffentliche oder kommerzielle Zwecke vervielfältigen, öffentlich ausstellen, öffentlich zugänglich machen, vertreiben oder anderweitig nutzen. Sofern die Verfasser die Dokumente unter Open-Content-Lizenzen (insbesondere CC-Lizenzen) zur Verfügung gestellt haben sollten, gelten abweichend von diesen Nutzungsbedingungen die in der dort genannten Lizenz gewährten Nutzungsrechte. Terms of use: Documents in EconStor may be saved and copied for your personal and scholarly purposes. You are not to copy documents for public or commercial purposes, to exhibit the documents publicly, to make them publicly available on the internet, or to distribute or otherwise use the documents in public. If the documents have been made available under an Open Content Licence (especially Creative Commons Licences), you may exercise further usage rights as specified in the indicated licence. https://creativecommons.org/licenses/by-nc-nd/4.0/deed.no
Sigma point filters for dynamic nonlinear regime switching models NORGES BANK RESEARCH 10 | 2015 AUTHORS: ANDREW BINNING JUNIOR MAIH WORKING PAPER
NORGES BANK WORKING PAPER XX | 2014 RAPPORTNAVN 2 Working papers fra Norges Bank, fra 1992/1 til 2009/2 kan bestilles over e-post: [email protected] Fra 1999 og senere er publikasjonene tilgjengelige på www.norges-bank.no Working papers inneholder forskningsarbeider og utredninger som vanligvis ikke har fått sin endelige form. Hensikten er blant annet at forfatteren kan motta kommentarer fra kolleger og andre interesserte. Synspunkter og konklusjoner i arbeidene står for forfatternes regning. Working papers from Norges Bank, from 1992/1 to 2009/2 can be ordered by e-mail: [email protected] Working papers from 1999 onwards are available on www.norges-bank.no Norges Bank’s working papers present research projects and reports (not usually in their final form) and are intended inter alia to enable the author to benefit from the comments of colleagues and other interested parties. Views and conclusions expressed in working papers are the responsibility of the authors alone. ISSN 1502-8143 (online) ISBN 978-82-7553-867-1 (online)
Sigma Point Filters For Dynamic Nonlinear Regime Switching Models1 This Version: May 18, 2015 Andrew Binninga, Junior Maiha,b aMonetary Policy Department, Norges Bank bBI Norwegian Business School Abstract In this paper we take three well known Sigma Point Filters, namely the Unscented Kalman Filter, the Divided Difference Filter, and the Cubature Kalman Filter, and extend them to allow for a very general class of dynamic nonlinear regime switching models. Using both a Monte Carlo study and real data, we investigate the properties of our proposed filters by using a regime switching DSGE model solved using nonlinear methods. We find that the proposed filters perform well. They are both fast and reasonably accurate, and as a result they will provide practitioners with a convenient alternative to Sequential Monte Carlo methods. We also investigate the concept of observability and its implications in the context of the nonlinear filters developed and propose some heuristics. Finally, we provide in the RISE toolbox, the codes implementing these three novel filters. Keywords: Regime Switching, Higher-order Perturbation, Sigma Point Filters, Nonlinear DSGE estimation, Observability 1. Introduction Many important problems in modern macroeconomics require the estimation of parameters and unobserved variables in dynamic nonlinear (DSGE) models with switching regimes. Examples include Aruoba & Schorfheide (2013) and Bi & Traum (2014). Unfortunately the existing procedures for the filtering of such models are cumbersome, compelling researchers to take shortcuts such as linearization, constant parameters and Kalman Filtering for example. In this paper we propose alternative filtering procedures that are fast and reasonably accurate. In particular we take three well known Sigma Point Filters, namely the Unscented Email addresses: [email protected] (Andrew Binning), [email protected] (Junior Maih) 1This Working Paper should not be reported as representing the views of Norges Bank. The views expressed are those of the authors and do not necessarily reflect those of Norges Bank.
Kalman Filter (UKF) by Julier & Uhlmann (1997), the Divided Difference Filter (DDF) by Nørgaard et al. (2000), and the Cubature Kalman Filter (CKF) by Arasaratnam & Haykin (2009), and extend them to allow for dynamic nonlinear regime switching models. As a second contribution we investigate observability, the ability to recover the unobserved variables given a finite sequence of observations, in nonlinear state space models. Dissatisfied with existing methods of investigating observability, we develop our own heuristics. Our decision to revive and extend Sigma Point Filters to dynamic nonlinear regime switching models has been motivated by three key observations. First, it is common practice to build nonlinear models and linearize them even when the underlying problem is inherently nonlinear. This strategy has benefitted from the array of fast and efficient tools available for solving, estimating, decomposing and interpreting these models and their results (see Dave & DeJong,2010, for a good overview). Although convenient, there are many critical questions linear specifications cannot handle. Our economic theories and many problems posed by policy makers and practitioners are fundamentally nonlinear. Linearized models are unable to capture occasionally binding constraints such as the collateral constraints considered in Benigno et al. (2013) and asymmetries such as downwardly nominal wage rigidities as modelled by Kim & Ruge-Murcia (2011). Their certainty equivalence renders them useless for problems that require some consideration of risk, such as the evaluation of optimal policy in distorted economies (Schmitt-Grohe & Uribe,2004), or the calculation of bond term premia in consumption-based asset pricing models of production economies (Rudebusch & Swanson,2012). Second, constant parameter models are often used to describe data that exhibit structural breaks and other properties that are inconsistent with a single data generating distribution, or they are used in combination with shortened samples to avoid issues associated with time varying parameters. The assumption of constant parameters sets policy behavior once and for all, and interprets the data as a sequence of drawings from the same distribution. However the political and economic history of nations is characterized by change. Political cycles induced by changes in government and central bank governance lead to changes in fiscal, monetary and macro-prudential policy, and the instruments used to conduct these policies. These changes are reflected in the data and have implications for the properties of business cycles and the underlying data generating process. Lucas (1976) emphasizes the need to take changes in deep policy parameters into account when modelling expectations, using models to analyze history and produce forecasts. The modelling of regime switches provides us with tools for incorporating the type of policy changes observed over history into structural models. This in turn allows more data to be used, data that may otherwise have been discarded due to structural breaks at odds with a constant parameter interpretation of history. Ultimately more data leads to sharper estimates of the parameters that do not switch and a longer continuous interpretation of history. Other features of the data like nonlinearities and asymmetries in the business cycle (Kim & Nelson,2001), crises (Foerster, 2011), occasionally binding constraints (Aruoba & Schorfheide,2013), heteroscedasticity (Liu & Mumtaz,2011), changes in behavioral parameters (Melino & Yang,2003), and the possibility of recurrent regimes (Sims & Zha,2006) can all be recast and interpreted in 2
terms of a regime switching framework. Recent advances in perturbation solution methods by Foerster et al. (2014) and Maih (2015) provide tools for finding nonlinear solutions to nonlinear regime switching models with rational expectations. Third, the majority of estimation studies in economics using nonlinear state space models, especially nonlinear DSGE models, have been conducted using Sequential Monte Carlo (SMC) methods despite the fact that alternative filters exist that are not only reasonably accurate but are also computationally cheaper. Examples of econometric studies conducted using SMC methods include Fern´andez-Villaverde & Rubio-Ram´ırez (2007), Amisano & Tristani (2010), Flury & Shephard (2011), Fernandez-Villaverde et al. (2015) and Doh (2011). SMC methods also known as Particle Filters are non-parametric and use stochastic simulation to track the entire distribution implied by the state space. As a result they are costly, requiring many particles to get good estimates, and they suffer from sample degeneracy and impoverishment. SMC filters are asymptotically exact which motivates an exact treatment of regime switching in this framework, and would require tracking all paths and nodes for the histories of the regimes. Such a treatment would prove infeasible, the number of paths and nodes that need to be tracked would explode with time which would be compounded by the need to use a large number of particles for the simulation of each path. Sigma Point Filters, although largely dismissed by Fern´andez-Villaverde & Rubio-Ram´ırez (2007) in the early nonlinear DSGE estimation literature, have proven to be a competitive alternative to SMC methods in terms of accuracy. Andreasen (2013) shows with a simple DSGE model solved using both a second and third order perturbation method that the Divided Difference Filter provides more accurate results than the Particle Filter using 500,000 particles. Kollmann (2015) is also able to beat a Particle Filter that uses 500,000 particles with a deterministic Kalman Filter adapted for second order approximations in pruned state space (the KalmanQ Filter).2In contrast to SMC methods, Sigma Point Filters are parametric, deterministic and approximate filters, and they assume that the states are reasonably well approximated by a Gaussian distribution. These assumptions make the filters computationally cheaper and much faster when compared with SMC methods because the nonlinear functions only need to be evaluated at a small number of well chosen points which are used to track the mean and the covariance of the states. We depart from the constant parameter Sigma Point Filtering literature by extending Sigma Point Filters to include nonlinear regime switching state space models. Keeping with the approximate and deterministic nature of these filters, it seems appropriate to approximate the regime switching state space using the collapsing approach popularized by Kim & Nelson (1999). The addition of regime switching should improve the ability of Sigma Points Filters to approximate the distribution of the unobserved states. The Sigma Point Filtering assumption that state variables are well approximated by a Gaussian distribution is likely to be violated in some cases. However, we know that any distribution can be well approximated by a 2While the KalmanQ Filter proposed by Kollmann (2015) is not a Sigma Point Filter, the results from the Monte Carlo experiment do cast doubt on the convergence and accuracy of the Particle Filter even when using small models. 3
Gaussian mixture distribution. Approximating the regime dependent distribution of the states by a Gaussian distribution in the regime switching Sigma Points Filter means the expected distribution of the states will follow a Gaussian mixture distribution, and should in theory be capable of approximating any distribution. To test the accuracy and understand the properties of these filters we perform a Monte Carlo study using the Fernandez-Villaverde et al. (2015) DSGE model adapted to include regime switching and solved using a nonlinear solution method. This laboratory exercise is necessary to determine the accuracy and behavior of the filters. We also test the filters by applying them to real data. Because we use the same data and model as Fernandez- Villaverde et al. (2015) we are able to compare our results with their results which gives us further confirmation and confidence that our procedures are reasonable. Our proposed filters should provide a convenient alternative to SMC methods. Relatedly, reliable and accurate filters may not be enough to guarantee good observability of the unobserved state variables. Weak and/or ambiguous relationships between observed and unobserved variables in a nonlinear state space model may not lead to the unique or accurate recovery of the unobserved variables even in the presence of an exact filter. Observability, originally due to Kalman (1960) in the linear-Gaussian case, has received some coverage in the linearized DSGE literature where it is a requirement for parameter identification (see Komunjer & Ng,2011;Fukac,2010). It has not, however, received any coverage in the nonlinear DSGE literature. Observability has important implications for choosing the set of observed variables, determining which unobserved variables are estimable, and is also a key component in parameter identification. Measuring observability is relatively trivial with linear state space models, but is more complicated with nonlinear state space models. Kalman (1960) proposed a simple rank test for linear state space models which determined whether the unobserved initial conditions could be recovered given a sequence of observations in a finite period of time. This simple test also illustrates the global nature of observability in linear state space models. These rank tests have been extended to nonlinear models by calculating the Jacobian of the initial unobserved states with respect to the sequence of observed variables (see Muske & Edgar, 1997, for example). Such an approach shows that in the nonlinear case observability is a local phenomenon. Thinking of observability in terms of a rank condition treats it as a binary concept; there either is observability or there is not. We interpret observability as a nuanced concept with varying degrees and strengths of observability for different variables at different points in the state space. We investigate observability within our proposed filtering framework because ultimately we would like to know the practical implications of our filtering and modelling choices. This may however lead to some degradation of the observability present in the original state space model because our filters are approximations, but determining the observability of the state space independently of the filter is somewhat academic. The relative speed of our Sigma Point Filters allows us to develop simulation based heuristics for observability. As a further contribution, we develop codes for implementing the filters. These codes are available in the RISE toolbox. 4
The paper proceeds as follows: in Section 2we discuss Bayesian Filters for dynamic nonlinear regime switching models and set up our Sigma Points Filter. In Section 3we introduced observability and discuss its implications for nonlinear state space models. We validate the filters using Monte Carlo experiments and with actual data in Section 4before examining the observability properties of our test model. We conclude in Section 5. 2. Bayesian Filtering for Dynamic Nonlinear Regime Switching Models In this section we develop Sigma Point Filters to estimate the unobserved states for a general class of dynamic nonlinear regime switching models. We begin by setting up the state space for a dynamic nonlinear regime switching model. This is followed by an overview of the Bayesian Filtering problem and a discussion of the relative merits of Sigma Point Filters. Then we introduce the details of our proposed Sigma Point Filters for dynamic nonlinear regime switching models. Finally we discuss some of the key ingredients for successful Sigma Point Filtering. 2.1. The State Space Representation of Dynamic Nonlinear Regime Switching Models We consider a very general class of nonlinear state space models with regime switching. Such a setup is broad enough to capture linear, constant parameter, rational expectations and backward-looking models as special cases. We characterize history as made up of possibly different regimes, each with its distinctive properties: Et h X rt+1=1 prt,rt+1 (It)frtxt+1 (rt+1), xt(rt), xt−1, θrt, θrt+1 , ηt= 0 (1) where Etis the expectations operator, frtis a known and possibly nonlinear function, rt represents the switching process with hdifferent regimes, θrtis the parameters in regime rt, θrt+1 is the parameters next period, prt,rt+1 (It) is the transition probability for going from regime rtto regime rt+1, which depends on It, the information at time t,xtare the date t endogenous variables and ηtare exogenous disturbances. Equation (1) is flexible enough to describe a range of models. The functional form of frtdetermines whether the model is linear or nonlinear, if the t+ 1 expected variables are absent then the model is backward-looking, and if the number of regimes his equal to 1, then the model has constant parameters. We require the solution of the model in equation (1) to exhibit the Markov property in order to write it in the form of a state space model. That is, we need to be able to write today’s state variables as a function of only yesterday’s state variables and the shocks. If equation (1) is a rational expectations model we need to solve it using a method that preserves the Markov property. If the model is backward looking with multiple lags we can use the companion form to preserve the Markov property. To complete the transition block of the regime switching state space model, we need to define the transition matrix for the 5
discrete states. This gives us the following transition equations: xt=Trt(xt−1, ηt), ηt∼N(0, I) (2) prt,rt+1 =Qrt,rt+1 (It), rt= 1,2, ..., h (3) where Trtis a potentially nonlinear but known function and the shocks are assumed to be i.i.d. Normally distributed with mean zero and covariance equal to the identity matrix. We let Qrt,rt+1 (It) denote the h×htransition matrix. Equations (2) and (3) characterize the transition equations. Equation (2) is similar to the autoregressive transition equations we are familiar with in constant parameter state space models. Equation (3) is added to the transition block because we are in a regime switching world and we need to describe how the transition probabilities are generated. The nonlinear regime switching state space model also consists of a measurement equation: yt=Ztxt+εt, εt∼N(0, Hrt) (4) where ytis the vector of date tobserved variables, Ztis the identity matrix with rows potentially missing and εtis a vector of measurement errors with covariance Hrt. Note that we assume a linear measurement block for simplicity. It should always be possible to write any nonlinear model in this form by adding any nonlinear observation equations to the transition block. Given the measurement and transition equations we can compute the conditional probabilities: p(xt|xt−1), p(yt|xt), and p(yt|xt−1). The conditional probability p(xt|xt−1) can be determined directly from the transition block of the state space model, while p(yt|xt), and p(yt|xt−1) must be estimated using the state space model. This can be done using Bayesian Filtering methods which we discuss in the next section. 2.2. Bayesian Filtering The filtering problem is one of computing the conditional densities p(xt|y1:t−1) and p(xt|y1:t) given a prior distribution p(x0) on x0, a state space model and a sequence of measurements y1:t. These densities can be computed efficiently using recursive Bayesian estimation which makes use of the Chapman-Kolmogorov equation for prediction and Bayes Rule for updating. We present a very generalized Bayesian Filtering algorithm based on Theorem 4.1 from S¨arkk¨a (2013) in Algorithm 1below. The proofs for this algorithm are presented in S¨arkk¨a (2013). Although elegant in its simplicity, the generic Bayesian Filtering algorithm can be difficult to implement in practice. It involves the computation of high dimensional integrals that are intractable in most cases. The exception being linear-Gaussian models with a single regime, in which case analytical forms do exist allowing us to derive the celebrated Kalman Filter. If the problem demands a nonlinear non-Gaussian model we can no longer use the Kalman Filter. As a consequence we have to employ other strategies for approximating and evaluating these integrals. The literature has dealt with this problem in three ways: •Linearization of the state space model (the Extended Kalman Filter) 6
Transform approximates the mean and the covariance using 2nX+ 1 Sigma Points, these points are chosen as follows: X[0] =µrt X[i]=µrt+p(nX+λ)Σrtifor i= 1, . . . , nX X[i]=µrt−p(nX+λ)Σrti−nX for i=nX+ 1,...,2nX where nX+λ= 3, and the subscripts for the brackets indicate that we take the ith or the (i−n)th column of the square root of the scale matrix. The weights for the Sigma Points are chosen such that w[0] =λ nX+λ, w[i]=1 2(nX+λ)for i= 1,...,2nX We are able to calculate the expected or forecasted mean and covariance by passing the Sigma Points through the nonlinear function and weighting them accordingly ˆµrt= 2nX X i=0 w[i]TrtX[i] ˆ Σrt= 2nX X i=0 w[i]TrtX[i]−ˆµrtTrtX[i]−ˆµrt0 Switching Divided Difference Filter: Stirling’s Interpolation The Divided Difference Filter uses Stirling’s Interpolation to choose the Sigma Points. Stirling’s interpolation is a formula for polynomial approximation over an interval, its derivation is very similar to a standard Taylor series approximation where the derivatives are replaced by the central divided differences. The 2nX+ 1 Sigma Points chosen according to Stirlings’s Interpolation: X[0] =µrt X[i]=µrt+δsifor i= 1, . . . , nX X[i]=µrt−δsi−nXfor i=nX+ 1,...,2nX where δ=√3 for a Gaussian distribution and siis the ith column of the square root of the covariance of the unobserved state variables. The associated weights are set as follows w[0] m=δ2−nX δ, w[i] m=1 2δ2, w[j] c,1=1 2δ, w[j] c,2=√δ2−1 2δ2for j= 1, . . . , nX where the Stirling interpolation has both first and second order terms. The expected values 13
or forecasts are calculated as follows ˆµrt= 2nX X i=0 w[i] mTrtX[i] S(1) j=w[j] c,1Trt(X[j])−Trt(X[nX+j])for j= 1, . . . , nX S(2) j=w[j] c,2Trt(X[j]) + Trt(X[nX+j])−2Trt(X[0]) ˆ Srt=Φ S(1), S(2) where Φ(·) is a matrix triangularization, like the Householder transformation. Switching Cubature Kalman Filter: Spherical Radial Cubature Rule The Cubature Kalman Filter (CKF) uses the Spherical Radial Cubature Rule to choose the Sigma Points. As Arasaratnam & Haykin (2009) note, the key approximation taken to develop the CKF is that the predictive density and the filter likelihood density are both Gaussian which leads to a Gaussian posterior density. The 2nXSigma Points are determined according to X[i]=µrt+pnXΣrtifor i= 1, . . . , nX X[i]=µrt−pnXΣrti−nX for i=nX+ 1,...,2nX with the weights for the Sigma Points given by w[i]=1 2nX for i= 1,...,2nX The expected or forecasted unobserved variables are calculated according to the following numerical integrations ˆµrt= 2nX X i=1 w[i]TrtX[i] ˆ Σrt= 2nX X i=1 w[i]TrtX[i]−ˆµrtTrtX[i]−ˆµrt0 Correcting State Covariance Matrices: The approximate nature of the filters means that the estimated covariances for the unobserved variables are not always well behaved. If the covariance matrices are not positive definite then the accuracy of the filter may deteriorate. To circumvent this problem we check each covariance matrix for positive definiteness, if the covariance matrix is not positive definite we replace it with the nearest matrix that is positive definite. We find this greatly improves the accuracy of our Sigma Point Filters. 14
3. Observability Obtaining accurate estimates of the unobserved state variables in a nonlinear state space model will not always be possible, even in the presence of an exact nonlinear filter. This is because there may be multiple combinations of the unobserved variables that are compatible with the same realization of the observed variables. The ability to recover the unobserved states given the observed variables in a finite period of time is known as observability. Poor observability is due to weak and/or ambiguous relationships between the observed and unobserved variables. Assessing a state space model’s observability has important implications for the estimability of unobserved variables, the choice of observed variables, and for parameter identification in the case of parameter estimation. Rank tests have been proposed for measuring observability in linear state space models (see Kalman,1960). These tests assess the ability to recover the initial conditions of the unobserved variables after observing a sequence of measurements. They illustrate that observability is a global property of linear state space models with one regime. Similar tests have been proposed for nonlinear models based on the Jacobian of the observed variables with respect to the initial conditions of the unobserved variables. However, such tests are only local and treat observability as a binary concept. Observability Gramian matrices have also been proposed as a means for evaluating observability (see Kailath,1980). Unsatisfied with existing metrics for observability in nonlinear state space models, we have developed our own heuristics for this purpose. More specifically we conduct a Monte Carlo exercise, constructing artificial data from many different shock draws and estimating the corresponding recovered series for the unobserved variables using one of our Sigma Point Filters. We then subtract the actual data from the estimates of the unobserved recovered data and divide the result by the standard deviation of the simulated data. We plot the 50th and 95th percentiles of the normalized data. We interpret narrow and symmetrically centered 95th percentiles as an indication of good or high observability. Conversely we interpret wide and/or severely asymmetric 95th percentiles as an indication of poor observability. Much of the literature has focused on observability in nonlinear models purely in terms of the general nonlinear state space, independent of any specific filter. We have framed the observability problem in terms of the filters developed in this paper. Adopting such an approach could, however, lead to a reduction in the observability of the model due to the approximations made in the filter. But it will help us understand how the model/filter combination performs, and since we have no other methods for filtering nonlinear regime switching models, a test that is independent of the filtering procedure would be of little practical significance. 4. Validating the Filters We test the accuracy of the filters and examine their properties through a Monte Carlo study, and by using actual data in a model calibration exercise. While the setup is general enough to encompass a range of dynamic nonlinear regime switching models, we conduct our experiments using a nonlinear regime switching DSGE model solved using higher order 15
perturbation methods. Our model choice is motivated by the linearized constant parameter DSGE model’s emergence as the dominant paradigm in structural macroeconometrics and macroeconomic policy modeling. By demonstrating these filters using a regime switching DSGE model solved using nonlinear methods, we are able to illustrate the versatility of these filters to a large and growing audience already familiar with linearized DSGE models. We also hope these results will be of interest to practitioners who use other types of nonlinear models. In this section we begin by giving a brief description of the model and its calibration before detailing the Monte Carlo experiments we perform and outlining the steps taken when filtering using actual data. 4.1. Model and Calibration We perform our experiments using the model from Fernandez-Villaverde et al. (2015). We have chosen this model because it is a medium-sized DSGE model, it is relatively standard, and includes time-varying parameters through parameter drift and stochastic volatility. Furthermore, Fernandez-Villaverde et al. (2015) solve this model using nonlinear methods and estimate it using a nonlinear filter, demonstrating that this model is realistic or flexible enough to be taken to the data. For the purposes of this paper, we modify the model replacing the parameter drift with regime switching parameters and turning off the stochastic volatility in the shock processes. The model consists of a household sector, firms and a monetary authority. Households derive utility from consumption relative to the habit stock and leisure. They supply differentiated labor to a monopolistically competitive union and choose wages subject to a Calvo wage setting friction. Firms produce differentiated output using capital, labor and a neutral technology process, and set prices subject to a Calvo pricing friction. The capital stock evolves in the usual way except for the inclusion of embodied technology in new investment goods. The model is closed by imposing a Taylor type rule on the monetary authority. Fernandez-Villaverde et al. (2015) use this model to investigate the role of monetary policy in the great moderation. This motivates them to add parameter drift to the inflation response coefficient in the Taylor rule and stochastic volatility in the shock processes. This in turn motivates the use of a nonlinear solution method and a nonlinear filtering procedure. In particular they solve the model using a second order Taylor series approximation and they estimate the model using a Particle Filter. We modify their model by replacing the parameter drift in the inflation response in the Taylor rule, with regime switching parameters in both the inflation and the output response as follows: Rt R=Rt−1 RγR Πt ΠγΠ(rt)˜yd t ˜yd t−1 exp(ZZ t)γy(rt)!1−γR exp(σMεM t) where Rtis the gross nominal interest rate, Πtis the gross inflation rate, ˜ytis the detrended level of output, ZZ tis the stochastic growth rate and εM tis the monetary policy shock. γΠ(rt) and γY(rt) are now regime dependent. The rest of the model equations are presented in Appendix A, while Fernandez-Villaverde et al. (2015) provide a full derivation of the benchmark 16
version of their model at http://economics.sas.upenn.edu/~jesusfv/benchmark_DSGE. pdf. We adopt the Fernandez-Villaverde et al. (2015) parameterization except where we turn off the stochastic volatility processes and replace the parameter drift with switching in the Taylor rule. We also set the standard deviation of all the structural shocks to 0.01. The regime dependent parameters in the Taylor rule are chosen to allow for one monetary policy regime with a strong response to inflation and a weak response to output and a second regime with a weaker response to inflation and a stronger response to output. The Taylor rule calibration can be found in table 2below and table B.9 presents the calibration of the other parameters and can be found in Appendix B. Table 2: Regime Specific Parameters Parameters Regime 1 Regime 2 γπ1.7 0.7 γy0.5 1.0 The transition probabilities are chosen to ensure that the monetary policy regimes are reasonably persistent. They can be found in table 3below. Table 3: Transition Probabilities Parameters Value p1|20.1 p2|10.1 We follow Fernandez-Villaverde et al. (2015) and solve the model using a second order Taylor series approximation, however we use the procedures outlined in Maih (2015) which allow for nonlinear regime switching rational expectations models. We do not prune the solution. We select the same observable variables that Fernandez-Villaverde et al. (2015) use, namely per capita GDP growth, investment price inflation, nominal interest rates, consumer price inflation and real wage growth. In the section using actual data, we construct these series using the same recipe outlined in Fernandez-Villaverde et al. (2015) so that they match their series as closely as possible. 4.2. A Monte Carlo Study Our Monte Carlo experiments proceed as follows: we take 500 randomly drawn shock sequences and simulate artificial data for 1000 periods using the model, we retain all the simulated data for evaluation purposes. For each of the 500 sets of artificial data we take the same observable variables used by Fernandez-Villaverde et al. (2015) and use our filters to estimate the unobserved variables. We then compare the estimates of the recovered variables with the actual (simulated) data. For each draw we calculate root mean squared errors both 17
for the entire 1000 period sample and for just the second half of the sample. By calculating the RMSEs on the second half of the sample we are able to investigate the properties of the filters once they have converged. We also present some graphs of the recovered unobserved variables from the filters against the actual data, to give the reader a feel for how the RMSEs translate into particular estimates. The expected recovered series are defined as follows: xt|t=Ph rt=1 p(rt)xt|t(rt), where the root mean squared errors are given by: RMSE =PN i=1 rPT t=1(xi,t−xi,t|t)2 T! N The average RMSEs for all 500 draws in the Monte Carlo experiment are presented in table 4below. We also present the relative RMSEs in table 5. The relative RMSEs are calculated by dividing the RMSEs for each variable through by the lowest RMSE for that variable, so that the best performing filter gets a 1, and all other filters have a number larger than 1. The final row labeled “average” refers to the average RMSE for all the variables presented in the table and gives us an indication for the overall performance of the filters. Table 4: RMSES Variables 1:1000 501:1000 SDDF SUKF SCKF SDDF SUKF SCKF ˜ct0.007397 0.007872 0.007351 0.001292 0.001558 0.001427 ˜ kt0.144305 0.127421 0.137709 0.052363 0.064932 0.057483 ˜xt0.006540 0.005537 0.006295 0.002051 0.002694 0.002325 ˜yt0.006884 0.006073 0.006883 0.001423 0.001893 0.001672 ˜wt0.002434 0.002110 0.002915 0.001281 0.001318 0.001552 νt0.000913 0.000843 0.000902 0.000340 0.000339 0.000364 νw t0.001108 0.001014 0.001038 0.000404 0.000396 0.000456 ˜ Qt0.005630 0.004929 0.006918 0.001995 0.002279 0.002777 dt0.006233 0.005450 0.006446 0.003373 0.003421 0.004941 ϕt0.041518 0.034820 0.041174 0.011251 0.014895 0.012997 Average 0.022296 0.019607 0.021763 0.007577 0.009372 0.008599 Average RMSEs for 500 simulations using randomly chosen shocks for 1000 periods. When we look at the RMSEs for the entire 1000 period sample, we see the SUKF dominates with the lowest average RMSE and the lowest RMSEs for all the reported variables except consumption. The SCKF has the second lowest average RMSE and for most variables it has the second lowest RMSEs. The SDDF comes in third place for the average RMSE and for most individual RMSEs as well. When we focus attention on the second half of the sample (501:1000) we notice that the SDDF has the lowest average RMSE and it has the lowest RMSEs for all variables excluding the price and wage dispersion terms. The SCKF 18
Table 5: Relative RMSES Variables 1:1000 501:1000 SDDF SUKF SCKF SDDF SUKF SCKF ˜ct1.006231 1.070867 1.000000 1.000000 1.205783 1.104303 ˜ kt1.132505 1.000000 1.080741 1.000000 1.240036 1.097782 ˜xt1.181185 1.000000 1.136984 1.000000 1.313421 1.133556 ˜yt1.133471 1.000000 1.133222 1.000000 1.330830 1.175401 ˜wt1.153684 1.000000 1.381660 1.000000 1.028467 1.210968 νt1.082905 1.000000 1.070343 1.005642 1.000000 1.076418 νw t1.092675 1.000000 1.023498 1.020134 1.000000 1.151244 ˜ Qt1.142062 1.000000 1.403456 1.000000 1.142131 1.391700 dt1.143689 1.000000 1.182752 1.000000 1.014220 1.464875 ϕt1.192362 1.000000 1.182502 1.000000 1.323908 1.155156 Average 1.137156 1.000000 1.109974 1.000000 1.236900 1.134871 Average Relative RMSEs for 500 simulations using randomly chosen shocks for 1000 periods. has the second lowest average RMSE and comes in second place for most of the individual RMSEs. The SUKF comes in third place for the average RMSE and for a lot of the individual RMSEs. So the overall picture points to the SUKF converging the fastest, but once the filters have converged the SDDF performs the best. However, it should be noted that the relative differences between the filters are quite small and we would be hesitant to generalize our results to all model types, let alone different parameterizations of our benchmark model. The similarity of the results should not be a surprise given the Sigma Points for each filter are chosen in a very similar fashion. From our Monte Carlo study we would conclude that all our Sigma Point Filters seem to do a reasonably good job. We present plots for the first 300 periods for a subset of the unobserved variables for one of the 500 draws below. We do this to give the reader a visual although not necessarily typical sense of how the filters perform and how the RMSEs translate into tracking results. Figure 1illustrates that it can take some time for the effects of the initial condition to die out. These effects are especially noticeable for capital, because capital is extremely persistent. If a mistake is made in the initial condition for capital, it can take a long time for the filter to correct. Flury & Shephard (2011) make the same observation about capital when using the Particle Filter. The slow convergence of the estimated capital stock is also reflected in the RMSEs for capital. In figure 2we plot the probabilities for being in the high inflation response monetary policy regime. In the case of the simulated data, we always know in which regime we are, so that the probabilities are always zero or one. In the case of the recovered probabilities, we do not know in which regime we are, so we must estimate the probability of being in a given regime, and hence these results fall between zero or one. Again it takes a little bit of time for the filters to converge, but once they have converged, 19
Figure 1: Simulated & Estimated Data 0 100 200 300 0.26 0.28 0.3 0.32 Labor 0 100 200 300 0.35 0.4 0.45 Output 0 100 200 300 2 2.5 3 3.5 Capital 0 100 200 300 0.35 0.4 0.45 Consumption 0 100 200 300 0.8 0.9 1 Labor Preferences Actual SDDF SUKF SCKF 0 100 200 300 0.95 1 1.05 Consumption Preferences 0 100 200 300 1 1.01 1.02 Wage Dispersion 0 100 200 300 1 1.01 1.02 1.03 Price Dispersion 20
Figure 2: Monetary Policy Regimes 0 50 100 150 200 0 0.2 0.4 0.6 0.8 1 Actual SDDF SUKF SCKF they do a very good job at estimating the true probabilities. The results from the Monte Carlo study give us confidence that our proposed filters are reasonably accurate and behaving as we would expect them to. 4.3. Taking the Model to Real Data The Monte Carlo experiments have demonstrated that our proposed Sigma Point Filters perform well in the laboratory when the true data generating process is known. Yet economic theories require field testing, models need to be taken to the data to estimate the unobserved state variables and parameters, we need to assess their fit and ultimately to validate them. We field test the Switching Unscented Kalman Filter by taking the Fernandez-Villaverde et al. (2015) model with regime switching in the Taylor rule and the stochastic volatility turned off, to the data. We use the SUKF because based on our testing it appears to converge faster than our other Sigma Point Filters. However the overall results from our tests indicate that any of the filters could have been used with little difference between the results.3We retain the parameterization from Fernandez-Villaverde et al. (2015) but calibrate the transition probabilities in the Markov chain and the switching parameters in the Taylor rule, and include some measurement error on GDP growth and CPI inflation. For the purposes of this paper, we want to test how well the filter and model fit the data with 3These results are available upon request. 21
very little modification to the parameterization from Fernandez-Villaverde et al. (2015). We leave estimation for future investigation. Our calibrated switching parameters are presented in tables 6,7and 8below. Table 6: Regime Specific Parameters Parameters Regime 1 Regime 2 γπ1.9838 0.6642 γy0.3863 0.7392 Table 7: Transition Probabilities Parameters Value p1|20.2525 p2|10.0955 Table 8: Measurement Errors Parameters Description Value uΠ tInflation measurement error 0.075 u∆ log(Y) tGDP growth measurement error 0.075 We compare our results with Fernandez-Villaverde et al. (2015) who use drifting parameters to evaluate monetary policy changes over history in the context of trying to explain the great moderation. Figure 3below shows the parameter drift on the inflation coefficient in the Taylor rule from the estimation results in Fernandez-Villaverde et al. (2015). Figure 4shows the expected probability of being in the high inflation response monetary policy regime. The profiles in both figures are very similar, both profiles show there is evidence of a monetary policy regime with a stronger response to inflation in the late 1960s and the early to mid 1980s. We take the similarity of these plots as evidence that SUKF is producing sensible results in the field. 22
Appendix A. Fernandez Villaverde, Guerron Quintana and Rubio Ramirez (2015) dt˜ct−h˜ct−1 zt−1 zt−1 −hβEdt+1 ˜ct+1 zt+1 zt−h˜ct−1 =˜ λt ˜ λt=βEt˜ λt+1 zt zt+1 Rt Πt+1 ˜rt=a0[ut] ˜qt=βEt(˜ λt+1 ˜ λt zt zt+1 µt µt+1 ((1 −δ) ˜qt+1 + ˜rt+1ut+1 −a(ut+1))) 1 = ˜qt1−S˜xt ˜xt−1 zt zt−1−S0˜xt ˜xt−1 zt zt−1˜xt ˜xt−1 zt zt−1 +βEt˜qt+1 ˜ λt+1 ˜ λt zt zt+1 S0˜xt+1 ˜xt+1 zt+1 zt˜xt+1 ˜xt+1 zt+1 zt2 ft=η−1 η( ˜w∗ t)1−η˜ λt( ˜wt)ηld t+βθwEtΠχw t Πt+1 1−η˜w∗ t+1 ˜w∗ t zt+1 ztη−1 ft+1 ft=ψdtϕt(Π∗w t)−η(1+γ)ld t1+γ+βθwEtΠχw t Πt+1 −η(1+γ)˜w∗ t+1 ˜w∗ t zt+1 ztη(1+γ) ft+1 g1 t=˜ λtmct˜yd t+βθpEtΠχ t Πt+1 −ε g1 t+1 g2 t=˜ λtΠ∗ t˜yd t+βθpEtΠχ t Πt+1 1−εΠ∗ t Π∗ t+1 g2 t+1 εg1 t= (ε−1) g2 t ut˜ kt−1 ld t =α 1−α ˜wt ˜rt zt zt−1 µt µt−1 mct=1 1−α1−α1 αα ˜rα t 1 = θwΠχw t−1 Πt1−η˜wt−1 ˜wt zt−1 zt1−η + (1 −θw) (Π∗w t)1−η 29
1 = θpΠχ t−1 Πt1−ε + (1 −θp) Π∗1−ε t Rt R=Rt−1 RγR Πt ΠγΠ(rt)˜yd t ˜yd t−1 exp(ZZ t)γy(rt)!1−γR exp(σMεM t) ˜yd t= ˜ct+ ˜xt+zt−1 zt µt−1 µt a[ut]˜ kt−1 ˜yd t= At At−1 zt−1 ztut˜ kt−1αld t1−α υp t lt=υw tld t υp t=θpΠχ t−1 Πt−ε υp t−1+ (1 −θp) Π∗−ε t υw t=θw˜wt−1 ˜wt zt−1 zt Πχw t−1 Πt−η υw t−1+ (1 −θw) (Π∗w t)−η ˜ kt zt zt−1 µt µt−1−(1 −δ)˜ kt−1−zt zt−1 µt µt−11−S˜xt ˜xt−1 zt zt−1˜xt= 0. 30
Appendix B. Variables and Parameters Symbol Description dtConsumption Preferences ˜ctDetrended Consumption ztNeutral Technology ˜ λtDetrended Marginal Utility of Consumption RtNominal Gross Interest Rate ΠtGross Rate of Inflation ˜rtDetrended Rental Rate on Capital utVariable Capital Utilization ˜qtDetrended Tobin’s Q µtInvestment Specific Technology ˜xtDetrended Investment ftCalvo Pricing Term ˜w∗ tDetrended Real Wage of Wagesetters ˜wtDetrended Real Wage ld tLabor Demand ϕtLabor Preferences g1 tWage Calvo Term 1 ˜yd tDetrended Output (Demand) mctReal Marginal Cost Π∗ tRelative Price of Pricesetters g2 tWage Calvo Term 2 ˜ ktDetrended Capital Stock νp tPrice Dispersion νw tWage Dispersion 31
Table B.9: Parameter Values Parameters Description Value βTime Preference 0.99 hHabit Formation 0.9 ϑDisutilty of Labor Scaling 1.17 δDepreciation Rate 0.025 αCaptial’s Share of Income 0.21 κWeight on Investment Adjustment Costs 9.5 Intermediates Elasticity of Substitution 10 ηLabor’s Elasticity of Substitution 10 φ2Weight on Adjustment Costs for Capital Utilization 0.001 γrInterest Rate Smoothing 0.7855 χwWage Indexing 0.6340 χWage Indexing 0.6186 θwShare of Constrained Wage Setters 0.6869 θpShare of Constrained Price Setters 0.8139 ρdPersistence Consumption Preferences 0.1182 ρϕPersistence Labor Preferences 0.9331 λaGrowth Rate Neutral Technology 0.0028 λµGrowth Rate Embodied Technology 0.0034 σµStandard Deviation Embodied Technology Shock 0.01 σaStandard Deviation Neutral Technology Shock 0.01 σdStandard Deviation Consumption Preference Shock 0.01 σϕStandard Deviation Labor Preference 0.01 σmStandard Deviation Monetary Policy Shock 0.01 32
References Amisano, G. & Tristani, O. (2010). Euro area inflation persistence in an estimated nonlinear DSGE model. Journal of Economic Dynamics and Control,34(10), 1837–1858. URL http: //ideas.repec.org/a/eee/dyncon/v34y2010i10p1837-1858.html. Andreasen, M. M. (2013). Non-linear dsge models and the central difference kalman filter. Journal of Applied Econometrics,28 (6), 929–955. URL http://dx.doi.org/10.1002/ jae.2282. Arasaratnam, I. & Haykin, S. (2009). Cubature kalman filters. Automatic Control, IEEE Transactions on,54 (6), 1254–1269. Aruoba, S. B. & Schorfheide, F. (2013). Macroeconomic dynamics near the ZLB: a tale of two equilibria. Tech. rep. Benigno, G., Chen, H., Otrok, C., Rebucci, A., & Young, E. R. (2013). Financial crises and macro-prudential policies. Journal of International Economics,89(2), 453–470. URL http://ideas.repec.org/a/eee/inecon/v89y2013i2p453-470.html. Bi, H. & Traum, N. (2014). Estimating Fiscal Limits: The Case Of Greece. Journal of Applied Econometrics,29 (7), 1053–1072. URL http://ideas.repec.org/a/wly/japmet/ v29y2014i7p1053-1072.html. Dave, C. & DeJong, D. (2010). Structural Macroeconometrics. Princeton University Press. URL http://books.google.no/books?id=73qn3CSPdqUC. Doh, T. (2011). Yield curve in an estimated nonlinear macro model. Journal of Economic Dynamics and Control,35 (8), 1229–1244. URL http://ideas.repec.org/a/eee/dyncon/ v35y2011i8p1229-1244.html. Fernandez-Villaverde, J., Guerrn-Quintana, P. A., & Rubio-Ramrez, J. (2015). Estimating Dynamic Equilibrium Models with Stochastic Volatility. Journal of Econometrics,185 (1), 216–229. URL doi:10.1016/j.jeconom.2014.08.010. Fern´andez-Villaverde, J. & Rubio-Ram´ırez, J. F. (2007). Estimating macroeconomic models: A likelihood approach. The Review of Economic Studies,74 (4), 1059–1087. URL http: //restud.oxfordjournals.org/content/74/4/1059.abstract. Flury, T. & Shephard, N. (2011). Bayesian Inference Based Only On Simulated Likelihood: Particle Filter Analysis Of Dynamic Economic Models. Econometric Theory,27 (05), 933– 956. URL http://ideas.repec.org/a/cup/etheor/v27y2011i05p933-956_00.html. Foerster, A. (2011). Financial crises, unconventional monetary policy exit strategies, and agents’ expectations. Research Working Paper RWP 11-04, Federal Reserve Bank of Kansas City. URL http://EconPapers.repec.org/RePEc:fip:fedkrw:rwp11-04. 33
Foerster, A., Rubio-Ramrez, J., Waggoner, D. F., & Zha, T. (2014). Perturbation Methods for Markov-Switching DSGE Models. NBER Working Papers 20390, National Bureau of Economic Research, Inc. URL http://ideas.repec.org/p/nbr/nberwo/20390.html. Fukac, M. (2010). Impulse response identification in DSGE models. Tech. rep. Julier, S. J. & Uhlmann, J. K. (1997). A new extension of the kalman filter to nonlinear systems. pp. 182–193. Kailath, T. (1980). Linear Systems. Information and System Sciences Series, Prentice-Hall. URL https://books.google.no/books?id=ggYqAQAAMAAJ. Kalman, R. E. (1960). On the general theory of control systems. In: Proceedings of the 1st IFAC Congress, pp. 481–492, Moscow. Kim, C. & Nelson, C. (1999). State-space Models with Regime Switching: Classical and Gibbs-sampling Approaches with Applications. MIT Press. URL http://books.google. no/books?id=eQFsQgAACAAJ. Kim, C.-J. & Nelson, C. (2001). A bayesian approach to testing for markov-switching in univariate and dynamic factor models. International Economic Review,42(4), 989–1013. URL http://EconPapers.repec.org/RePEc:ier:iecrev:v:42:y:2001:i:4:p:989-1013. Kim, J. & Ruge-Murcia, F. J. (2011). Monetary policy when wages are downwardly rigid: Friedman meets tobin. Journal of Economic Dynamics and Control,35(12), 2064–2077. URL http://ideas.repec.org/a/eee/dyncon/v35y2011i12p2064-2077.html. Kollmann, R. (2015). Tractable latent state filtering for non-linear dsge models using a second-order approximation and pruning. Computational Economics,45 (2), 239–260. URL http://dx.doi.org/10.1007/s10614-013-9418-3. Komunjer, I. & Ng, S. (2011). Dynamic Identification of Dynamic Stochastic General Equilibrium Models. Econometrica,79(6), 1995–2032. URL http://ideas.repec.org/a/ecm/ emetrp/v79y2011i6p1995-2032.html. Liu, P. & Mumtaz, H. (2011). Evolving Macroeconomic Dynamics in a Small Open Economy: An Estimated Markov Switching DSGE Model for the UK. Journal of Money, Credit and Banking,43 (7), 1443–1474. URL http://ideas.repec.org/a/mcb/jmoncb/ v43y2011i7p1443-1474.html. Lucas, R. J. (1976). Econometric policy evaluation: A critique. Carnegie-Rochester Conference Series on Public Policy,1(1), 19–46. URL http://ideas.repec.org/a/eee/ crcspp/v1y1976ip19-46.html. Maih, J. (2015). Efficient perturbation methods for solving regime-switching DSGE models. Working Paper 2015/01, Norges Bank. URL http://ideas.repec.org/p/bno/worpap/ 2015_01.html. 34
Melino, A. & Yang, A. (2003). State dependent preferences can explain the equity premium puzzle. Review of Economic Dynamics,6(4), 806–830. URL http://EconPapers.repec. org/RePEc:red:issued:v:6:y:2003:i:4:p:806-830. Muske, K. R. & Edgar, T. F. (1997). Nonlinear process control. chap. Nonlinear State Estimation, pp. 311–370, Upper Saddle River, NJ, USA: Prentice-Hall, Inc. URL http: //dl.acm.org/citation.cfm?id=248020.248026. Nørgaard, M., Poulsen, N. K., & Ravn, O. (2000). Advances in derivative-free state estimation for nonlinear systems. Rudebusch, G. D. & Swanson, E. T. (2012). The Bond Premium in a DSGE Model with Long-Run Real and Nominal Risks. American Economic Journal: Macroeconomics,4(1), 105–43. URL http://ideas.repec.org/a/aea/aejmac/v4y2012i1p105-43.html. S¨arkk¨a, S. (2013). Bayesian Filtering and Smoothing. New York, NY, USA: Cambridge University Press. Schmitt-Grohe, S. & Uribe, M. (2004). Optimal fiscal and monetary policy under sticky prices. Journal of Economic Theory,114 (2), 198–230. URL http://ideas.repec.org/ a/eee/jetheo/v114y2004i2p198-230.html. Sims, C. A. & Zha, T. (2006). Were There Regime Switches in U.S. Monetary Policy? American Economic Review,96 (1), 54–81. URL http://ideas.repec.org/a/aea/aecrev/ v96y2006i1p54-81.html. 35