# UIP Condition in Open Economy

I know this seems like a novice question, but can you solve an open economy/ two country model and abstract from cross-border trade so that there is no UIP condition?

I am not sure I understand the question. The UIP condition follows from trade in international assets. It has, in a first step, nothing to do with cross-border trade. What is it that you are trying to do?

Sorry, I mean if there is no trade in international assets, then there is no UIP condition. If this is true, how does one pin down the nominal exchange rate?

In my opinion, you cannot use a 2-country model in your setting. If, for example, domestic households do not have the opportunity to buy foreign bonds (i.e. save in foreign CCY) and no cross-border trade is present, there is no nominal exchange rate; it’s indetermined.
Why would you use a OE model under full autarky…?

If there is trade in goods, but not in assets then there needs to be balanced trade. This condition should determine the exchange rate.

1 Like

There is trade in goods, just no trade in assets. So how is the nominal exchange rate pinned down from trade balance? I know how to obtain the real exchange rate from the price indexes.

I am not sure I am following. You must have an equation telling you that exports and imports, measured in the same good via the real exchange rate, must be equal at all points in time.

I will apply this as my trade balance equation was just simply expressed in goods i.e.
\begin{align} TB_t = Y_{H,t}^* - Y_{F,t} \\ TB_t^* = Y_{F,t} - Y_{H,t}^* \end{align}

1 Like

Then I don’t understand it. The way you write it down, you can simply sum the goods up, i.e. the are denominated in the same numeraire and there is no reason to convert them using the exchange rate.

This is fine. The model works under the law of one price. How ever whenever i change it to reflect deviations from this condition and add a Gap, dynare tells me that the nominal exchange rate equation is correlated with the variable capturing the deviation from the law of one price. The nominal exchange rate and Law of one price Gap equations are defined as
\begin{align} E_t/E_{t-1} = \frac{\frac{S_t}{S_{t-1}} \Pi_t}{\Pi_t^*}\\ \frac{Gap_t}{Gap_{t-1}} = \frac{\frac{E_t}{E_{t-1}} \Pi_{H,t}^*}{\Pi_{H,t}} \end{align}
Where E is nominal exchange rate and S is real exchange rate. Furthermore, we know that if we assume Gap=1 then we return back to the law of one price, the model works just fine. Similarly, if i normalise the nominal exchange rate to 1 i.e. E=1, the model works fine. I am so confused.

What do you mean with

? What is the error message?

I figured out the problem. My real exchange rate had an estrange value multiplying it. Thank you for your input.

Dear Prof. Pfeifer,

I have some follow up questions. I have computed welfrae in my simulation based on the simple welfare equation welfare = U(c) + beta* welfare(+1).
However, i would like to compute this welfare over a grid of inflation feedback parameter in taylor rule to see how welfare evolves based on the calibrated value of the feedback parameter. Similar to Gali and Monacelli (2016) as they looped over calvo parameters.

After going through the forum, this is what i have and i was wondering if you could give any comment

%----------------------------------------------

% Welfare computation

%----------------------------------------------

% Get variable positions in variable list:

Welfare_pos = strmatch('Welfare',var_list_, 'exact');

% Loop over the interval rho_pi element[0,1]:

space = 0.01:0.01:0.99;

% variances

variance.Welfare = zeros(length(space),1);

for ii = 1:length(space)

set_param_value('rho_pi',space(ii));

stoch_simul(periods=10000,order = 1, irf = 0, noprint)Welfare; % increase the periods for precision

variance.Welfare(ii) = oo_.var(Welfare_pos, Welfare_pos);

L(ii) =variance.Welfare(ii);

end

Graph = L./L(80);

xx=linspace(0,0.99,99);

plot(xx,Graph)


It should be something along the lines of

%----------------------------------------------

% Welfare computation

%----------------------------------------------
% Initial run
stoch_simul(periods=10000,order = 1, irf = 0, noprint)Welfare; % increase the periods for precision

% Get variable positions in variable list:
Welfare_pos = strmatch('Welfare',var_list_, 'exact');

% Loop over the interval rho_pi element[0,1]:
space = 0.01:0.01:0.99;

% variances
variance.Welfare = NaN(length(space),1);
L=NaN(length(space),1);

for ii = 1:length(space)
set_param_value('rho_pi',space(ii));
info = stoch_simul(var_list_);
if info
% parameter created problem, keep value at NaN
else
variance.Welfare(ii) = oo_.var(Welfare_pos,Welfare_pos);
L(ii) =variance.Welfare(ii);
end
end

Graph = L./L(80);
plot(space,Graph)

1 Like

Thank you so much for the kind response i have applied it and it works. My final question relates to the welfare losses. Given i only simulate the model for a taylor rule, then my compensating variation is a \lambda_c that equates the unconditional expected utility to it’s value in the non-stochastic steady state i.e. a \lambda_c that solves
\begin{align} E \sum_{t=o}^{\infty} U(C_t (1+ \lambda_c)) - V(N_{j,t}) = U(C(1-h)) - N({j} \end{align}
Following your Born Pfeifer code, i can calculate the steady state welfare using the steady state values. So does \lambda_c the welfare loss euqal the welfare gap?. i.e.
\begin{align} \lambda_c = (1-\beta)(Welfare_ss - Welfare_t) \end{align}
Secondly, if this is true, how do i implement it in the loop so that i find the vwelfare losses given the looped over parameters.

Sorry, but I don’t understand what you are trying to do here. Please correct and elaborate on the above formulas.

Sorry for my rambling, but in essence, i am trying to calculate welfare loss. However, the analytical closed form loss function for my model is not readily available (following GM 2016).

So i’m asking what the difference between welfare loss and the welfare gap (you calculate in your Born-Pfeifer code).

\lambda above determines the fraction of consumption that equates the unconditional expected utility to utility in the non-stochastic steady state.

The welfare loss is just a difference in lifetime utilities. It is not expressed in terms of easily interpretable numbers. The welfare gap in constrast is measured in percent of consumption. It is often harder to obtain. In our Born/Pfeifer code we therefore approach this problem numerically.

1 Like

It is this welfare loss i am interested in, and how to see the level of welfare loss across the looped policy parameters. I found the page about the same problem, what Phillip was trying to calculate
. Welfare cost of business cycles. So i want to find \lambda_c as well.

Within the loop, you can use the approach in our paper, i.e. call a function that computes the consumption equivalent \lambda_c, i.e. the get_consumption_equivalent*.m at https://github.com/JohannesPfeifer/DSGE_mod/tree/master/Born_Pfeifer_2018/Welfare