On 13 December 2018 PlayStation Europe launched "My PS4 Life" promotion videos featuring some of the players' personal stats. It was discovered soon [original Reddit post] to be a gateway to calculating the total player counts for most PlayStation 4 games.
Among some personal stats, every video disclosed player's rarest trophy which included game title, trophy name and, crucially, the precise number of PSN users who had earned it (as of 17-19 November 2018, as we found out). Combined with the percent of players who had this trophy (this information is freely available in PSN) it gave the total player counts in one arithmetic operation.
Here, 1,142,392 players earned the "Cradle" trophy in No Man's Sky. And on playstation.com it was revealed that 28.9% of all players got this trophy. So the estimate of total player counts for No Man's Sky on PS4 = 1,142,392 * 100% / 28.9% = 3,952,913 with a small margin of error.
Eventually, we calculated the total player counts for 320 games and made a list of 100 most popular PS4 titles.
But as Sony teaches us:
Basically, gamstat.com works pretty much the same way as SteamSpy used to work.
We select a large sample of PSN public profiles and determine the percentage of users who played every game, which can be extrapolated to the whole PSN player base with a reasonable margin of error.
What makes it even better, every profile comes with dates when each game was played. So we actually get the relative popularity of each game not only for the date the accounts were retrieved but also for every day in the past, back to the year 2008.
We don't need no "MyPS4Life leak" to learn all the relative numbers that Anthem was three times less popular in February than For Honor, but two times more popular than Mortal Kombat X.
The only point where "MyPS4Life leak" is used is to make them absolute.
Since we can get relative numbers for any day in the past, we "go back in time" to 19 November 2018 and use those numbers for calibration.
For instance, we know that game A was played by 2% of gamers in our sample and had a total of 1,000,000 player counts in November.
And game B, for which we don't have a MyPS4Life video, was played by 3% of gamers.
Thus we can conclude that it had 1,000,000 * 3% / 2% = 1,500,000 player counts in November.
Then we look at recent numbers and learn that game B was played by 4% of gamers by now (i.e. had a 33% growth).
So the recent estimate for game B = 1,500,000 * 1,33 = 2,000,000.
We tried this method on the numbers we already know, and it turned out this technique provides reasonably accurate results within 15% margin of error in most cases.
This is basically how gamstat.com works, with some minor adjustments and tricks behind the scenes.
You can find the more detailed description at Ars Technica.