Using a Bayesian Approach to Estimate and Compare New Keynesian DSGE Models for the Brazilian Economy: the Role for Endogenous Persistence∗

New Keynesian dynamic stochastic general equilibrium (DSGE) models have been developed for monetary policy analysis in open economies. For this purpose, the basic model must be enriched with the sources of nominal and real rigidities which are capable of explaining the observed output and inflation persistence. Under this perspective, we use the Bayesian approach to estimate and compare alternative model specifications for the Brazilian economy with respect to two endogenous persistence mechanisms widely supported by the international empirical literature: habit formation and price indexation. Using data for the inflation target period, we conclude for the relevance of both mechanisms, although the evidence is unexpectly less robust for price indexation. Furthermore, impulse-response functions are built to describe the dynamic effects of domestic and foreign real and monetary shocks.

New Keynesian dynamic stochastic general equilibrium (DSGE) models have been developed for monetary policy analysis in open economies.For this purpose, the basic model must be enriched with the sources of nominal and real rigidities which are capable of explaining the observed output and inflation persistence.Under this perspective, we use the Bayesian approach to estimate and compare alternative model specifications for the Brazilian economy with respect to two endogenous persistence mechanisms widely supported by the international empirical literature: habit formation and price indexation.Using data for the inflation target period, we conclude for the relevance of both mechanisms, although the evidence is unexpectly less robust for price indexation.Furthermore, impulse-response functions are built to describe the dynamic effects of domestic and foreign real and monetary shocks.

INTRODUCTION
New Keynesian dynamic stochastic general equilibrium (DSGE) models with imperfect competition and nominal stickiness have been developed for monetary policy analysis in open economies.Built from first principles, these models give rise to a macroeconomic dynamics lead by fundamental shocks, at the same time that they preserve the analytical tractability of the traditional Mundell-Fleming approach.In using these models to recommend how central banks should react to the business cycles, it is necessary to determine the sources -as well as evaluate the degree -of the nominal and real rigidities present in the economy.Under this perspective, (Christiano et al., 2005) and (Smets and Woulters, 2004) have argued that endogenous persistence mechanisms, such as habit formation and price indexation, must be added to the basic new Keynesian model in order to reproduce the observed output and inflation persistence.Many empirical studies have addressed empirically this question for small open economies, such as (Justiniano and Preston, 2004) for Australia, Canada and New Zealand, (Caputo et al., 2005) for Chile and (Liu, 2005) for New Zealand.In general, they conclude for the relevance of habit formation, although the evidence is less robust for price indexation.Following this line of research, this paper estimate and compare alternative model specifications for the Brazilian economy with respect to the existence of these persistence sources.The paper also analizes the dynamics properties of the economy under the best specification through impulse-response functions.
As a workhorse, we build a two-country version of the model by (Gali and Monacelli, 2005), which extends for a small open economy the new Keynesian DSGE with Calvo-type staggered price-setting developed initially for closed economies.A distinctive feature of the model is that the terms of trade enters directly into the new Keynesian Phillips curve as a second pushing-cost variable in addition to the output gap, creating in this way a new source of inflationary pressure.Most part of the literature built small-open economy models by assuming that foreign variables follow exogenous processes.This paper takes an alternative route and derive the small open economy directly as a limit-case of the twocountry model.The advantage of this procedure is that we derive rigorously the small economy as part of a integrated world economy, preserving all international linkages and without taking the risk of setting aside relevant international channels of monetary transmission.
In the empirical part of the paper, the Bayesian approach is used to estimate alternative model specifications with respect to the presence of different endogenous persistence mechanisms, in which Brazilian data is used for the small economy and U.S. data for the rest of the world.The parameters of both economies are estimated simultaneously.The Bayesian approach has become widespread in the empirical literature as it allows us to use our previous beliefs on structural parameters in making inference about them.For the Brazilian case, this Bayesian property is expected to be particularly helpful, since we could compensate the shortness of Brazilian historical series with the information provided by the estimation of analogous models with data from other countries.Furthermore, in using posterior odds, Bayesian approach makes easier a formal model comparisons, so that we can evaluate the relative importance of each type of endogenous persistence to explain the data.
The rest of the paper is organized as follows.Section 2 lays out the model.Section 3 carries out the empirical analysis.Section 4 concludes.
Using a Bayesian Approach to Estimate and Compare New Keynesian DSGE Models for the Brazilian Economy: the Role for Endogenous Persistence

MODEL
The world is inhabited by a continuum of infinite-lived households, indexed by j ∈ [0, 1].Each household lives in one of two countries: households on the interval [0, n) live in the Home country, while households on the interval [n, 1] live in the Foreign country.The parameter n measures the relative size of the Home country.The small Home country case can be derived by taking the limit of the two-country model as n −→ 0. Households maximize a lifetime utility subject to a interteporal budget constraint.Real rigidity stemming from consumption inertia is introduced through habit formation.The international financial market is complete, allowing for international risk sharing.Central banks in both countries follow a Taylor-type rule in setting the nominal short term interest rate, which embodies interest rate smoothness and monetary policy shocks.
Each household owns a competitive-monopolistic firm producing a differentiated good.Thus, there is also a continuum of firms indexed by i ∈ [0, 1], such that firms on the interval [0, n) are located in the Home country, while firms on the interval [n, 1] are located in the Foreign country.Calvo-style pricesetting is assumed, but firms not adjusting prices optimally have their prices indexed fo past inflation.Firms use only labor for production through a CRS technology subject to productivity shocks.There is no investment.Households' labor supply reacts elastically to real wage.Labor market is competitive and internationally segmented.
All Home and Foreign goods are tradable and the law of one price (LOP) holds for all of them.Therefore, the model sets aside the effects of nontradability and international market segmentation on the real exchange rate fluctuation.In this sense, the only reason for PPP (purchase power parity) violation is the introduction of a home bias in households' preferences.In addition, prices are set in the producer's currency.
We derive the general equilibrium dynamics for the log-linearized model around the steady state, in which all driving forces of the economy remain constant in their long-run equilibrium levels.Without loss of generality, we log-linearize the particular case of the model with symmetric preferences and identical wealth conditions.This procedure is common in the literature as it makes the log-linearization much easier.
Throughout the paper, we describe only the Home economy's structure, while its Foreign counterpart is presented only if necessary.Starred variables, as well as expressions into brackets [ ], refer to the Foreign country.Lowercase variables are in log deviation from steady state, so that constants are eliminated.

