Modelling deep habits in Iranian economy using a Markov-switching DSGE model

This paper attempts to solve and estimate a Markov-Switching Dynamic Stochastic General Equilibrium (MS-DSGE) model with deep habit-adjusted consumption in both private and public sectors for Iranian data from 1991 to 2015. A comprehensive New Keynesian Philips Curve (NKPC) is also extracted, including stock of private and public habit consumption in firm's profit maximization problem as a constraint. The model is estimated both with constant parameters and regime switching in monetary reaction function, and it is concluded that the model with regime switching is able to fit the Iranian data better. The results of estimating parameters indicate that the degree of habit formation, together with the persistence of habit stock, are significant parameters. However, it is shown that deep habits do not succeed in reducing inflation in Iranian economy in reaction to a monetary shock. The results confirm that consumption increases and inflation decreases, simultaneously in response to fiscal shocks.


Introduction
This paper seeks to empirically assess the transmission mechanism of monetary and fiscal policies in Iranian economy when deep habits are taken into account both in household and government consumption by applying Markov-Switching Dynamic Stochastic General Equilibrium (MS-DSGE) model and extracts a comprehensive New Keynesian Philips curve (NKPC) fitted to the model.
Deep habits were first introduced by Ravn et al. (2006) in a DSGE model and flexible price environment. They demonstrate that households do not simply form their habits from overall consumption level -i.e. superficial habit-and the habit formation is based on the consumption of individual goods. In this way, supply side is affected. That means, deep habit-adjusted demand function adds to the firm's optimal pricing problem as a constraint. Therefore, future demand faced by firms for each variety of good, depends on the current sale of that specific good, and firms' current pricing of good, affects the future sale of it through its future demand. This effect -named intertemporal effect of deep habits-leads to countercyclical behavior of mark-up. In fact, firms reduce prices by facing high demand of goods in order to create habit and be able to guarantee raising future demand and profits. Moreover, as indicated in Ravn et al (2010), the NKPC changes fundamentally, and some new driving forces such as expected marginal value of future demand and current and expected consumption growth add to inflation dynamics.
Various empirical studies have been conducted to investigate the effect of monetary and fiscal shocks on the dynamics of key macroeconomic variables by including deep habits in the model. Ravn et al. (2010) imply that, as a result of monetary shock, consumption increases; however, due to deep habits, firms have a tendency to keep the price low. Ravn et al (2010) using sticky price/sticky wages model augmented with deep habit, estimate key parameters by limited information approach and demonstrate that the role of deep habit and nominal rigidities in dynamic effects of monetary shock are the same. Counter-cyclicality of firms' markups in response to a fiscal shock is also exploited in Ravn et al (2010). They demonstrate that increasing aggregate demand due to a fiscal shock leads to a raise in labor demand and, consequently, a raise in wages. Including deep habits in demand function causes a decline in markups; therefore, negative wealth effect of fiscal shock may be compensated and thereby, consumption increases. While Zubairy (2010) confirms counter-cyclicality of markups by introduction of deep habits in new Keynesian model, he indicates that for very high degree of deep habits, determinacy is not guaranteed under interest rate rule and Taylor principal is a very weak condition to guarantee stability of the model. In line with Ravn et al (2006), Laith et al (2015) including deep habit in the model as well as discriminating between the price of public and private sector, find out government spending crowding-in of household consumption. While Jacob et al (2013) declare that considering deep habit and price stickiness in the model, simultaneously, can weaken government spending crowding-in of consumption, and depending on how large is the degree of price stickiness, consumption may be crowded out of government consumption. Contore et al (2015) compare deep and superficial habit in a DSGE model using Bayesian estimation technique and evaluate their ability to fit the US data in the model. They show that in comparison with superficial habit, the presence of persistence in the stock of deep habit makes the model improve fitting the data. Lubik & Teo (2011) following Ravn (2010), derive deep habits NKPC considering without the stock of deep habit and estimate its parameters using general method of moment (GMM) in a partial equilibrium model. They confirm that the degree of indexation in obtained NKPC is much lower than standard NKPC.
The present study attempts to derive an extended and comprehensive NKPC including the persistence in the stock of deep habits both in household and public consumption. To the best of our knowledge, the combination of the degree of habit formation and the persistence of the stock of habit in NKPC can strengthen the performance of deep habit in new NKPC. The NKPC derived in this paper is more comprehensive than those obtained in Ravn et al (2010) and Lubic & Teo (2011) in the way that it introduces new driving forces in previous NKPC such as the stock of deep habit in household and public consumption as well as the expected marginal value of the persistency of the stock of deep habit.
Few studies consider superficial habit in DSGE models for Iranian economy (e.g. Fakhr Hosseini, 2014, 2016Marzban et al ,2016;Hemmati et al, 2018), and presumably, no studies have been performed on deep habits in Iranian economy so far. In addition, over the last few decades, Iranian economy has experienced various economic events such as a sharp drop in oil prices in 1998 and consequently, the decline in GDP growth due to the dependency on oil revenues, a significant jump in oil export in 2005 and its deep effect on liquidity growth, the beginning of energy price liberalization in 2008 which led to a further increase in liquidity and intensified inflation, economic sanctions in 2010 and the significant reduction of oil export, a great uncertainty which was created because of the sanctions, and finally, the experience of the most negative economic growth in 2012. These structural changes are shown in fig.1 for some macroeconomic time series from 1990 Q1 to 2015 Q1. In such an environment with changing variances and structural parameters, some parameters of macroeconomic variables such as inflation and output in monetary reaction function may fluctuate over time. As Maih (2015) suggests, regime switching DSGE models are better frameworks for analyzing the dynamics of macroeconomic variables in such economies. To the best of our knowledge, the novelty of this paper is solving and estimating a MS-DSGE model for assessing deep habits in both household and government consumption using Iranian data with the new comprehensive NKPC, derived for the first time across the world.  The rest of the paper is organized as follows: section 2 introduces our DSGE model, section 3 contains MS-DSGE solution and estimation method, section 4 analyzes the results, and section 5 concludes.

