And the winner of the Amazon HQ2 sweepstakes is …

The Philadelphia skyline, seen from the South Street Bridge over the Schuylkill last month.

And the winner is …

Some very lucky city will hear these words next year when the online mega-retailer Amazon announces where it plans to put its second headquarters. Amazon says it has outgrown its Seattle HQ, and will pick a new city for “HQ2,” which will eventually employ up to 50,000 highly skilled and highly paid workers.

Amazon’s decision will be transformational for that city, and not only because of the tens of thousands of good new jobs. Amazon’s presence is sure to be the catalyst for growth in other high-flying, innovate technology companies.

There will be growing pains, to be sure. House prices and other living costs will rise, making it more expensive for existing residents, and traffic congestion will be more of a problem. Other businesses that will compete with Amazon for talented workers may also be at a disadvantage. But these are minor problems in the grand scheme. Getting Amazon HQ2 will be a huge win.

So, which city is Amazon going to pick? At Moody’s Analytics we took a crack at answering this question by quantifying the criteria that Amazon said it is using to base its decision. To be considered at all, a city must have at least one million in population, of which there are 65 U.S. cities. Philadelphia clearly qualifies.

Local Bids for Amazon's HQ2

Click here for an interactive map of places in the region that have bid for Amazon's proposed second headquarters.

Next, the city must have lots of college grads each year, preferably with computer science, engineering, and math degrees from top-flight schools. No surprise, Philadelphia does well on this count — number eight out of 65 cities — given all the great schools in our region. Also important is that Philly schools produce more such grads than are employed by area businesses, which means there is an ample supply of skilled labor here.

A good transportation system — planes, trains, and automobiles, and probably bikes — matters to Amazon. While the company didn’t say, I suspect having an international airport that is a hub for domestic travel will also be key. Philadelphia does well on this criterion as well, ranking sixth out of 65, given Philadelphia International Airport, Amtrak service, and our commuter rail system.

Like any business looking to make a profit, costs are also important. This includes the cost of doing business, such as the cost of labor, office rents, and electricity, and also the cost of living — and, most important, housing costs. On this score, Philadelphia does less well, ranking 29th out of 65. The advantage we do have is that we are much lower-cost than our nearby competitors, including Boston, New York, and Washington.

Amazon is a global company, and it wants to operate in global cities that have a good quality of life. This means the city should have lots of cultural venues, sports teams, great restaurants, a low crime rate, and good schools. This is where our fair city gets dinged, ranking 45th out of 65. No one will fault our restaurants, but no one thinks the Philly school system is up to snuff.

Finally, there is the general business environment, which is largely about the city and state anteing up to get Amazon. In New Jersey, Gov. Christie says he will provide a package of incentives worth as much $7 billion. That is excessive — the governor is obviously desperate to get a win even if it costs his state a bundle — but it makes sense that Amazon wants to move to a place that is fully committed to having it come. Based on the past willingness of cities and states to use such incentives to attract businesses, Philadelphia ranks 32nd out of 65.

Adding it all up, and equally weighting each of these criteria, the winner is … Austin, Texas, followed by Atlanta and, yes, Philadelphia. The rest of the top 10 are Rochester, N.Y.; Pittsburgh; New York; Miami; Portland, Ore.; Boston; and Salt Lake City. You may be curious where Seattle, Amazon’s current HQ, would land in the ranking if it was included — eighth out of 65.

Here is the really interesting thing, at least from the perspective of Philadelphians: If in addition to the previous criteria one considers that Amazon probably wants its next HQ on the East Coast, then Philadelphia actually becomes the top choice. We don’t win by much, but we win.

Of course, you shouldn’t pop the champagne corks yet. In our analysis, we weighted all of the criteria equally, but that probably isn’t what Amazon will do. If, for example, it gives extra weight to quality-of-life factors and doesn’t consider geography, Philadelphia drops to the bottom of the top 10. And if city and state tax incentives matter a lot to Amazon, then our city falls out of the top 10 altogether.

But whether Philadelphia wins the Amazon sweepstakes or not isn’t the real message in our analysis. It is that Philadelphia has a lot going for it and is on the cusp of great economic success regardless of what Amazon decides.

Mark Zandi is chief economist at Moody’s Analytics. help@economy.com