PardeeCenterDU / IFs-Issues-Tracking

This repository only holds the list of bugs that have been reported for IFs. Anyone may add a bug report, but please look to see if your issue has already been added!
2 stars 0 forks source link

External Debt #111

Open A-pirzadeh opened 2 years ago

A-pirzadeh commented 2 years ago

Description: When looking at external debt for the world decomposed, some countries appear to have extreme levels of debt. The two lowest in the screenshot being the UAE and Puerto Rico. Date Found: 10/13/2021 IFs Version: 7.77 Found by: Resource Team

image

PardeeCenterIFs commented 2 years ago

This problem looks much worse in version 7.58 (on the web), the top country is TimorLeste, and at least that is fixed. The bottom is Qatar and it reaches -10,965% by 2100. The variable used is XDEBTRPA.

image

PardeeCenterIFs commented 2 years ago

It looks like in the case of Qatar it's coming from Government debt: image

and it looks like Government debt is mainly affected by the current account flow in XGOVTDEBTBF:

''       Government External Debt Changes Needed/Available for Balancing
''           Could be Short-term, Mid- to Long-Term; IFI sources, etc.
''       ---------------------------------------------------------------
        If AID(R%) > 0 Then
            LoanPortion = AID(R%) * aidlp(R%)
        Else 'Donors
            LoanPortion = AID(R%) * WorldAidLP
        End If

        sxgovtdebtb(R%) = XGOVTDEBTB(R%) + XGOVTDEBTBF(R%) + LoanPortion
        sxgovtdebt(R%) = sxgovtdebtb(R%) + XIMFCREDIT(R%) + XWBLOANS(R%) 'Basic Govt Debt + IFIs
            'Need to build dynamics for IFIs;
            'Ukraine especially problematic with growing IFI debt

The flow seems to be comming mainly from Currect Account:

' Government External Debt Changes Needed/Available for Balancing ' Could be Short-term, Mid- to Long-Term; IFI sources, etc. ' ---------------------------------------------------------------

        XGOVTDEBTBF(R%) = -CURACT(R%) - CapActLim '+ delxreserves
            'Reserves as liability in one country are asset elsewhere, so until spread
            '   across origin-target countries should not add to debt
            'Net IMF and WB contributions to capactlim are not now being balanced by
            '   subscriptions as asset
            'Ultimately, world sum of XGOVTEDBTF should be 0

In conclusion big surpluses in current account end up as big negative debt, i.e. loans

PardeeCenterIFs commented 2 years ago

Check initial conditions

PardeeCenterIFs commented 2 years ago

The worst case for initial conditions is Brunei, whose External Debt as % of GDP is 1000%, so 10 times bigger than GDP: About 170 Billion $ vs a s GDP of about 17 Billion$. There's no actual data on debt for Brunei (CXDEBTRPA - SeriesXDEBT), so we use CXDEBTRPA = CXDEBTACC, where:

For YearCount% = 1960 To iBaseYear DebtAdd = (ImportAnn - ExportAnn - AidRecAnn + AidDonAnn) / 100 * GDPANN 'Debt is positive for debtors, negative for creditors CXDEBTACC(ICount%) = CXDEBTACC(ICount%) + DebtAdd Next

This process accumulates to about 200 Billion$, which is very big, for positive values we have a limit, we probably should also have a limit for negative values:

    'bbh 2016/04/06  process not very good, e.g. Timor-Leste; bound it
    CXDEBTACC(ICount%) = Amin(CXDEBTACC(ICount%), 2 * CGDP(ICount%))

I propose we add: CXDEBTACC(ICount%) = AMAX(CXDEBTACC(ICount%), -2 * CGDP(ICount%))

This is how it affects external debt for Brunei: image

still didn't help the UAE: image

PardeeCenterIFs commented 2 years ago

Barry says:

Agreed that initializing Brunei as we are doing appears not to be working. I did a search on net foreign assets Brunei and it brought up a link to the Knoema World Data Atlas system, second image below and gave me a number for Brunei that after conversion to dollars is about 70% of GDP, much lower than our system is producing. I then searched on World Data Atlas to see if I could get a table for the world. Turns out that they sell the product access, not expensive, but not clear to me how good. I went through he signup process without paying and was able to find that they link access to many sources including WDI. Going into WDI I found the page just below and see that they have a net foreign assets series; If not already in IFs, probably should pull. If in IFs, we should consider using to initialize. In the meantime, your quick fix looks to be a good idea. image image

PardeeCenterIFs commented 2 years ago

José:

Are you saying that CXDEBTACC could be initialized with Net Current Asssets data? This is an internal variable with no ifsVar definition, the top label says: Integrate Debt Caculation Using Current Account Data, is that the same as Net Current Assets? Or maybe you’re suggesting to use Net Current Assets a limit for negative values of CXDEBTACC.

Barry says:

I think that having that series (converted to dollars) to look at and learn about gives us a potential check on and alternative to the historical integration approach. Part of me wonders if the historical integration approach is missing one huge factor, namely the skimming of national current account earnings and potential net assets off into the personal foreign bank accounts of corrupt leadership, away from official holdings that can effectively be retrieved and used by the country. Unless our historical data that goes into that historical integration are wrong or missing some key variable (e.g. remittances), the historical integration approach theoretically should be pretty good. And some countries like the UAE (if corruption is not too bad) could actually continue to run surpluses and build national net assets for a few decades yet, creating huge ratios to GDP.

This whole area is messy in terms of data, but having a dataset of official national values of net assets/liabilities should help us explore it more and might well be how we want to initialize the series.

PardeeCenterIFs commented 2 years ago

I have now asked Yutang to include this series in our database.

quciet commented 2 years ago

The data team created this series from WDI, called SeriesNetForeignAssets%GDP. It is in IFs 7.82 now, someone should test it and see if it helps with our initialization.

Thanks, Yutang

PardeeCenterIFs commented 2 years ago

I see that Net Foreign Assets are around 50-80% of GDP for Brunei.

image

I see that in the code for debt we’re actually not using the data for Aid, notice how AidDonAnn and AidRecAnn are set to 0, right before computing DebtAdd, so we’re only using Imports and Exports.

'bbh 2014/07/29 start AidGrant share is based on SeriesAidRec%GNI, which has 'inappropriate data; may put back in later, but now not necessary If (AidGrantShare.HasValue) Then AidDonAnn = AidDonAnn (1 - AidGrantShare / 100) AidRecAnn = AidRecAnn (1 - AidGrantShare / 100) End If AidDonAnn = 0 AidRecAnn = 0 'bbh 2014/07/29 end 'bbh 2016/04/06 'DebtAdd = (ImportAnn - ExportAnn - AddRecAnn + AidDonAnn) / 100 GDPANN DebtAdd = (ImportAnn - ExportAnn - AidRecAnn + AidDonAnn) / 100 GDPANN 'Debt is positive for debtors, negative for creditors CXDEBTACC(key) = CXDEBTACC(key) + DebtAdd

PardeeCenterIFs commented 1 year ago

External debt looks much better in version 7.97, although the new country Sahrawi (not included in the imgae) is now a problem.

image

PardeeCenterIFs commented 7 months ago

Sahrawi looks ok in version 8.17: image

PardeeCenterIFs commented 7 months ago

More problematic are Mozambique and Kiribati:

image

image