Post Reply  Post Thread 

Average Debt Rate Doesn't Make Sense

Author Message
Akeron
Senior Member
*


Posts: 442
Words count: 55,516
Group: Basic
Joined: Jun2009
Status: Offline
Reputation: 9
Experience: 151
Glory Points: 0
Medals: 0

Post: #1
Average Debt Rate Doesn't Make Sense

Debt rate -22.56 % -33.21 %

National debt [?] 1,538.49 Bil. € 1,255.85 Bil. €

Gross domestic product (GDP) 6,818.31 Bil. € 7,904.93 Bil. €

Is the discrepancy due to there being a lot of countries with smaller GDPs but more national savings and a few big GDP countries with less national savings? The average numbers don't make sense as is.


Why return? That's a good question.
24.09.2017 14:23
Find all posts by this user Quote this message in a reply
MrProper
天皇
****


Posts: 3,207
Words count: 405,306
Group: Super Moderators
Joined: Nov2011
Status: Offline
Reputation: 220
Experience: 184912
Glory Points: 3842
Medals: 103

Hammerfest
Suebia
Chicago
Galbadia
Timber
Post: #2
RE: Average Debt Rate Doesn't Make Sense

For this case as well as your other recent bug report one could give almost the same answer. Hence, I save some time and elaborate my response in this thread, while giving only a short reply in the other one.

Data displayed in the average state section is occasionally nice for the sake of comparison, but it should not be interpreted as a state in sum. This is simply due to the fact that all of this is based on averaged data, taken from states within a narrow time frame roughly equivalent to the current quarter of your state. You are probably aware of the fact that occasionally here and there a crash occurs, and here lies the inherent problem of averaged values. In particular a singular, yet extreme values tend to ruin entire statistics.

I start with a moderate case as example why the average state should not be considered representative. Take 3 states:
  • State A has a GDP of 7 000 Bil. € and a positive Balance of +1 000 Bil. €
  • State B has a GDP of 10 000 Bil. € and a slightly negative Balance of -1 000 Bil. €
  • State C was subject of experiments by its regent, and about to face exitus. It has a high GDP of 100 000 Bil. € and a massive debt of -450 000 Bil. €
The average state based on these values would have a GDP of 39 000 Bil. €, and a debt of 150 000 Bil. € (almost 4 times the GDP!). I did not calculate the debt rates, but by eye it is easy to see how big they should be round about (like -140%) and that it will not match with the other values.

Looking trough my history, I tried to find a state with some values that would ruin the statics in your example. Unfortunately, I did not have a good match with respect to GDP and debt. Nonetheless, this one should be a good example for debt rate. Once the crash occured, the GDP practically went down to zero. In that sense, this state will have little influence on the average. The debt rate is, however, at 34,220.52 % (Even when averaged with 1000 other states, this will still add a positive 34% on top of the average debt rate).

You see, it is not really a bug, but just a mathematical problem. The developers are aware of it, but there is not much one can do about it. Even if you use a median, you do not get rid of all effects on these numbers.


冥王星違法です

This post was last modified: 27.09.2017 16:33 by MrProper.

27.09.2017 16:31
Find all posts by this user Quote this message in a reply
Akeron
Senior Member
*


Posts: 442
Words count: 55,516
Group: Basic
Joined: Jun2009
Status: Offline
Reputation: 9
Experience: 151
Glory Points: 0
Medals: 0

Post: #3
RE: Average Debt Rate Doesn't Make Sense

...so in other words, the game is taking data from a bunch of states and calculating processed numbers instead of just taking processed data to begin with and averaging it?


Why return? That's a good question.

This post was last modified: 28.09.2017 12:34 by Akeron.

28.09.2017 12:33
Find all posts by this user Quote this message in a reply
MrProper
天皇
****


Posts: 3,207
Words count: 405,306
Group: Super Moderators
Joined: Nov2011
Status: Offline
Reputation: 220
Experience: 184912
Glory Points: 3842
Medals: 103

Hammerfest
Suebia
Chicago
Galbadia
Timber
Post: #4
RE: Average Debt Rate Doesn't Make Sense

Except for the staff of Ars Regendi, nobody knows the actual implementations in Ars Regendi. What I am telling you is based on personal observation and experience, but it is accordance with information made publicly available by the team members of the staff concerned with the actual coding (Malone, Sheep, Benedikt).

So, the answer is: Yes, the statistics of the average state are based on averaged, pre-calculated data from a set of states. The number displayed in the brackets shows you the number of references on which the displayed result is based on. The reason for this is solution is probably the fact that it is quite easy to do statistics on a database, while generating average data in a model is pretty difficult.

It has been pointed out on multiple occasions that outlier have a severe effect on data displayed in the average state by admins in the German section of the forum [1][2]. According to Malone, it is planed to change from averaged to median data as well [3], which would prevent the observed outlier effects. Sheep indicated [4] that this is just very expensive from the computational perspective (or at least not so easy to do), which is probably the reason why it has not been implemented yet.

(The provided links lead you to posts written in German, but I thought you may want to have them nonetheless. After all, Google Translate works mostly well for German <=> English ...)


冥王星違法です
28.09.2017 15:57
Find all posts by this user Quote this message in a reply
TheLastShah
Human Developer
****


Posts: 4,438
Words count: 538,901
Group: Super Moderators
Joined: Sep2013
Status: Offline
Reputation: 200
Experience: 8961887
Glory Points: 1692
Medals: 50

Post: #5
RE: Average Debt Rate Doesn't Make Sense

MrProper Wrote:
Even if you use a median, you do not get rid of all effects on these numbers.


