# Issues replicating Galí (2007) (Heterogenous agents & Government spending)

**URL:** <https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671>\
**Category:** Replication Attempts\
**Created:** [18 March 2021 17:49 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671 "2021-03-18T17:49:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![LetThereBeQE](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/67e7ee/32.png) [@LetThereBeQE](https://forum.dynare.org/u/LetThereBeQE)\
**Post date:** [18 March 2021 17:49 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/1 "2021-03-18T17:49:53Z")

</div>

Dear all,

We are trying to replicate the 2007 paper by Galí, Vallés & López-Salido, “Understanding the effects of government consumption on consumption”, which seeks to model the possible crowding-in effects from government spending shocks on private consumption.  
Modelling the authors’ case for perfect labor markets, we seem to find results relatively close to those of the original paper.  
However, it seems the model becomes unstable (Blanchard-Kahn conditions not verified) when we try to estimate the case for imperfect labor markets. We found this thread, where someone else seemed to have the same issue.  
The crowding-in effects from the government spending shock are greatly affected by the labor market-situation, and relatively non-existent for the perfect labor markets. We are in relatively dire need of getting the imperfect labor markets-case to work for our project, and it can hardly be a mistake on Galí’s side? Their results for the imperfect case are super relevant for us, but we are simply not able to recreate them.  
Are anyone aware of this issue or have managed to solve it?

Thanks a lot in advance!

Our code:  
[Gali\_2007\_v2.mod](https://forum.dynare.org/uploads/short-url/v9b0GbWtkLINidk2w9PJRRYVd7B.mod) (2.8 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:** [19 March 2021 10:32 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/2 "2021-03-19T10:32:02Z")

</div>

I provided you with replication files. They should allow to reproduce the non-competitive labor market.

---

<div class="post-metadata">

**Author:** ![mkader](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/c5a1d2/32.png) [@mkader](https://forum.dynare.org/u/mkader)\
**Post date:** [20 March 2021 00:24 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/3 "2021-03-20T00:24:20Z")

</div>

Hi Johannes. Is it possible to share the replication files?

---

<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:** [20 March 2021 08:17 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/4 "2021-03-20T08:17:02Z")

</div>

I sent it to you via PM.

---

<div class="post-metadata">

**Author:** ![mkader](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/c5a1d2/32.png) [@mkader](https://forum.dynare.org/u/mkader)\
**Post date:** [20 March 2021 20:20 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/5 "2021-03-20T20:20:13Z")

</div>

Thanks a lot. Appreciate it.

---

<div class="post-metadata">

**Author:** ![LetThereBeQE](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/67e7ee/32.png) [@LetThereBeQE](https://forum.dynare.org/u/LetThereBeQE)\
**Post date:** [28 March 2021 10:54 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/6 "2021-03-28T10:54:32Z")

</div>

Thanks a lot!  
We also found minor errors and made our linearized version of the model work. Here it is for future reference: [Gali\_2007.mod](https://forum.dynare.org/uploads/short-url/4KQbbocI51uLXHkfCtrGcve5H1v.mod) (2.5 KB)

---

<div class="post-metadata">

**Author:** ![Maida](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8797f3/32.png) [@Maida](https://forum.dynare.org/u/Maida)\
**Post date:** [29 June 2021 07:21 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/7 "2021-06-29T07:21:07Z")

</div>

Hi Johannes,

Is it possible to share the replication files? Best

---

<div class="post-metadata">

**Author:** ![tomash](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/858c86/32.png) [@tomash](https://forum.dynare.org/u/tomash)\
**Post date:** [14 September 2021 11:57 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/8 "2021-09-14T11:57:46Z")

</div>

Dear mr. Pfeifer, would you be so kind and send the files to me aswell? Thanks

---

<div class="post-metadata">

**Author:** ![giangbae](https://forum.dynare.org/letter_avatar_proxy/v4/letter/g/5fc32e/32.png) [@giangbae](https://forum.dynare.org/u/giangbae)\
**Post date:** [27 February 2022 04:45 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/9 "2022-02-27T04:45:09Z")

</div>

Hello Johannes, would you be able to send me the replication file as well? I’m trying to replicate Gali et. al. (2007) 🙂

---

<div class="post-metadata">

**Author:** ![gabrielf](https://forum.dynare.org/letter_avatar_proxy/v4/letter/g/ad7895/32.png) [@gabrielf](https://forum.dynare.org/u/gabrielf)\
**Post date:** [31 March 2022 10:59 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/10 "2022-03-31T10:59:59Z")

</div>

Hi Johannes, could you also send me the replication file, please? Thank you very much in advance.

---

<div class="post-metadata">

**Author:** ![Jadrian](https://forum.dynare.org/letter_avatar_proxy/v4/letter/j/4da419/32.png) [@Jadrian](https://forum.dynare.org/u/Jadrian)\
**Post date:** [13 June 2022 17:25 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/11 "2022-06-13T17:25:57Z")

</div>

Hello, Johannes I am trying to replicate Gali et al. (2007), could you or anyone with the replication file available, be so kind to share it with me? Thank you so much in advanced.

---

<div class="post-metadata">

**Author:** ![siriy](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/a6a055/32.png) [@siriy](https://forum.dynare.org/u/siriy)\
**Post date:** [31 August 2022 07:24 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/12 "2022-08-31T07:24:37Z")

</div>

Hello Johannes, I am wondering if you could kindly share the replication codes with me as well? I couldn’t find them anywhere on your GitHub. Thank you very much in advanced.

---

<div class="post-metadata">

**Author:** ![laradavid716](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/d6d6ee/32.png) [@laradavid716](https://forum.dynare.org/u/laradavid716)\
**Post date:** [27 November 2022 19:35 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/14 "2022-11-27T19:35:27Z")

</div>

Could you also send me the replication file, please? I’m having problems with the consumption share. I can’t obtain the equation in the Appendix B: Steady State Analysis. Also in this [Gali et al (2007): Consumption SS-Share - #3 by jpfeifer](https://forum.dynare.org/t/gali-et-al-2007-consumption-ss-share/11196/3) they said that equation is flawed.

---

<div class="post-metadata">

**Author:** ![lnarbonne](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/e495f1/32.png) [@lnarbonne](https://forum.dynare.org/u/lnarbonne)\
**Post date:** [16 January 2023 00:26 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/15 "2023-01-16T00:26:12Z")

</div>

Hello Johannes, I am struggling to replicate Gali et al. (2007) as well and your replication file would be really helpful. Could you please send it to me ?

Thank you in advance !

---

<div class="post-metadata">

**Author:** ![veronica\_acurio\_v](https://forum.dynare.org/letter_avatar_proxy/v4/letter/v/a9a28c/32.png) [@veronica\_acurio\_v](https://forum.dynare.org/u/veronica_acurio_v)\
**Post date:** [12 September 2023 08:22 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/16 "2023-09-12T08:22:28Z")

</div>

Hello Johannes,

May you send the this code to me as well ?

Regards,

Verónica

---

<div class="post-metadata">

**Author:** ![OJ08](https://forum.dynare.org/letter_avatar_proxy/v4/letter/o/b38774/32.png) [@OJ08](https://forum.dynare.org/u/OJ08)\
**Post date:** [8 December 2023 07:50 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/17 "2023-12-08T07:50:19Z")

</div>

Professor could you please share the code for Gali et al (2007) with me as well?

---

<div class="post-metadata">

**Author:** ![tomash](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/858c86/32.png) [@tomash](https://forum.dynare.org/u/tomash)\
**Post date:** [2 September 2024 19:20 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/18 "2024-09-02T19:20:18Z")

</div>

Dear prof. Pfeifer,

would you be so kind and share the dynare code with me too?

Thank you

---

<div class="post-metadata">

**Author:** ![Kevlovecon](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/b5ac83/32.png) [@Kevlovecon](https://forum.dynare.org/u/Kevlovecon)\
**Post date:** [7 October 2024 13:50 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/19 "2024-10-07T13:50:33Z")

</div>

Hi Professor. That post is old, but I’m also trying to replicate Gali et al., (2007). Wondering if you could send to me the replication files please? Thank you.

---

<div class="post-metadata">

**Author:** ![TOMX](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/97f17d/32.png) [@TOMX](https://forum.dynare.org/u/TOMX)\
**Post date:** [13 January 2025 11:36 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/20 "2025-01-13T11:36:41Z")

</div>

Dear professor, could you please send me the replication package of GALI2007 JEEA as well? I am interested in how to replicate it via dynare using non-linear equations?  
Thanks a lot.

---

<div class="post-metadata">

**Author:** ![adpinchao](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/aca169/32.png) [@adpinchao](https://forum.dynare.org/u/adpinchao)\
**Post date:** [6 March 2025 07:39 UTC](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671/21 "2025-03-06T07:39:38Z")

</div>

Dear Professor Pfeifer,  
I am also trying to replicate the nonlinear setup of Galí et al. (2007). Could you please share the replication package with me? Thanks in advance

[Next page](https://forum.dynare.org/t/issues-replicating-gali-2007-heterogenous-agents-government-spending/17671.md?page=2)
