His research focussed on the design of efficient markets, an important and growing field that has influenced such things as Treasury bill auctions and decisions on who receives organ transplants. He even got to work with Alvin E Roth, who won a Nobel in economic science in 2012. But prestige was not enough to keep Coles at Harvard.

In 2013, he moved to the San Francisco Bay Area.

He now works at Airbnb, the online lodging marketplace, one of a number of tech companies luring economists with the promise of big sets of data and big salaries.

Silicon Valley is turning to the dismal science in its never-ending quest to squeeze more money out of old markets and build new ones. In turn, the economists say they are eager to explore the digital world for fresh insights into timeless economic questions of pricing, incentives and behavior. "It's an absolute candy store for economists," Coles said.

The pay, of course, is a lot better than you would find in academia, where economists typically earn $125,000 to $150,000 a year.

In tech companies, pay for a Ph.D economist will usually come in at more than $200,000 a year, the companies say. With bonuses and stock grants, compensation can easily double in a few years. Senior economists who manage teams can make even more.

Businesses have been hiring economists for years now. Usually, they are asked to study macroeconomic trends - topics like recessions and currency exchange rates - and help their employers deal with them.

But what the tech economists are doing is different: Instead of thinking about national or global trends, they are studying the data trails of consumer behavior to help digital companies make smart decisions that strengthen their online marketplaces in areas like advertising, movies, music, travel and lodging.

Tech outfits including giants like Amazon, Facebook, Google and Microsoft and up- and- comers like Airbnb and Uber hope that sort of improved efficiency means more profit.

Seeing this emerging job market, the National Association for Business Economics held its first meeting for technology company economists in April in San Francisco. Another is set for October in Silicon Valley.

Academia is also starting to take notice - and adapt. "It's all happening so fast, it's hard to keep up," said Susan Athey, an expert in the economics of technology at the Stanford Graduate School of Business who is also a consultant to Microsoft.

Many economics students also take computer science courses, and some major in both.

But a new course this fall at Yale, called Designing the Digital Economy, seeks to blend economics and computer science in the way digital economists do at tech companies.

The instructor is Glen Weyl, an economist at Microsoft Research, and the course will have guest lecturers from Amazon, Pandora and Uber.

The course is a pilot for curriculum change and perhaps a joint degree program focused on digital markets and their design.

Dirk Bergemann, chairman of the Yale economics department, explained that economics was concerned with efficiency, prices and incentives, while computer science focused on algorithms and complexity.

"In digital marketplaces, you are trying to address both sets of problems," he said.