Preferences
The typical Home jth household maximizes the lifetime utility function1 where β is the intertemporal discount factor, ϕ is the inverse of the wage-elasticity of labor supply L sj t and σ is the inverse of the elasticity of intertemporal substitution in consumption C j t .In order to reproduce observed output persistence, we introduce external habit formation -with degree of intensity indexed by h -through the term H t ≡ C h t−1 , where C t−1 is the aggregate past consumption index, which will be derived below.As usual, we assume that 0 < β < 1, ϕ > 1, σ > 0 and 0 ≤ h ≤ 1.

Marcos Antonio C. da Silveira
The variable C j t is defined as the CES composite consumption index where µ is the elasticity of intratemporal substitution between a bundle of Home goods C j H,t and a bundle of Foreign goods C j F,t , while α determines the share of the imported (Foreign) goods on the Home household j's consumption expenditure and, as we will see below, is inversely related to the degree of home bias.We assume that 0 < α < 1 and µ > 0.
The variables C j H,t and C j F,t are defined respectively by the CES composite consumption indexes where C j H,t (i) and C j F,t (i) are respectively the Home j th household's consumption levels of Home i th good, with i ∈ [0, n), and Foreign i th good, with i ∈ [n, 1].The parameter ε is the elasticity of intratemporal substitution among goods produced in the same country.We assume that ε > 0.
The Foreign households' preferences are the same, except for eq.( 2), which assumes the form , where α * is the share of the imported (Home) goods on the Foreign jth household consumption expenditure.

Intratemporal Consumption Choice
For clearness of exposition, we explain how the typical household allocates wealth among goods intratemporally before describing her intertemporal budget constraint and derive her intertemporal consumption choice.The Home j th household takes as given the Home-currency market price of all Home and Foreign goods, denoted respectively by P H,t (i), with i ∈ [0, n), and P F,t (i), with i ∈ [n, 1].Thus, for any fixed levels of C j H,t and C j F,t , the optimal C j H,t (i) and C j F,t (i) are given respectively by 2 where P H,t and P F,t are the Home-currency price indexes of the domestically produced goods and imported goods from the Foreign country, given respectively by (5) How C j H,t and C j F,t are determined?Given P H,t and P F,t derived in the problem above and C j t derived in the intertemporal consumer problem below, the optimal consumption allocation between Home and Foreign goods is given by Using a Bayesian Approach to Estimate and Compare New Keynesian DSGE Models for the Brazilian Economy: the Role for Endogenous Persistence where P t is the Home consumer price index (CPI), given by Proceeding analogously with the Foreign country, we have that the Foreign CPI index is given by

Home bias
It is important to understand how the parameter α is related to the degree of home bias in Home households' preferences.For that, suppose without loss of generality that P H,t = P F,t .In this case, it follows from eqs.( 6) and ( 7) that α is exactly equal to the share of imported goods in Home consumption expenditure.Having in mind this result, it is intuitive that α should fall with the relative size of the Home country, given by parameter n defined above, and with the degree of home bias in Home households' preferences.A tractable way to formalize these ideas is to define where the parameter ᾱ is given exogenously in the model and its inverse, 1 ᾱ , is an index for the degree of home bias in Home households' preferences. 3For instance, if the reason for home bias is international trade barries, ᾱ can be interpreted as an index of openness for the Home country.Applying the same procedure to the Foreign country, we set α * ≡ ᾱ * n. 4 In the particular case with fully opened countries, when ᾱ = ᾱ * = 1, we get α = 1 − n and α * = n.There is no home bias in this case, since the weight of imported goods in the aggregate consumption of each country is naturally given by the relative size of the Home and Foreign countries.On the other hand, in the particular case with fully closed countries, when ᾱ = ᾱ * = 0, we get α = α * = 0 even if both countries are large (n = 0.5 for instance).

World aggregate demand
The LOP holds for all goods, so that P H,t (i) = ε t P * H,t (i) for i ∈ [0, n) and P F,t (i) = ε t P * F,t (i) for i ∈ [n, 1], where ε t is the nominal exchange rate (Home-currency price of one unit of the Foreign currency).Substituting these results into eqs.(5)and their Foreign counterparts, we get P H,t = ε t P * H,t and P F,t = ε t P * F,t .Using these results, we can substitute eq.( 4) for C j H,t (i) and its Foreign counterpart for C j * H,t (i) into the definition below for the Home i th good's world aggregate demand, denoted by Y d t (i), so that we get where and the aggregate counterparts for Home and Foreign consumption indexes are given by Marcos Antonio C. da Silveira

Intertemporal Consumption Choice
Given the CPI index P t derived above, the period budget constraint of the Home jth household is given by is the one-period stochastic discount factor, W t is the Home nominal wage and V j t is the nominal cumdividends value of the portfolio held by the household j at t-1.
The optimal consumption allocation between periods t and t+1 meets the marginal condition 1 Rt = βE t D t,t+1 Pt Pt+1 , where R t is the one-period nominal spot interest rate.Log-linearizing this equation and using eqs.(12), the log Home aggregate consumption c t meets the Euler equation where π t ≡ p t − p t−1 is the Home consumer price index (CPI) inflation.The elasticity of current consumption with respect to expected real interest rate falls with h, since habit formation implies that household smooths not only the consumption level but also the change in consumption.

Labor Supply
The marginal condition for Home j th household with respect to labor supply is given by , where j ∈ [0, n).Using this condition to substitute for L sj t into the definition below for the Home aggregate labor supply, denoted by L s t , and using eq.( 12), we have that

