# SchmittGroheUribe MX model

**URL:** <https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218>\
**Category:** Replication Attempts\
**Created:** [15 January 2018 18:08 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218 "2018-01-15T18:08:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![oper68](https://forum.dynare.org/letter_avatar_proxy/v4/letter/o/51bf81/32.png) [@oper68](https://forum.dynare.org/u/oper68)\
**Post date:** [15 January 2018 18:08 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/1 "2018-01-15T18:08:57Z")

</div>

Hi,

This is the so-called MX model seen in the book of Schmitt-Grohe and Uribe of International Macro. It is a SOE model with 2 sectors (Mportables and Xportables). I have set up the equilibrium conditions just as described in the text. What is missing is the steady state. As a shortcut solution, I try the “initval” command, but it is not reaching a solution. I need help either solving the steady state analytically or tips on finding proper initial values.

Thanks,[tot.mod](https://forum.dynare.org/uploads/default/original/2X/e/e9ae07b3d0e7eaf60a9fcb6d16a20f8b4586efbf.mod) (4.1 KB)

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [16 January 2018 22:39 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/2 "2018-01-16T22:39:02Z")

</div>

You did not define the parameter `beta` and set `dbar` while the parameter is called `d_bar`

---

<div class="post-metadata">

**Author:** ![oper68](https://forum.dynare.org/letter_avatar_proxy/v4/letter/o/51bf81/32.png) [@oper68](https://forum.dynare.org/u/oper68)\
**Post date:** [17 January 2018 02:54 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/3 "2018-01-17T02:54:51Z")

</div>

After fixing that I cannot find the steady state still:

> Error using print\_info (line 83)  
> Impossible to find the steady state. Either the model doesn’t have a steady state, there are an infinity of steady states, or the guess values are too far from the  
> solution

Can I use a solver straight away for the whole system if equations or is that only to complement a few equations?

---

<div class="post-metadata">

**Author:** ![oper68](https://forum.dynare.org/letter_avatar_proxy/v4/letter/o/51bf81/32.png) [@oper68](https://forum.dynare.org/u/oper68)\
**Post date:** [30 January 2018 17:40 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/4 "2018-01-30T17:40:53Z")

</div>

Dear @jpfeifer and others,

I have written the analytical steady state and it works. The problem is that the model only works as long as the parameters used for both sectors are the same. If the Frisch elasticity for labor supply is different in one sector, then the model is not run. Any explanation behind this?

Thanks,  
[termstrade.mod](https://forum.dynare.org/uploads/default/original/2X/b/b776383b8a26557fa46741c2640938dfe3466498.mod) (6.5 KB)

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [2 February 2018 10:58 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/5 "2018-02-02T10:58:17Z")

</div>

Why does it not work? Because the steady state cannot be computed? Your steady state file does not seem to account for asymmetric sectors.

---

<div class="post-metadata">

**Author:** ![oper68](https://forum.dynare.org/letter_avatar_proxy/v4/letter/o/51bf81/32.png) [@oper68](https://forum.dynare.org/u/oper68)\
**Post date:** [2 February 2018 12:52 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/6 "2018-02-02T12:52:19Z")

</div>

Where can I look for models that account for this? Thanks

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [2 February 2018 12:54 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/7 "2018-02-02T12:54:42Z")

</div>

Nowhere. You need to sit down with pencil and paper and compute the solution

---

<div class="post-metadata">

**Author:** ![oper68](https://forum.dynare.org/letter_avatar_proxy/v4/letter/o/51bf81/32.png) [@oper68](https://forum.dynare.org/u/oper68)\
**Post date:** [10 January 2019 15:24 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/8 "2019-01-10T15:24:16Z")

</div>

Dear @jpfeifer,  
This is another version of the file. I am very close to finding the steady state but there seems to be a problem with equations 9 and 10. I do not know why, because they are correctly specified. They are important because they are the equations for prices of import- and export goods, that lead to the terms of trade.[mx2019a.mod](https://forum.dynare.org/uploads/default/original/2X/7/7a40fdf8f4080ef1169ac349c20a496dcdfdf162.mod) (6.5 KB)  
Thanks

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [11 January 2019 07:56 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/9 "2019-01-11T07:56:30Z")

</div>

You can verify in your computations that your computed `ax_o_am` is not consistent with the `ax` and `am` you compute.

---

<div class="post-metadata">

**Author:** ![oper68](https://forum.dynare.org/letter_avatar_proxy/v4/letter/o/51bf81/32.png) [@oper68](https://forum.dynare.org/u/oper68)\
**Post date:** [11 January 2019 14:47 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/10 "2019-01-11T14:47:03Z")

</div>

Ok, I am checking that. But that is what the authors do in their Matlab code:  
[http://www.columbia.edu/~mu2166/book/tot/](http://www.columbia.edu/~mu2166/book/tot/)

---

<div class="post-metadata">

**Author:** ![oper68](https://forum.dynare.org/letter_avatar_proxy/v4/letter/o/51bf81/32.png) [@oper68](https://forum.dynare.org/u/oper68)\
**Post date:** [6 March 2019 17:21 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/11 "2019-03-06T17:21:01Z")

</div>

@jpfeifer[termstrade.mod](https://forum.dynare.org/uploads/default/original/2X/7/71d7764227d4776aea77732bf84963705e086a53.mod) (7.6 KB)  
I have run this model using initial values i get from another file that solved this model analytically. I have used those init values here but I cannot find the steady state, even though in principle, the guesses are not close to the true solution, but should instead _be_ the solution. I have also used the (solve\_algo=4, maxit=10000) as you suggest in other posts but I reach no solution. Can you please suggest a way out without going to the analytical option?

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [7 March 2019 09:27 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/12 "2019-03-07T09:27:20Z")

</div>

If the true steady state values do not solve the model, then there must be a mistake in the model.

---

<div class="post-metadata">

**Author:** ![oper68](https://forum.dynare.org/letter_avatar_proxy/v4/letter/o/51bf81/32.png) [@oper68](https://forum.dynare.org/u/oper68)\
**Post date:** [7 March 2019 09:54 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/13 "2019-03-07T09:54:53Z")

</div>

I have revised the model plenty of times

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [7 March 2019 10:21 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/14 "2019-03-07T10:21:34Z")

</div>

Nevertheless, the steady state and the model equations are inconsistent.

---

<div class="post-metadata">

**Author:** ![oper68](https://forum.dynare.org/letter_avatar_proxy/v4/letter/o/51bf81/32.png) [@oper68](https://forum.dynare.org/u/oper68)\
**Post date:** [7 March 2019 10:34 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/15 "2019-03-07T10:34:45Z")

</div>

can you please elaborate? do you mean the initial values are inconsistent? becuase I removed the steady state and put initval instead

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [7 March 2019 12:52 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/16 "2019-03-07T12:52:36Z")

</div>

You stated that you fed in the true steady state values. If that is true and they are not what Dynare finds, then the steady state does not match the equations entered. Ergo, there must be something wrong in one of the two things.

---

<div class="post-metadata">

**Author:** ![lanfear](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/7ba0ec/32.png) [@lanfear](https://forum.dynare.org/u/lanfear)\
**Post date:** [13 March 2019 20:11 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/17 "2019-03-13T20:11:34Z")

</div>

> [@SchmittGroheUribe MX model](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/13):
>
> I have revised the model plenty of times

Hi, I am trying to replicate the MXN model and I am encountering the same problem. I revised the code and my derivations several times. I couldn’t find what am I doing wrong. I’ got problem at price of importables, the price of exportables, price of non-tradable and price of tradable composite good. I also run the m files provided by uribe and put the steady state values as initvals and it didn’t work… Have you find any solution yet?

---

<div class="post-metadata">

**Author:** ![oper68](https://forum.dynare.org/letter_avatar_proxy/v4/letter/o/51bf81/32.png) [@oper68](https://forum.dynare.org/u/oper68)\
**Post date:** [10 April 2019 17:35 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/18 "2019-04-10T17:35:17Z")

</div>

@jpfeifer can you please help me out? this code has the following problems:

The code appears to work properly, but the IRFs are not making too much sense. Figure 1 should show IRFs after a level shock, and figure 2 the same for a volatility shock, but the figures show the same responses.

Thanks in advance for the help[totana2019.mod](https://forum.dynare.org/uploads/default/original/2X/d/d197e07292f5a164651933a9e85b79bcf496b61c.mod) (7.7 KB)  
,

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [11 April 2019 07:57 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/19 "2019-04-11T07:57:36Z")

</div>

Your simulations are starting the the deterministic steady state, but will converge to the stochastic steady state. What you see is mostly the convergence behavior. Please construct proper IRFs. See e.g. [https://github.com/JohannesPfeifer/DSGE\_mod/blob/master/Basu\_Bundick\_2017/Basu\_Bundick\_2017.mod](https://github.com/JohannesPfeifer/DSGE_mod/blob/master/Basu_Bundick_2017/Basu_Bundick_2017.mod)

---

<div class="post-metadata">

**Author:** ![oper68](https://forum.dynare.org/letter_avatar_proxy/v4/letter/o/51bf81/32.png) [@oper68](https://forum.dynare.org/u/oper68)\
**Post date:** [12 April 2019 10:53 UTC](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218/20 "2019-04-12T10:53:10Z")

</div>

Yes it’s working now. Thanks very much, I appreciate it

[Next page](https://forum.dynare.org/t/schmittgroheuribe-mx-model/11218.md?page=2)