The model
The theoretical framework in this paper is based on Ravn et al. (2006). We attempt to build a model based on the main features of Iranian economy, such as the oil sector and the dependency of monetary policy on fiscal policy. Households gain utility from habit-adjusted composite of various consumption goods. Catching up with the Joneses good by good in the composite of consumption along with habit formation in the previous consumption is a feature of these preferences. Deep habits also enter government spending in the same way. Firms behave under monopolistic competition, renting labor and capital from households and using them in the production process.

a. Households
The economy consists of a continuum of identical households with an infinite lifetime, so each household j, has preferences over the consumption of different goods and deep habits for themselves. Following Ravn et al. (2006), deep habit-adjusted consumption of household j is defined as follows: Where ( ) is habit-adjusted composite of consumption of various goods, (0.1) is the degree of deep habit formation, η is the intertemporal elasticity of substitution, and . −1 is the stock of habit in the consumption of good . The expression . −1 evolves over time according to the following equation: Where ϵ (0, 1) indicates the persistence of the stock of habit. is also a markup shock and follows a AR (1) process as follows: The optimal level of consumption demand of good for household , i.e. is obtained from the expenditure minimization problem according to constraint (1): Where, is the price of good and is the price index. According to Leith et al. (2015), habit formation feature is not considered in investment, and therefore, private investment demand function for good will be as follows: One of the apparent features of deep habits is the existence of two sentences in consumption demand in equation (3) that the firm faces. The first sentence contains price elasticity and the second one is a non-elastic sentence that only introduces habit consumption. Under deep habits, an increase in aggregate demand leads to an increase in price elasticity of good , and due to inverse relationship between markup pricing and price elasticity, the markup price decreases. This feature, however, confirms counter-cyclicality of markup even in the absence of price stickiness. Considering this feature in DSGE models, especially for Iranian economy, where price stickiness does not have a strong effect on economic variables is essential whereas in the superficial habits used in most studies, the demand function of good faced by firm, consists of only one sentence as = ( . ) − ( ) , in which the price elasticity is constant and does not depend on the level of aggregate demand. Ravn et al. (2006) indicate that raising demand due to government spending shocks, productivity shocks, and preference shocks are associated with declining in markup.
We assume that representative household utility is a function of consumption, leisure, and real money demand as follows: Where ، and represent habit-adjusted private consumption, the household labor supply, and the real money demand respectively. is preference shock, β is discount factor, , is the reverse of habit-adjusted consumption intertemporal elasticity, is the reverse of labor supply elasticity, and is the reverse of real money demand elasticity. Preference shock follows (1) process as follows: Household will face the following budget constraint: is the nominal net profit gained from the ownership of firms, is lump-sum net taxes, is rental rate on capital, and is the return on nominal private bond holdings. Capital accumulation equation will be also as follows: Where δ is the depreciation rate. Maximizing lifetime utility function subject to constraints (5) and (6) gives the first order conditions with definitions as follows: The equations given above demonstrate labor supply, real money demand, standard Euler equation, and the relationship between rental rate on capital and the return on nominal private bond holdings respectively.