Inflation, Terms of Trade (TOT) and Real Exchange Rate
Now, we derive the relationship between inflation, terms of trade and real exchange rate.The Home terms of trade (TOT), defined as S t ≡ P F,t P H,t , is the Home country's relative price of the imported (Foreign) goods in terms of the domestic (Home) goods.It follows from the LOP that the Foreign TOT is given by S St .Therefore, an improvement (deterioration) of the Home TOT -i.e. a lower (higher) S t -reduces (increases) the Home goods' world competitiveness.Dividing the Home CPI index in eq.( 7) by P H,t and P F,t [and its Foreign counterpart in eq.( 8) by P * H,t and P * F,t ], we get ) and ( 17) where g (S t ) > 0, h (S t ) < 0, g * (S t ) > 0 and h * (S t ) < 0. Log-linearizing eqs.( 15) and ( 18), we get Using a Bayesian Approach to Estimate and Compare New Keynesian DSGE Models for the Brazilian Economy: the Role for Endogenous Persistence where the Home and Foreign log domestic inflation rates (i.e., the percent change of the price index of the goods produced domestically) are given by π H,t ≡ p H,t − p H,t−1 and π * F,t ≡ p * F,t − p * F,t−1 .Equation ( 19) tells us that the size of the positive effect of a deterioration in Home TOT on the gap between the Home CPI and domestic inflation rates increases with the weight of the imported (Foreign) goods in the Home households' preferences, given by α = ᾱ(1−n), which in turn falls with the relative size of the Home country n and with the degree of home bias 1 ᾱ , inversely related to ᾱ.5 An analogous argument is true for the Foreign country's counterpart in eq.( 20).Two particular cases are of interest: (1) for closed countries, when ᾱ = 0, we get π t = π H,t and π * t = π * F,t ; (2) for a small Home country, when n is very close to 0, we get π * t = π * F,t .Combining the LOP with eqs.( 15) and ( 17), we get , where Q t is the Home country's real exchange rate.Although the LOP holds for all goods individually, Q t is an increasing function of S t .Intuitively, home bias implies that P t and P * t are consumer-based price indexes with different weights on the Home and Foreign goods.Log-linearizing this result, we get This equation highlights that home bias is the only source of PPP violation, since q t = 0 every period when there is no home bias (ᾱ = 1).

International Risk Sharing
We assume complete international financial markets.Hence, following (Chari et al., 2002), we can combine the Home and Foreign marginal conditions with respect to Arrow -Debrew securities positions -relative to a same history between two periods -in order to get the international risk sharing (IRS) condition where ϑ ≡ Q . It follows from this result that home bias allows for a variable gap between Home and Foreign (per-capita) households' consumption growth rates, even if financial markets are complete.The intuition is that, with home bias, changes in Home TOT produce real exchange rate fluctuation, which in turn gives rise to a variable gap between the Home and Foreign's intertemporal relative price of consumption.Following a general procedure in the literature, which is without loss of generality, we assume the same initial conditions -in terms of relative net asset positions -for Home and Foreign households, so that ϑ = 1.Using eqs.( 12) to substitute for C j t and C j * t into eq.(22), we get an aggregate version of the IRS condition, which can be log-linearized to yield

Uncovered Interest Parity
As inferred from subsection (2.1.3),the Home-currency equilibrium prices of the one-period zerocupon bonds denominated in Home and Foreign currencies are given respectively by , where D t,t+1 is the one-period Home SDF.Combining these equations, we get the uncovered interest parity (UIP) = 0. Log-linearizing this equation and using the results ( 15) and ( 17), we get where As should be clear, the UIP condition ( 24) is not an additional independent equilibrium condition.

Firms
Each Home and Foreign household owns a competitive-monopolistic firm producing a differentiated good.Therefore, there is also a continuum of firms indexed by i ∈ [0, 1], such that firms on the interval [0, n) are located in the Home country, while firms on the interval [n, 1] are located in the Foreign country.Whenever allowed, each firm sets its price in order to maximize profits subject to an isoelastic demand curve, which is given by eq.( 10) for the Home firms.Firms use only a homogeneous type of labor for production.Labor market is competitive and internationally segmented.There is no investment.

Technology and Cost Minimization
All Home firms operate the same CRS technology where Y t (i) is the Home i th firm's output, L t (i) is the Home i th firm's labor demand and A t is the Home total factor productivity shifter, which follows the AR(1) process where 0 < ρ < 1 and ξ A,t are i.i.d Gaussian shocks.All Foreign firms operate a similar technology, except for the fact that ρ = ρ * is possible.This technology implies that the Home nominal marginal cost is given by M C n t = Wt At .Defining the Home real marginal cost -in terms of domestic goods -as so that M C t depends positively on the real wage and the TOT, since g (S t ) > 0 in eq.( 15).

Labor Demand
Substituting eq.( 25) into the definition below for Home aggregate labor demand, we get where Y t is the Home aggregate output index, defined as and Yt di is a variable that measures the dispersion of the Home firms' outputs.

Price-Setting
Calvo-style price-setting is assumed.In addition, we introduce inflation persistence by allowing for price indexation to past inflation.Every period, a fraction 1 − φ(0 < φ < 1) of randomly selected firms set prices optimally.In this case, each Home firm i sets a new price P o H,t (i) in order to maximize the present value of its stream of expected future profits, which is given by V is the profit at period t+s and Y d t+s (i) is the world demand for Home i th good at period t+s, which is given by eq.( 10). 6Log-linearizing the solution of this problem, we get7 where ψ ≡ ln ε ε−1 .The firm sets the new price as a (gross) markup -with size in log equal to ψ -over the weighted average of the current and expected future nominal marginal costs.This forward-looking behavior arises because the firm recognizes that the new price price will be effective for a random number of periods.As the firm faces an isoelastic demand curve, it does not adjust price in response to a shift in this curve if current or expected future marginal costs remain unaltered.This result implies that inflationary pressures must have a cost-pushing origin, which is a central property of the new Keynesian models.We can derive a similar equation for the Foreign country, where φ * = φ is allowed.
In particular, we have φ = φ * = 0 under flexible prices, so that every Home firm adjusts optimally its price every period according to the pricing rule On the other hand, each firm i of the other fraction φ, which does not choose price optimally, sets a new price P I H,t+1 (i) according to the indexation rule where 0 < γ < 1 is the degree of indexation to the previous period's domestic inflation rate.

