# Optimal policy mix (using loss function)

I want to analyze the welfare effects of macroprudential policy/monetary policy and want to replicate the welfare analysis and optimal policy mix between macroprudential and monetary policy done by Rubio and Carrasco-Gallego (2014)

Here, the loss function is defined as
`L= var(pie) + lambda_Y*var(Y) + var(B)`

`B` being the variability of borrowing, and `Lambda_Y`, the relative weight of the central bank to the stabilization of output.

I want to replicate Table 1, where they compare

1. Benchmark: optimal parameters of the Taylor rule for monetary policy, assuming that
there is no macroprudential regulator.
2. If the central bank and the macroprudential regulator coordinate, they would aim at jointly minimizing the loss function each one with its own instrument.
3. Both authorities act in a non-coordinated way.

Being very new to Dynare and Matlab, I am not 100% certain how to go about modeling this. I have all the structural equations set up (following Gerali (2010) two-type HHs (patient, and impatient (borrowing constraints) with nominal rigidities, financial frictions and monopolistic banks).

So I should add the loss function in my .mod file
`l=var(pie)+ phi_y*var(Y) + var(B)`

and how should I proceed from this? Any help will be very much appreciated! 1 Like

The first step always is to make the model run when picking parameters. Once that is done, you can worry about optimal policy. Note that replications are hard. See Replication of Margarita Rubio's paper: Macroprudential and Monetary Policies for Financial Stability and Welfare

What do you mean by “make the model run when picking parameters”?

The code that I have does run, I can create IRFs, imposing shocks and all (Gerali et al. 2010)
Now I do want to go further and do optimal policy. I would probably need some references as to how to go about it since I have not done this before.

What I am saying is: Table 1 gives you both the optimal parameters and the associated volatilities of some objects. Does your model with these parameters generate the respective volatilities?

Then you can move to finding the optimum starting from Optimal policy parameters in a non-linear model

I see what you mean. No, so I assume that is where I need to start? This is exactly the type of guidance I need. Any reference to how to go about finding the respective volatilities?

You can extract them from `oo_.var`. See e.g. https://github.com/JohannesPfeifer/DSGE_mod/blob/master/Gali_2015/Gali_2015_chapter_4.mod