b. The Government
Deep habit consumption in public sector is also included in the model in order to examine fiscal shocks transmission based on Ravn (2012). Theoretically, deep habits in public and private sector are entirely the same. It means that the public sector demand faced by firms is a function of deep habit parameters. The government tends to continue buying from previous sellers, and this leads to reveal deep habits in public consumption.
According to Cantore et al (2014), the government pays to purchase various goods from monopolistic firms and seeks to maximize the amount of habit-adjusted composite of goods subject to budget constraint ∫ ≤ 1 0 , as follows: Where is the degree of deep habit formation in government spending, and . −1 is the stock of the habit of good , the dynamics of which is shown as follows: Where is the persistence of stock of habit in consumption of public sector. The result is the demand function of public consumption which is shown in eq. (13): On the other hand, total government expenditure, , is exogenously determined based on the budgeting process and follows the exogenous autoregressive process as: Government spending is financed through taxes, issuing bonds, and oil income. If the budget deficit occurs, the government finances it by borrowing from the central bank, which means government financial dominance. On the other hand, foreign exchange from oil revenues is also included in the monetary base. Accordingly, the real budget constraint faced by the government is as follows: It is assumed that the tax is a function of gross domestic product (GDP) as follows: Where ( ) is aggregate income from oil-free GDP ( ) and oil income ) ).
= + Considering the dependency of Iranian economy on oil income, it is essential to take it into account in the model as it causes the results of the study to be close to real evidence. Moreover, according to global oil pricing, oil income follows an exogenous (1) process as follows: Where is oil shock and will affect oil sales and consequently, macroeconomic variables.

c. Firms
A variety of goods are produced by firms in monopolistic competition. According to equation (3) and (13), the demand function of good , which the firm faces in both private and public sectors, is as follows: Each firm uses a combination of labor and capital and produces good . Production function with constant return to scale is presented as: Where . defined as the production of goods , and represents the firm's constant cost and is the capital share in production function.
represents technology shock and follows a (1) process.
Minimizing firm's cost subject to production function, and obtaining the first-order conditions from Lagrangian function, gives marginal cost and labor demand functions as follows:

d. Deriving NKPC
In this study, we attempt to derive NKPC by adding private and public sector demand function as constraints into profit maximization process as well as taking into account the persistence in the stock of deep habit. The derived PC is a more complete version than those extracted in studies such as Ravn et al. (2010) and Lubik & Teo (2011).
The unique feature of our extracted PC, is adding some variables such as current and expected private and public consumption, private investment, stock of habits in both private and public consumption as well as marginal value of current demand and marginal value of the stock of habit consumption so that all of them impact on inflation dynamics altogether. Furthermore, along with their impact on the firm's current pricing, they automatically create a kind of nominal stickiness on PC which will affect the transition of monetary policy.
Choosing proper labor and capital, the firm is trying to determine the price so that the profit will be maximized. In this process, following Lieth (2015), the manufacturing firm considers quadratic price adjustment costs as in Rotemberg (1982): Where represents the degree of price stickiness and ̅ = ̅ 1− −1 .
Maximizing the profit subject to constraints (2), (3), (4), (12), (13), as well as firm's resource constraint, gives habit-adjusted NKPC: is defined as marginal utility in two consecutive periods. The results obtained from the first-order conditions of the corresponding Lagrange function in symmetric equilibrium will be the following equations: Where and are marginal values of private and public demand, and and are marginal values of stock of private and public habits respectively. On the other hand, following Ravn et al. (2006), since in symmetric equilibrium, the relative price of each good is equal to one, the relationship between marginal cost and markup will be as follows: Replacing in and in and considering the inverse relationship between markup and marginal cost, we will have and as To derive the NKPC, log-linear form of the above relationships will be written as follows: ̂=̂−̂+ 1 +̂+ 1 +̂+ 1 +̂+ 1 −̂ ̂=̂−̂+ 1 +̂+ 1 +̂+ 1 +̂+ 1 −̂ Finally, log-linear form of equation (28) is obtained as follows: NKPC is rewritten as: It is clear from equation (34) that in comparison with the absence of deep habit, NKPC is affected by various variables in the model. In obtained NKPC, variables such as the composite of consumption in private and public, the marginal value of demand and the marginal value of the stock of habit both in private and public sectors have negative effect on inflation dynamics.