New Keynesian Phillips (NKP) Curve
It follows directly from the price setting structure above that the Home domestic price P H,t , as defined in eqs.(5), is given by P H,t = φ P H,t−1 π γ H,t−1 . 8 Combining the log-linearization of this equation with the result (30) yields the NKP curve where λ ≡ 1−φ φ (1 − φβ).

Monetary Policy
We assume that the Home Central Bank follows the Taylor-type rule where ξ M,t is a Gaussian i.i.d monetary policy shock and δ r is the interest rate smoothing coefficient.Following the new Keynesian procedure, we introduce the output gap into the rule, which is defined as ỹt ≡ y t − ȳt , where ȳt is the Home output level under flexible prices. 9We do not derive the optimal monetary rule since it is not necessarily used in practice.

Equilibrium
In this section, we derive the general equilibrium dynamics for the log-linearized version of the model around the steady state, in which the productivity shifters A t and A * t remain constant in their long-run equilibrium levels equal to 1.For sake of simplicity, we follow the literature and assume the same preference parameters and initial wealth conditions for both countries.10

Demand Side: Goods Markets Equilibrium and IS Curves
As explained in subsection (2.2.3), the markets of all goods clear in equilibrium, so that Hence, we can substitute eq.( 10) into definition (29) in order to get where we also use the results ( 5) and ( 11), along with the definitions ( 15) and ( 17).Log-linearizing this result, we get A deterioration of Home TOT -an increase in s t -increases the world demand for Home goods.The size of this effect rises with the elasticity of substitution between domestic and imported goods µ and falls with the degree of home bias ᾱ.Furthermore, Home output increases with the Home and Foreign aggregate consumption c t and c * t .A lower degree of home bias -equivalent to a higher degree of openness -reduces the size of the positive impact of an increase in the Home domestic consumption on the Home output, while increases the size of the positive impact of the Foreign output on the Home output.For closed countries, when ᾱ = 0, we get c t = y t .

Supply Side: Labor Market Equilibrium and Marginal Costs
The Home labor market equilibrium condition is given by L s t = L t .Substituting eqs.( 14) and (28) into this condition and solving it for real wage, we get . Now, substituting this result into eq.( 27) for the real marginal cost and log-linearizing, we get11 Since this equation determines the Home real marginal cost, which enters into the Home NKP curve (33), it allows us to understand the three sources of inflationary pressure on the Home domestic prices.First, a higher Home output y t or a lower Home productivity a t increases, ceteris paribus, Home labor demand and hence pushes Home real wage and marginal cost up.The size of this effect falls with the real wage-elasticity of labor supply, given by the inverse of parameter ϕ.Second, a higher current Home domestic consumption c t reduces the marginal utility of real wage and thus shrinks the labor supply, pushing real wage and marginal cost up.This effect increases with the habit formation index h and with the inverse elasticity of intertemporal substitution in consumption σ, since this parameter measures the negative impact of the marginal utility with respect to consumption.Third, the purchase power of the Home wage in terms of Home goods increases with the Home TOT s t , pushing the real marginal cost -also measured in terms of Home goods -up.The Home NKP curve (33), complemented Using a Bayesian Approach to Estimate and Compare New Keynesian DSGE Models for the Brazilian Economy: the Role for Endogenous Persistence by the Home real marginal cost equation ( 36), fully characterizes the Home economy's supply side.Unlike models for closed economies, there is no more a direct relationship -given a fixed productivitybetween output and marginal cost and therefore between output and inflation.This happens because the real marginal cost is also affected by the TOT.in open economies.

Canonical Representation
The canonical representation of the general equilibrium dynamics is described by the following sets of equations: (1) eqs.( 19) and (37), which relates CPI and domestic inflation; (2) NKP curve (33) along with the marginal cost equation (36) and their Foreign counterparts (38) and (39), which characterize the supply side of Home and Foreign countries respectively; (3) eqs.( 13) and ( 35) and their Foreign counterparts ( 40) and ( 41), which characterize the demand side (IS curves) of the Home and Foreign countries respectively; (4) UIP equation ( 24) or, alternatively, IRS condition (23); (5) monetary policy rules (34) and ( 42); (5) the equations describing the general equilibrium under flexible prices, since the output gaps ỹt ≡ y t − ȳt and ỹ * t ≡ y * t − ȳ * t are introduced into the monetary rules, where ȳt and ȳt are the output under flexible prices. 12

EMPIRICAL ANALYSIS
In this section, we calibrate/estimate the structural paramaters with Brazilian data for the Home country and U.S. data for the Foreign country. 13Next, we test for the relevance of endogenous persistence in the Brazilain economy.Finally, we use our estimates to compute impulse-response functions in 12 As we saw in subsection (2.2.3), under flexible prices, all Home firms adjust optimally their prices every period according to the pricing rule (31), i.e., as a mark-up over the marginal cost.In addition, they set the same price p o H,t , since they face identical technological and demand constraints.Therefore, the Home real marginal cost is given by mct ≡ mc n t − p o H,t = −ψ.By the same argument, we get mc * t = −ψ.These two results, associated to the flexible-price counterparts for equations in the canonical representation, are enough to characterize the flexible-price general equilibrium dynamics for real variables. 13We proceed in this way as a first exercise and leave for future research the task of estimating the model with more representative historical series for the Foreign country, which would be the weighted average of the historical series of the main Brazilian financial and trade partners.
Marcos Antonio C. da Silveira order to analyse the effects of structural shocks on the macroeconomic variables' dynamics.As Brazilian economy is small, we have n = 0 in eq.( 9), so that α = ᾱ.

