Net foreign investment (which is also referred to as net capital outflow) is the total amount of investment overseas done by people in the domestic economy minus the investment from people overseas in the domestic economy.
Imagine that there is a world with only country A and country B who only have 1 asset each which are government bonds. If country A purchases $20 billion worth of country B's government bonds, they have increased their net foreign investment by $20 billion. Conversely, country B's net foreign investment has decreased by -$20 million.
Net foreign investment (NFI) formula
In equilibrium, it must be the case that Net foreign investment (NFI) is equal to net exports (NX) which are the value of exports minus the value of imports.
This has to be true since two countries can trade in either (A) assets or (b) goods. For example, suppose that country A gives $20 worth of bananas to country B. The currency that country B uses to pay country A is considered an asset, as it can be used to purchase bonds. Therefore, we have the condition that:
NX = NFI
Now we can use this to derive a relationship with Savings, by recalling that:
Y - T - C = Private savings and
T - G = Public savings
(Y - T - C) + (T - G) = Y - C - G = Total savings
for a better explanation, see How to calculate national savings.
Now if we re-arrange national income:
Y = C + I + G + NX
Y - C - G = I + NX
and replace NX with NFI we get:
S = I + NFI (since S = Y - C - G)
Example 1: Calculate net foreign investment
Suppose we are told that Y = $100, C = $50, G = $20, T = $20, X (exports ) = $10 and IM (imports) = $20 and we were asked to calculate NFI and I. Firstly, since:
X - IM = -$10
we know that NFI = -$10. Since G= T government savings = 0. So
S = Y - T - C = $100 - $20 - $50 = $30
$30 = I - $10
I = $40
It makes sense that I > S as since we have more imports than exports foreign countries must be investing domestically in our economy. Since imports > exports, we are said to be running a trade deficit.
See here for an explanation of the trade balance, trade deficits and surpluses.
Mankiw, N. (2018). Principles of economics. Boston: Cengage Learning.