Fireworks explode behind the Olympic rings during an inauguration ceremony at Madureira Park in Rio de Janeiro. (Felipe Dana/AP)

Just two weeks before the opening of the 2016 Rio Olympics, athletes are training furiously, tourists are packing their bags, and researchers are fine-tuning their predictions.

Predicting the number of medals that each country will bag at the Olympic Games has long been a pastime of betting markets. But researchers at the Tuck School of Business at Dartmouth College have also been known to get in on the game. Earlier this week, Camila Gonzales, a graduate of the school, released predictions for how many gold medals and total medals each country will win in the 2016 Olympics, based on a prediction method developed by Tuck professor Andrew Bernard and another professor more than 10 years ago.

Their method of forecasting a country’s Olympic success is incredibly simple, but the researchers say it’s also the most accurate model out there. It predicted the total medal count for the London Olympics with 98 percent accuracy, they say.

For 2016, their model predicts that the United States will come out on top, winning 105 medals overall, ahead of China with 89, Britain with 67, Russia with 62 and Germany with 48. They also predict that the United States will lead the gold medal count with 48, followed by China with 38.

What’s fascinating about their method is that it doesn’t rely on any knowledge about the sports or athletes themselves. Instead, it mostly comes down to economics.

They forecast medal totals based on only four factors: A country’s population, its comparative level of wealth, its performance in previous Olympic Games, and whether it is hosting that year’s Olympic Games.

A country’s population is important because the larger it is, the bigger the potential pool of talented athletes that country has to draw on. However, population alone isn’t the key — it’s not as if China, India, Indonesia and Bangladesh are always at the top of the Olympic medal counts, after all.

That’s because a country’s wealth, which the researchers measure as per capita income, also plays a big role. Just looking at pure, raw talent, we’d expect to find potential Olympic athletes equally distributed over the world’s population. However, in order for that talent to be realized, a country needs certain resources — the urban space and money to invest in the kind of infrastructure that athletes need, like swimming pools and soccer fields, as well as the leisure time for kids to play sports.

The researchers say that these two factors, wealth and population, can sometimes substitute or compensate for the other. In the 2012 London Summer Olympics, for example, India — a very populous country with relatively low per capita income — won about the same number of medals as Switzerland, a very small but rich country. China, which has come in second behind the United States in overall medal totals in past Olympic Games, has relatively low per capita income, but compensates for that with its huge population, the world's largest.

While population and wealth explain most of the results of the Olympics, contributing about equally to the results, the researchers say there are a few other factors they need to take into account. One is the so-called “home field advantage,” which the data shows has been an influential force in Olympic Games. Athletes may be more motivated to perform in front of an enthusiastic audience of their compatriots, and host countries also often lead the introduction of new sports at which they themselves excel.

Finally, they find that past performance is also a predictor of future success. This is in part because talented trainers and athletes are “durable” — they tend to compete and win over multiple Olympic Games.

Interestingly, the researchers have found that Soviet countries experienced a medal boost during the Communist era, with Soviet satellite states winning roughly 3 percent more medals than the model predicted. This effect no longer exists, but the researchers say it is evidence that the Communist bloc was particularly successful at mobilizing resources to “manufacture” gold medals.

This year, the researchers say they don’t expect Brazil to benefit as much from being a host country as some past hosts, like China and Britain, have done. “Brazil didn’t win a lot of medals in the last Olympics,” says Gonzales. “You have to have the resources and you have to direct it. It doesn’t have a super high income per capita, and it doesn’t focus a lot of its investments in sports and athletes.”

Overall, Gonzales says they are very confident about the model's performance for the upcoming Olympics. However, there is one area of uncertainty. They have revised the Russian total down significantly compared with the London Games, due to a doping scandal that has barred its track and field teams from competing. Russia could still be banned from the games entirely -- and Gonzales says that would introduce a lot of uncertainty into the model.

“We could have a few surprises. In some ways, it could make the Games more egalitarian, because if you don’t have a huge player that wins a lot of gold medals, there is an opportunity for other countries.”

You might also like: 

Three basic mistakes people make at casinos, according to a math expert

How to predict the future better than anyone else

There’s a mathematical reason you’re less popular than your friends