e. Monetary policy
According to Iranian Monetary and Banking Law, Central Bank follows targets such as maintaining the value of money, the balance of payments, and increasing the country's economic growth. However, there is strong evidence in time series of macroeconomic variables that monetary policies are dominated by fiscal policies, which also plays a significant role in financing the government budget deficit. Hence, based on empirical evidence on macroeconomic time series of Iran and as reported by Komijani and Tavaklian (2012), the best tool for monetary policy maker in Iran for achieving its goals, is money growth rate. Thus, the monetary policy reaction function in log-linear form will be: In the above equation, ̇ is the money growth rate and is expressed as follows: and are also parameters related to the response of the money growth rate to inflation gap and output gap respectively, and is monetary policy shock and is defined as (1) process:

f. Market Clearing
The model will be completed by the resource constraint:  (2014) by focusing on the existence of regime switching in GE models, seek to solve these types of models. Foerster (2013) indicates that the parameters of variables such as output and inflation in the monetary policy reaction function face regime switching fluctuations. In line with the mentioned studies, Komeijani and Tavakolian (2012) demonstrate that in monetary reaction function of Iranian economy, coefficient of inflation and output is not constant and the behavior of monetary policy-maker is discretion in various regimes. Therefore, using RS-DSGE models in such economies can give better results compared to those with constant parameters.
In this study, the model is solved based on the algorithm introduced by Farmer et al (2011) considering regime switching in the parameters related to the monetary reaction function. In summary, following Farmer et al (2011)'s solution method of MS-DSGE models, obtained equations system should finally be written as follows: Where X is × 1 vector of endogenous variables, Z is × 1 vector of exogenous variables, is × 1 vector of perturbation component, and Γ 0 , Γ 1 , and Π are parameters matrix of the model , so there will be the unique solution as = ( ) +1 + , in which represents parameters of the model, then is divided into three blocks: where Φ is the block of regime dependent parameters, Σ is the block of variances in regimeswitching volatilities, and Φ ̅ is the constant parameter. s and r represent two state variables which denote unobserved regime and take on values . = 1.2 independently. They follow a first-order Markov chain with the following transition matrix:  (39) is solved using Newton's algorithm and a unique solution is obtained for two various regimes.
The equations system of present study has 28 equations. In the process of solving model, we performed the optimizing of economic agents' behavior as well as extracting the first-order conditions. The steady-state of the variables is calculated, and prior distributions of parameters were determined using both studies available in Iranian literatures and calculating the steadystate of variables.

Estimation
We use 7 observable variables including the consumption of private sector, tax, government spending, CPI inflation, real GDP, and monetary base growth rate from 1991Q1 to 2015Q4. Seasonality of all time series was removed by the X12-ARIMA technique, and the HP filter was used for de-trending of the data obtained from Central bank of Iran. Before estimating the parameters, it is essential to calibrate some parameters which can be calibrated based on the data and calculate some economic ratios in their steady-states which are used in solving model. The average seasonal gross inflation in the period under review is 1.04069; therefore, the annual average is 16%. Consequently, if we have the steady-state of equation (9) as β = ̅ ̅ and consider β as 0.97 according to previous studies, ̅ will be equal to 1.07287, and as a result, the annual interest rate will be 29%, which is in line with Iranian time series evidence. The calibrated parameters based on Iranian time series data and some steady-state economic ratios are presented in Table (1): The prior distribution, mean and, bounds for all estimated parameters are shown in the third, fourth and fifth column in Table (2). Some priors have been drawn, including the inverse of the intertemporal elasticity of substitution , the inverse of Frisch elasticity of labor supply , the inverse of elasticity of money demand , parameter of money growth rate , parameter of Monetary Policy , and parameter of technology from Tavakolian (2015). The prior for parameters such as parameter of government spending , parameter of oil income , and tax coefficient are obtained from associated time series regression. The prior for parameters of monetary policy reaction function is drawn from Tavkolian (2012). As mentioned in Komeijani and Tavakolian (2012), when money growth rate is considered as a monetary policy instrument, both coefficient of inflation and output in monetary reaction function will be negative in order to increase money growth rate in response to output reduction as well as decrease it in response to inflation growth. Other priors are obtained from the steadystate of model.  The posterior distributions of the model are estimated both with no regime shift and in two various regimes by Bayesian approach using modified Kalman filter algorithm, proposed by Kim & Nelson (1999) to evaluate the likelihood function. The estimated parameters of the model and the estimated transition matrix parameters are shown in Table 2.  Table 3 illustrates the results of comparing two estimated models: deep habits model with no regime shifts and deep habits model with regime switching in monetary reaction function. As shown in Table 3, the model with regime switching (with high log likelihood) is able to fit the data better than the model with no regime shift. However, based on the results of marginal log likelihood, MS-DSGE models match Iranian data more than DSGE models. Table 2, the degree of habit formation in household and public consumption and were estimated at 0.36243 and 0.5001 respectively. The persistence of habit stock in household was estimated at 0.83378, while the same parameter for public consumption was estimated at 0.5, suggesting that the stock of habits in public consumption is much weaker than household. In total, the estimated parameters mentioned above confirm the existence of deep habit consumption based on Iranian data. The magnitude of the persistence of habit stock in household consumption is also significant.

