Is there a formula to work out how many points your association have made during a tournament?

We have come up with many theories as to how you accrue points.

From goals scored, to difference in win loss ratio....but nothing quite adds up correctly
Does anyone know how the points are achieved?