I particularly don't agree with this statement. If we use the median, the quality of the data will rise whilst simultaneously solving this problem - in >90% of the cases.

Probably the only person who will not profit as much is ystradband, since his states usullay run 'til quarter 500 or longer - not much of a "data basis" there to get an average ^^


...wartet immer noch darauf, dass Nietzsche zurückkehrt. Geniales RP findet man hier.

- | - -

Rise early. Work hard. Strike oil.
- J. P. Getty

World Moderator / Inactive due to injury Sad

This post was last modified: 21.01.2018 18:42 by TheLastShah.

21.01.2018 18:42
Find all posts by this user Quote this message in a reply
MrProper
天皇
****


Posts: 3,207
Words count: 405,306
Group: Super Moderators
Joined: Nov2011
Status: Offline
Reputation: 220
Experience: 184912
Glory Points: 3842
Medals: 103

Hammerfest
Suebia
Chicago
Galbadia
Timber
Post: #6
RE: Average Debt Rate Doesn't Make Sense

TheLastShah Wrote:

MrProper Wrote:
Even if you use a median, you do not get rid of all effects on these numbers.


I particularly don't agree with this statement. If we use the median, the quality of the data will rise whilst simultaneously solving this problem - in >90% of the cases.

Once I provide an explanation, you will propably change your point of view. You see, this statement was not aimed at outliers alone.

If you look at Akerons initial post, you will see that he tried to make sense out of the data displayed in the average state, regarding it as an actual state by itself. However, even with a median, this sort of interpretation still will not work. The displayed data set will still be composed based on multiple states. Consequently, if you do some simple math with it, you will still observe discrepancies. To provide an example, you may see a national debt of -1,000 Bil. €, a GDP of 10,000. Bil. € and a debt rate of 12%. (In order to make sense, the later one should be at 10%)

You see what I mean, or do you want me to give another example? Of course you get rid of the majority of outliers (as acknowlegded in my previous post), but the average state will still not be perfect entity.


冥王星違法です
21.01.2018 20:38
Find all posts by this user Quote this message in a reply
Lee Lee
TyPin 2.0 - wer hat meine EP geklaut?
**


Posts: 1,698
Words count: 200,621
Group: Premium
Joined: Aug2014
Status: Offline
Reputation: 85
Experience: 6544
Glory Points: 231
Medals: 12

Post: #7
RE: Average Debt Rate Doesn't Make Sense

MrProper Wrote:
It has been pointed out on multiple occasions that outlier have a severe effect on data displayed in the average state by admins in the German section of the forum [1][2]. According to Malone, it is planed to change from averaged to median data as well [3], which would prevent the observed outlier effects. Sheep indicated [4] that this is just very expensive from the computational perspective (or at least not so easy to do), which is probably the reason why it has not been implemented yet.

The issues is iterative processing and the required amount of saved/applied data. As new data are coming in, you ideally want to not go through all your "old" data to calculate a new average value. For the mean this is easy. You just need to know the number of elements, the old sum and the new value and you can do smth like:

Code:
mean = (old_sum + add_values[]) / amount

... and the whole computation is done. Even for like thousands of new data this is fast and easy.
For the median you would (in the most straight forward way) have to sort the new value(s) into a the list of all old values to find where the new median is. There are methods, I believe, to speed this up, but you will still need to retain every single old value (or grouped values, if possible) within the memory for computation. This is memory intensive and becomes more and more performance expensive with the number of values (old and new) to be processed.

One way to deal with that might be averaging new incoming data to allow for data grouping. Grouped data (like 5.000 times a GDP of around $100.000 Bill) will give the advantage that you only need to go through a small amount of data but your precision will fall off. You could also keep using the mean average and define cut-offs for extremes. Static cut-offs, however, won't allow for changing trends in the way the game is being played, dynamic cut-offs (percentages of the mean average for instance) would allow this in some way but often this suffers from a slowing down of dynamics with an increasing number of items (independently of whether you keep track of every single item or not). Or you deal with it outside of pure math. You could store data within a balanced tree structure which balances around the mean. But you'd have to do this for each state class and each kind of value you want to average. I have never done this myself, so I don't know how much this would require... but... well, I have just found a new project for next week Big Grin

TL;DR
Either you have a fast and cheap algorithm computing the average, that won't deal well with extremes or you will have an accurate and customizable algorithm but it will be sloooooooooooooooooooooooooooooooooooooooooooooooowwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwww... For the sake of game accessibility the game uses most likely the former approach for averaging, which is totally fine in my eyes.

21.01.2018 23:45
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Correlation exchange rate and trade balance hamma13 7 1,611 06.03.2018 11:11
Last Post: hamma13
  "School Attendance" Task Doesn't Make Sense in Theocracy Akeron 0 838 15.11.2017 00:48
Last Post: Akeron
  Net Income and Exchange Rate hamma13 4 1,065 29.09.2017 15:08
Last Post: hamma13
  510% Mortality Rate Akeron 1 826 27.09.2017 16:43
Last Post: MrProper
  Bank Reform 1 Crashes Interest Rate Akeron 0 1,071 22.07.2017 07:07
Last Post: Akeron
Rolleyes Debt not clearing... antonior 4 1,069 13.05.2016 16:13
Last Post: Helsworth
Shy My portfolio doesn't change Shivaranshani 3 1,289 23.02.2016 08:26
Last Post: MrProper
  Why doesn't Universal Health care reflect on GDP? Helsworth 3 1,617 26.01.2015 20:16
Last Post: Helsworth
  No average state Shipanda 2 991 11.04.2013 22:51
Last Post: Shipanda
  Interest rate JosephLJ 2 1,081 07.08.2012 00:06
Last Post: JosephLJ

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: