# How to establish the two-country model？

Hi,
When establishing the two-country model, I can get the market clearing conditions `y1t=c1t+i1t` and `y2t=c2t+i2t` of the two countries. When programming, one of these two equations is selected to introduce into the model, or neither of them is selected?
In addition, I can find many classical literatures about the two-country model, such as Michael P. Evers (2015). But I don’t know how to get the relevant code. Does anyone know where I should look for the code for the two-country model? I hope to learn more about the two-country model.
Thanks a lot！

1. The Walras Law tells you that you need to omit one of the market clearing conditions. That can be one of the final goods market clearing conditions, but it need not be.
2. You need to check if there are replication codes of prominent two country model papers.

When I was browsing some articles, such as Tae-Seok Jang and Eiji Okano (2013). In their code, the market clearing conditions and household budget constraints of the two countries have a total of four equations, but they only choose two of them, not three equations according to the Walras equilibrium. But I found that there was an equation used to represent “international risk-sharing condition” in their model.
My understanding is that if the two-country model does not consider “international risk-sharing condition”, then three equations are needed, and if “international risk-sharing condition” is considered, then only two market clearing equations or two household budget constraint equations are needed.
Do I understand it correctly? Dr. Jpfeifer .

That is hard to tell without going through the derivations. What you initially termed the market clearing condition is rather the resource constraint. Often, it’s already implied by the budget constraint and the market clearing conditions, i.e. if all market clear and the budget constraint is satisfied, then the resource constraint will also hold. That may be part of the explanation. The risk-sharing condition is often itself a market-clearing condition for bonds.

1 Like
• hello. I noticed your name and I realized that you might be a scholar from China. In the personal homepage " (https://csxy.nufe.edu.cn/info/1010/2066.htm)" of Professor Zhu Jun of Nanjing University of Finance and Economics, there is the code attachment about DSGE, and there is the DSGE code of the two countries’ open model (the most downloaded attachment). I hope this news can help you.

Thank you very much. I am also a scholar from China. I have read Zhu Jun’s code and books, and he also seems to have chosen two market clearing conditions without using the budget constraints of two families, so I am confused about this issue.

Dr. Jpfeifer, could you briefly explain the reason why‘the risk-sharing condition itself is often a market-clearing condition for bonds’?

My wrong understanding is :
In the article of Tae-Seok Jang and Eiji Okano (2013), the risk-sharing condition is `Ct=theta*Ctstar*Qt^(1/sigma)`, this seems to describe the relationship between the changes in the consumption of two families, not the condition for bonds.In addition, this equation replaces the family budget constraint. Therefore, dynare only needs to write two market clearing conditions, no longer write two household budget constraints. This must be wrong in some way, but I couldn’t tell why.

The risk-sharing condition usually results from a particular asset market structure with imposed market clearing, usually a full set of contingent claims.