Calibration and Bayesian Estimation
Parameters ᾱ and β are calibrated with basis on steady-state relations between endogenous variables.The share of imported goods in the Brazilian aggregate consumption basket, denoted by α, is set to 0.13, which is consistent to the ratio Brazilian imports/GDP and Brazilian net exports/GDP during the sample period. 14The discount factor β is set to 0.91 (annual basis) in order to get approximately the historical mean of the nominal interest rate in the steady state. 15ollowing an increasing part of the empirical literature, we use the Bayesian approach to estimate the other parameters of the model, which works as follows.First, we assume a prior distribution with density p(θ) for the vector θ ≡ σ, h, ϕ, µ, ρ, ρ * , φ, φ * , γ, γ * , δ r , δ * r , δ π , δ * π , δ y , δ * y of structural parameters to be estimated, which summarizes our previous beliefs about the location of these parameters, that is, all information we have in addition to the database Y T used in estimation.We follow the usual procedure of assuming that the parameters have independent priors, so that we can specify a marginal prior for each parameter separately.Second, the database Y T is used to update the prior distribuition according the Bayes rule, giving rise to the posterior distribution where L(θ | Y T ) is the likelihood function.If the posterior is not standard, draws from this distribution can be generated numerically through simulation technics.Third, we compute posterior summary statistics in order to characterize the location of the structural parameters.We denote by Y t the vector of observed variables used in estimation, which are proxies for the following endogenous variables in the model: the Brazilian and U.S. output y t and y * t , CPI inflation π t and π * t and nominal interest rate r t and r * t , as well as the bilateral real exchange rate q t .The database Y T comprises therefore the T-size historical series of the observed variables, which are described in more detail below.Given some initial values for parameters, we use Kalman filter to evaluate the likelikood function in eq.( 45).For that, we need first to write the state-space representation for the dynamics of Y t , which is given by a set of two vectorial equations: (1) the state equation for the dynamics of the endogenous (state) variables of the model, which is the reduced-form solution (derived with Sim's algorithm) of the log-linearized structural model and (2) the measurement equation Y t = X t + w t , which links the observed variables in Y t to the endogenous variables grouped in X t through a known matrix , where w t is a vector of normally distributed and independent measurement errors.As usual, we assume that w t are independent from the structural shocks ε t .To avoid stochastic singulariry in the case where there are more observed variables than shocks, three measurement errors were included in w t , in such a way they can be interpreted as Brazilian and U.S. inflation shocks and a external risk premium shock.Less rigorously, this amounts to add a IID shock to structural eqs.( 33), ( 38) and ( 24) respectively.
As the posterior distribution in this case is clearly non-standard, we use Metropolis-Hasting algorithm to generate draws from this distribution. 16The idea behind this procedure is to simulate a 14 Denoting by Mt and N Xt the Home imports and current account as a proportion of the output, we get N Xt = , where we use definitions (15), the aggregate counterpart for C j F,t in eqs.( 6) and the fact that n = 0 in eq.( 9) because Brazilian economy is small.Since St = h (St) = g (St) = 1 in steady state, we can use the results above to get a calibrated value for ᾱ. 15 Since the parameter β is common to both countries, we set an intermediary value.
Using a Bayesian Approach to Estimate and Compare New Keynesian DSGE Models for the Brazilian Economy: the Role for Endogenous Persistence Markov Chain θ t , t = 1, 2, . .., that converges to the posterior distribution.Intuitively, the algorithm works because the transition distribution T (θ t | θ t−1 ) of the process is built to make it behave like the stochastic version of a stepwise mode-finding algorithm, always stepping to increase the density but only sommetimes stepping to decrease. 17In order to guarantee convergence, posterior simulation uses only the second half of two parallel chains with 120.000 runs.The scale factor was chose to provide an acceptance rate of about 25%-40%.Convergence diagnosis testes in (Brooks and Gelman, 1998) were used to evaluate convergence of the Markov chain to the posterior distribution.

Data
We estimate the model with quarterly data of the Brazilian and U.S. economies for the period from 1999Q3 to 2005Q3.Structural breaks in Brazilian economy prevent us from using longer series. 18For both countries, the output gap is the detrended (linear) log real GDP (multiplied by 100) and the CPI inflation is the annualized quarterly percentage change in the CPI index.The full IPCA index produced by IBGE is used for Brazil.The U.S. nominal interest rate is the 3-month Treasury Bill annualized percentage period-average daily rate, while the Brazilian nominal interest rate is the annualized percentage period-average daily rate of reference for the 90-day DI-pré swap contract traded in BMF.Real exchange rate series is build with the Brazilian and U.S. period-average log CPI indexes and the period-average log nominal bilateral exchange rate.Data are available in ipeadata, except for Brazilian swaps, which are obtained from Brazilian Central Bank.All variables are demeaned and, if necessary, seasonally adjusted with the X-12 method.The U.S. inflation and nominal interest rate are also detrended with a linear filter.This previous treatment is necessary because the model is not developed to explain linear tendencies and seasonal movements.

Prior Distributions
The prior distributions reflect our beliefs about the values that the parameters can take.Large prior standard deviations result in diffuse distributions, which means we have little information in addition to the data.On the contrary, small prior standard deviations mean we are confident that the parameters take some value around their prior means.Most earlier attempts to estimate new Keynesian DSGE models with the Bayesian approach use data from developed countries, which have a record of macroeconomic stabilization much longer than the Brazilian economy.Therefore, we seek to specify more diffuse priors that those usually found in the empirical literature, since we figure out it should be much harder to deal with the uncertainty on Brazilian parameters.In setting the prior distribution for a given parameter, we need to make two choices: (1) the parametric distribution and (2) the values for the characteristic parameters of this distribution.In many cases, the choice of the distribution is restricted by the domain in which the parameter can take values.In addition, we can use the Bayesian esimates for other countries as a reference guide.The prior distributions are summarized in Table 1 and their graphs -in grey -are shown in Figure 1, 2 and 3. 19 Beta distributions with mean 0.5 and standard deviation 0.18 were selected for most Home and Foreign parameters constrained on the unit-interval: the autorregressive productivity coeficients ρ and ρ * , the Calvo-stickiness parameters φ and φ * , the interest rate somoothing parameters δ r and δ * r and the degree of habit formation h.This is a symmetric and fairly diffuse distribution with a 90% interval Marcos Antonio C. da Silveira between 0.20 and 0.80, which reflects our uncertainty about these parameters. 20The only exception was the use of a uniform distribution between 0 an 1 for the degrees of price indexation γ and γ * , since beta priors yielded very suspicious posterior estimates.
A Gamma distribution was used for the elasticity of substitution between domestic and imported goods µ, since we expect a positive value for this parameter.We set a prior mean and standard deviation at 1 and 0.6 respectively.As usual in the literature, the inverse elasticity intertemporal of substitution in consumption σ and the inverse elasticity of labor supply ϕ are assumed to follow a Normal distribution with prior means and standard deviations such that these elasticities lies on a large 90% interval between 0.55 and 5.63 and between 0.37 and 3.75 respectively.
Following again the literature, we use Normal distributions for the Taylor rules' coefficients regarding inflation and output gap with the prior means set respectively at 1.5 and 0.5.These values are close to the ones commonly used in previous works, such as (Caputo et al., 2005) for Chile.Again, we use larger prior strandard deviations to deal with the uncertainty about these rules in the Brazilian economy.Inverse Gamma distributions are used for the volatility of the shocks.
Using a Bayesian Approach to Estimate and Compare New Keynesian DSGE Models for the Brazilian Economy: the Role for Endogenous Persistence

Model Comparison
Before analyzing our posterior densities, we estimate and compare four alternative model specifications in order to evaluate the role for endogenous persistence in the Brazilian economy: (1) model with habit formation and price indexation (HF-PI); (2) model only with habit formation (HF); (3) model only with price indexation (PI); (4) model without persistence (WP).The estimated posterior densities for all models are summarized in Table 1.The Bayesian approach allows us to compare rigorously how well two alternatives models m K and m L are fitted to data Y T through the ratio between the posterior model probabilities p m K |Y T and p m H |Y T , which is known as posterior odds P O K,H .Using the Bayes rule, we have that where the density p Y dθ is known as the marginal likelihood (ML) of model m K , while p m K | Y T and p (m K ) are, respectively, the posterior and prior probabilities of data Y T have been generated by model m K .In sum, posterior odds uses data Y T to update our previous beliefs about how much model m K is more likely to explain the data than model m H , which is given by p(m K ) p(m H ) .As we have no previous beliefs, we assume that p (m K ) = p (m H ). In this case, posterior odds above 1 means that data Y T provides information in favor of model m K over m H .
We estimate the log marginal likelihood (ML) by using the simulation-based modified harmonic mean proposed by (Geweke, 1998), which is shown in the last row of Table 1.A very robust finding is that models perform much better with habit formation.The differences in terms of log ML between models HF-PI and PI and between models HF and WP are 18.61 and 20.17 respectively, which translateswith equal prior probabilities -into posterior odds greater than e 8 .Definitively, habit information is an empirically testifiable property of Brazilian economy's structural models designed for monetary policy analysis.Less strongly, price indexation also improves the fitness to the data.The differences in terms of log ML between models HF-PI and HF and between models PI and WP are 2.79 and 4.35 respectively, which translates into posterior odds around 16 and 77.In some sense, the relatively weaker evidence for price indexation over habit formation in the Brazilian economy is coherent with one of the main findings by (Justiniano and Preston, 2004), which asserts that a robust result across specifications and countries -Australia, Canada and New Zealand -is that the inclusion of price indexation is not validated by the data, while habit formation seem to matter in some cases.
Another important question is to analyze how the introduction of endogenous persistence affects the parameter estimates.Coherent with our previous finding, Table 1 highlights that our estimates are robust to the inclusion of price indexation, while assuming habit formation has two sizable effects on preference parameters estimates.First, it increases both the elasticity of labor supply 1/ϕ and the elasticity of intertemporal substitution in consumption 1/σ.The intuition follows from Euler equation (13), by which these elasticities and habit information index h have opposite effects on the interest rate monetary policy transmission, so that σ and ϕ must fall when h rises in order the model to reproduce the observed correlation between the interest rate, inflation and output.Second, it also reduces the elasticity of substitution in consumption between domestic and imported goods µ.We can understand this result by having in mind eqs.( 21) and ( 35), as well as the IRS condition (23).Since a higher h rises Brazilian consumption volatility, µ must fall in order to reproduce the observed volatilities of the real exchange rate and Brazilian and U.S. outputs. 21sing a Bayesian Approach to Estimate and Compare New Keynesian DSGE Models for the Brazilian Economy: the Role for Endogenous Persistence

Posterior Distribution
Now, we analyze the posterior densities for the model with both habit formation and price indexation (HF-PI), which provides the best fitting to the data.Their statistic summaries are presented in Table 1, while their graphs -in black -are shown in Fures 1, 2 and 3. Two facts are notorious.First, posterior densities are less diffuse than their prior counterparts.Second, the prior and posterior means are in most cases considerably apart one another.Both results suggest that the data contain information capable to update our prior beliefs, although in an extent that varies among parameters.For instance, the data seem to be more informative about Brazilian Calvo price stickiness than about Brazilian monetary policy rule.Other convenient fact is that posterior distributions are roughly symmetric, which makes possible to compare our results with other studies that present different measures of central tendency.
Validating the robustness of our results, the estimates for U.S. economy are, in general, consistent to previous empirical works, such as (Rabanal and Rubio-Ramírez, 2001) and (Smets and Woulters, 2004).On the other hand, the lack of similar works for emerging economies prevents from evaluating more accuralety the robustness of our estimates for Brazil. 22he posterior mean of the Brazilian Calvo parameter for price stickiness φ is of 0.89, with a 90% confidence interval between 0.83 and 0.97. 23This estimate can be translated into an avarage duration of price contracts superior to two years, so that Brazilian price rigidity would be comparable with that for European and U.S. economies found by (Smets and Woulters, 2004), but higher than those for Australia, Canada and New Zealand found by (Justiniano and Preston, 2004).(Caputo et al., 2005)  also estimate a much lower posterior mean for Chile -around 0.12 -although their baseline model includes wage stickiness with estimated Calvo parameter around 0.85, which could explain their weak evidence for price rigidity.The estimated Brazilian price stickiness sounds strange since we would expect more price flexibility in countries with a higher historical level of inflation rates.A possible explanation is that firms setting prices in a relatively more inflationary environment could have a stronger forward-looking behavior, placing more weight on marginal costs farther into the future, so that frequent readjustments would not be necessary.
The posterior mean of the U.S. Calvo parameter for price rigidity φ * is of 0.91, which amounts to a price duration around ten quarters.The posterior density is fairly concentrated around the mean, with a 90% confidence interval between 0.86 and 0.99.These results imply a strong price rigidity for the U.S. economy.They are in line with the median of 0.91 found by (Smets and Woulters, 2004).
The data seem to be very informative with respect to Brasilian and U.S. degrees of price indexation γ and γ * , since posterior distributions are much less diffuse than their prior counterparts.For Brazil, the posterior mean is of 0.44, with a 90% confidence interval between 0.13 and 0.71.Price indexation in Brazil is higher than that observed by (Justiniano and Preston, 2004) for developed small economies.The posterior distribution for the Foreign degree is positively symmetric, with mean of 0.51 and a 90% confidence interval between of 0.09 and 0.91.Consistent to other empirical studies, such as (Rabanal  and Rubio-Ramírez, 2001), price indexation seems to be relevant for U.S. economy.
Both Brazilian and U.S. productivity shocks are very persistent, although still stationary.The 90% confidence interval of the U.S productivity autoregressive coefficient ρ * is between 0.95 and 0.99.This result is again in line with (Smets and Woulters, 2004), which estimates basically the same interval.The Brazilian productivity shocks are fairly less persistent, with a 90% confidence interval for the Brazilian autorregressive productivity parameter ρ between 0.56 and 0.95.
The posterior mean of the habit formation degree h is of 0.69, with a 90% confidence interval between 0.55 and 0.81.In principle, this result suggests the empirical relevance of habit formation for Brazil, although we must be cautious since this parameter is, by construction, commom for both Marcos Antonio C. da Silveira countries and therefore its estimate is influenced by U.S. data. 24 (Justiniano and Preston, 2004) found a fairly close posterior mean of 0.79 for Canada, although significatively lower estimates for Australia and New Zealand.(Caputo et al., 2005) found a slightly higher estimate for Chile.
As we estimate a small-economy version of the model, the elasticity of substitution in consumption between imported and domestic goods µ matters only for Brazilian economy.We estimate for this parameter a posterior mean of 0.06, which is much lower than the estimates for other countries.(Caputo  et al., 2005) found a posterior mean around 0.56 for Chile, while (Justiniano and Preston, 2004) estimates median higher than 0.2 for Australia, Canada and New Zealand.Despite this counter-evidence, the Brazilian data seem to be very informative with respect to this parameter as its posterior mean is pratically unaffected by the use of alternative prior distributions.In addition, Table 1 shows that different models specifications also yields low estimates.The relatively low value for this parameter would indicate that Brazilian output and imports have different composition and therefore a very low substitubility, implying that the terms of trade channel of monetary policy transmission is not so relevant for Brazilian economy.
The posterior mean of the inverse elasticity of labor supply ϕ is of 0.77, which means 1/ϕ equal to 1.30.The international evidence suggests lower elasticities.For instance, (Smets and Woulters, 2004)  with U.S. data and (Liu, 2005) with New Zealand data found posterior medians for ϕ around 2.90 and 2.60 respectively.This result is consistent with the expected higher responsiveness of the labor supply to wages in the countries with lower per-capital personal income, since economic theory postulates that poor workers are less reluctant in allocating free time to work.However, this is another preference parameter shared by Brazilian and U.S. economies, so that its estimate is influenced by U.S. data.
The posterior mean of the inverse elasticity of intertemporal substitution in consumption σ is of 2.09, which means 1/σ equal to 0.48.Brazilian aggregate demand is responsive to changes in real interest rate, so that the conventional interest rate channel on monetary policy transmission is effective in the Brazilian economy.The data are fairly informative with respect to this parameter, with the posterior and prior means very far from each other.Although our estimates be slightly above those usually found in earlier empirical works, the great variability that characterize these results does not allow a definitive conclusion.
The estimates of the Brazilian Taylor rule's coefficients for inflation and output gap, denoted by δ π and δ y , seem to be consistent to the inflation target regime implemented during the sample period: the posterior 90% confidence intervals lie entirely on the positive line, so that monetary policy reacts countercyclically to inflationary pressures.In addition, the estimates are fairly comparable to those for countries with the same monetary regime: we found posterior means around 1.05 and 0.82 for δ π and δ y , while the corresponding values in (Caputo et al., 2005) are around 1.18 and 0.28 respectively.The posterior mean of the Brazilian interest rate smoothing coefficient δ r is of 0.59, which is lower than the posterior mean of the U.S. corresponding parameter.Thus, Brazilian data does not suggest a very high persistence for the interest rate.
The posterior mean of the U.S. interest rate smoothing coefficient δ * r is of 0.81, with a 90% confidence interval between 0.72 and 0.91.However, this persistence is lower than that found by (Smets and  Woulters, 2004), which get a posterior median of 0.91.The U.S. coefficients for inflation and output gap δ * π and δ * y are of 2.10 and 0.53 respectively, implying that U.S. monetary policy reacts more to inflation than to output gap.These results are not comparable to those found by (Smets and Woulters, 2004)  because they use a different monetary rule.
Using a Bayesian Approach to Estimate and Compare New Keynesian DSGE Models for the Brazilian Economy: the Role for Endogenous Persistence

Impulse-Response Functions
Figure 4 shows the impulse-response (IR) functions for Brazilian endogenous variables in response to unit-size positive temporary productivity, monetary policy and inflation shocks. 25The solid middle line is the mean IR function, while the dotted upper and lower lines are the limits of a 90% confidence interval.As Brazilian economy is small, domestic shocks do not affect U.S. variables.Stationarity makes all variables converge to their steady-state levels in the long-run.As a result of our estimates for the autoregressive coefficients, productivity shocks have very persistent effects on the economy.On the other hand, monetary policy and inflation shocks are little persistent.Consumption and output responses are humped-shaped because, under habit formation, agents smooth both the level and the changes in consumption.

Brazilian Productivity Shock
The first row in Figure 4 shows the effects of a positive Brazilian productivity shock.For a given level of output, higher productivity shrinks labor demand, pushing real wage and marginal cost down.Firms allowed to adjust prices react by cutting domestic prices in order to maintain markup unaltered.Consequently, the TOT rises around 1% on impact, which improves Brazilian goods' competitiveness.In addition, despite the small CPI inflation on impact, monetary policy reacts to the negative output gap by cutting nominal interest rate. 26As a result, domestic consumption goes up in response to lower expected future real interest rates.As a joint effect of higher domestic demand and lower relative price, Brazilian output rises around 0.2% on impact.On the other hand, Brazilian currency depreciates around 1% on impact in response to the expected period of monetary loosening.The consequent higher prices of imported goods not only reinforces the increase in TOT, but also explains the small CPI inflation observed on impact, despite the fall of domestic prices.One period after, Brazilian currency stabilizes, while domestic prices keeps falling, causing a CPI deflation.Over time, as more firms adjust prices and the shock is amortized, economy returns gradually to steady state, which takes more than 20 quarters because since productivity shocks are very persistent.

Inflation Shocks
The second row in Figure 4 shows the effects of a positive Brazilian domestic inflation shock.The TOT falls around 0.5% on impact, worsening Brazilian goods's competitiveness.In addition, the monetary policy reaction to inflation leads domestic consumption to decline in response to higher future expected real interest rates.The consequent fall of the output around 0.08% shrinks the labor demand, while the lower domestic consumption increases the labor supply.Both effects all together push real wage and marginal cost down.However, the downward pressure on labor market is not so strong to annulate the primmary and direct effect of the shock, so that a CPI inflation around 1% is observed on impact.Despite the inflation persistence, monetary policy is effective in fighting inflation, which is almost entirely eliminated two periods after the shock.In consequence, monetary policy starts getting looser quickly, which pushes consumption, output and real wage up.Due to endogenous and monetary policy persistence, convergence of real variables to steady state takes around five quarters more than inflation. 25For lack of space, IR functions to U.S. productivity shocks and risk premium are omitted, since the associated 5%-95% posterior intervals are much larger than for the other shocks.In addition, as explained in subsection (3.1), risk premium shocks were introduced into the model in an ad hoc way, so that we are very suspicious about the dynamic effects produced by these shocks.Also for lack of space, we omit the graphs of the IR functions of U.S. endogenous variables, which can be provided under request. 26The negative effect of this shock on the output level under flexible prices is stronger than under sticky prices, so that output gap diminishes.

Marcos Antonio C. da Silveira
The third row in Figure 4 shows the effects of a positive U.S. inflation shock.On impact, U.S monetary policy reacts strongly by raising nominal interest rate, pushing U.S. consumption and output down.As the shock is partially compensated by the nagative impact of the recession on real wage and marginal cost, it produces only a small CPI inflation.Over time, as inflation gradually falls and households expect lower real interest rates, the output increases and economy returns to stady state.
On impact, U.S. inflation and Brazilian currency depreciation -in response to U.S. monetary tightening -cause an increase in Brazilian CPI index and TOT around 0.2% and 2% respectively.Despite the improved world competitiveness, the antiinflationary reaction of the Brazilian monetary policy causes a small recession, which pushes real wage down.However, real marginal cost -measured in terms of domestic goods -rises with the higher TOT, leading firms to increase domestic prices.Monetary policy is again effective in neutralizing the effect of the on inflation.Just after the shock, Brazilian currency has a strong appreciation, pushing TOT down, while monetary policy gets looser with the decline in inflation, allowing the economy to start recovering from the recession.

Monetary Policy Shocks
The fourth row in Figure 4 shows the effects of a positive Brazilian monetary policy shock.On impact, Brazilian currency appreciates, impairing the Brazilian goods' competitiveness since the TOT decreases around 1.5%.Simultaneouly, domestic consumption falls is response to higher future expected real interest rates.Both effects impact negatively on output, which falls around 0.2%.In consequence, labor demand shrinks, pushing both real wage down, so that firms start cutting prices.On the other hand, both domestic deflation and currency appreciation make CPI index fall around 0.25% on impact.Just after the shock, the nominal exchange rate overshoots and then converge quickly to steady state.This explains the positive CPI inflation before the price stabilization.In addition, the currency depreciation reinforces the positive effect of domestic deflation on TOT, so that Brazilian goods' competitiveness starts improving.At the same time, monetary policy gets looser in response to price stabilization and negative output gap, which in turn expands domestic consumption.This scenario allows the economy to recover from the recession.In general, the convergence takes around six quarters, so that the effects of the shock are relatively little persistent.
The fifth row in Figure 4 shows the effects of a positive U.S. monetary shock.On impact, U.S. households contract consumption in response to higher future expected real interest rates.The consequent fall in U.S. output pushes U.S. real wage and marginal cost down, resulting in a CPI deflation.Endogenous and monetary policy persistence mechanisms makes the nominal interest rate -and with it the rest of the economy -converge gradually to steady state, which takes around ten quarters to complete.
As a net effect of U.S. deflation and Brazilian currency depreciation caused directly by the shock, the TOT increases around 3% with the higher domestic prices of imported goods.Despite the improved competitiveness, Brazilian antiinflationary monetary policy is strong enough to cause a small fall in output.Although real wage falls on impact and remains pratically close to equilibrum three quarters after the shock, its purchase power in terms of domestic goods increases with the higher TOT, so that the real marginal cost -in terms of domestic goods -increases with the shock.Therefore, Brazilian firms react to expected positive future real marginal costs by rising domestic prices, which gives rise to a domestic inflation that neutralizes the negative effect of the imported goods deflation on CPI inflation along the convergence period.

CONCLUSION
With Brazilian data for the inflation target period, we use the Bayesian approach to estimate alternative new Keynesian DSGE model specifications with respect to the existence of two endogenous persistence mechanisms widely supported by the empirical literature: habit formation and price indexation.Under many aspects, our results are in line with most empirical studies for other small open

Figure 3 -Figure 4 -
Figure 3 -Prior and Posterior Densities Using a Bayesian Approach to Estimate and Compare New Keynesian DSGE Models for the Brazilian Economy: the Role for Endogenous Persistence t, DV t+s t+s DV t+s (i)], where D t,t+s = β s Ct+s Ct −ρ Pt Pt+s is the s-period Home SDF at period RBE Rio de Janeiro v. 62 n. 3 / p. 333-357 Jul-Set 2008

Table 1 -
Prior and Posterior Distributions of the Parameters