As shown in
The estimated value of 11 and 22 indicates a low persistence of regime 1 vs. a high persistence of regime 2. The result demonstrates that under regime 1, monetary base growth decreases in response to a rise in inflation gap. In addition, by reducing the output gap, central bank reacts by increasing the monetary growth rate. In other words, under regime 1, Monetary reaction is more sensitive to output gap rather than inflation gap. The economy seems to be in recession in regime 1.

Impulse responses
In this section the response of key variables to monetary and fiscal shock is analyzed based on the model with regime switching in monetary reaction function, which was shown as the better fit model, and is compared with the theoretical issues in the present study. Figure 2 shows the impact of monetary shock on some key macroeconomic variables. Resulting from a positive monetary shock, the consumption in private sector starts to decrease in both regimes. Decreasing consumption in response to monetary shock is contrary to Ravn et al. (2006). The magnitude of this decreasing in regime 1 is larger than regime 2. Inflation, the output and labor increase in response to monetary shock. Real wages fall due to rising in inflation. In general, the dynamics of the effect of monetary policy shock on selected variables are the same in both regimes. Only their magnitude is different, so that the magnitude of variables responses to monetary shock in regime 1 is larger than regime 2. However, contrary to Rovn (2010) about inflation reduction following the monetary shock, in Iranian economy, which faces liquidity and inflation fluctuations as well as uncertainty in the economy, deep habits consumption is not strong enough to decrease inflation by monetary shock; however, it rises in response to monetary shock with a delay. It can be interpreted that although deep habits do not succeed in reducing inflation in Iranian economy in reaction to a positive monetary shock, they can delay raising it. In other words, firms increase their markup in response to the monetary shock slowly due to deep habits.  Figure 3 shows the impact of fiscal shock on key macroeconomic variables. Consumption starts to increase due to deep habits by fiscal shock in both regimes, but with different magnitude. Moreover, in line with Ravn (2006), in response to a fiscal shock, firms tend to maintain their markup because of deep habits. As a result, inflation starts to decrease by a fiscal shock. The magnitude of decrease in regime 1 is larger than regime 2. In fact, if fiscal shock occurs in regime 2, owing to the dependency of monetary policy on fiscal policy in Iranian economy, as mentioned in previous sections, since the probability of financing this increase in government spending through monetary policy is high, it leads to a boost in liquidity and monetary growth rate as shown in figure 3; therefore, two periods after the shock, firms have to raise their markup. On the other hand, in case of a fiscal shock in both regimes, the rise in consumption will lead to an increase in real wages, and income.

5.conclusion
This paper designs a MS-DSGE model including deep habits consumption in both private and public sectors for Iranian economy by taking into account some Iranian economic features such as oil sectors and monetary growth rate as a monetary tool with quarterly data for 1991-2015. It aims to assess the transmission mechanism of fiscal and monetary shocks. A comprehensive NKPC was derived, including the stock of habit in both private and public sectors as constraints on maximization profit problem. The model was solved using Farmer et al. (2011)'s method and estimated by Bayesian approach with two regime shifts in the parameters of inflation and output in monetary reaction function. MS-DSGE model was chosen because Iranian economy has experienced a lot of fluctuations and regime switching during the last decades. The results of estimating parameters indicate that the parameter of the degree of habit formation and the persistence of habit stock are significant values and therefore, can play a role in changing the shock effect direction. This issue must be considered in policy making. The results also reveal that deep habit can act as a stickiness in response to inflation to both fiscal and monetary policy, which can reduce inflation or delay it. Moreover, Consumption will increase in response to financial shock due to deep habits. On the other hand, if policy makers seek to increase output and consumption by fiscal shock, it seems to achieve the target by considering the effect of deep habit on reducing inflation. The impulse response functions for monetary shock also illustrate that the dynamics of key variables are similar in both regimes, although there are differences in the magnitude. Furthermore, contrary to Ravn et al (2006), deep habits consumption in Iranian economy is not strong enough to decrease inflation by monetary shock. It also leads to decrease in consumption as well as real wages. Therefore, if the target of policy making is to increase consumption as well as decreasing inflation, despite of considering the effects of deep habit stickiness, it seems that a positive monetary shock will not be a good option.