Good luck, lady. Photo: Jacobs Stock Photography/Getty Images

It’s pouring rain. You’re running late. You desperately want to take a cab to the office. But, of course, there are none to be found. Happens all the time, right? Right, says science — or, to be specific, a new and exhaustive economic analysis of New York City taxi rides and Central Park meteorological data.

In the study, published by the National Bureau of Economic Research, the Princeton economist Henry S. Farber cross-references weather readings with data on the nearly billion taxi trips taken in the city between 2009 and 2013. (“These are more data than I can use efficiently, and much of my analysis is based on a random sub-sample,” he dryly notes.)

He finds that taxi occupancy rates climb 4.8 percent when it is raining, an indication of increased demand. But he also finds that the supply of cabs falls 7.1 percent. That’s your recipe for damp and desperate arm-waving, soaked tourists, and frizzy hair right there.

Farber also takes a stab at explaining why it is so hard to catch a cab in the rain, including knocking down a couple of reasonable-sounding theories.

Theory one: “The answer from an economist 20 years ago would have been that rainy weather increases the demand for taxi rides and there is no or an insufficiently rapid supply response to meet this transitory demand increase,” Farber writes. Perhaps because the cab shift structure, rain, and the promise of additional fares do not induce more drivers onto the road. But a major study of New York City cabs — there are more than you might think — from the mid-1990s looked at actual driver behavior and found that explanation a little thin.

Enter theory two, which centers on what economists call “income targeting.” The idea is that cab drivers work until they hit a certain earnings tally and then they quit, rain or shine. When the weather is wet and demand for taxis goes up, it is easier for cabbies to hit their target. They then head home early, leaving thousands of stranded passengers. But Farber throws cold water on that explanation.

Finally, we come to theory three, backed up by those billion data points. Farber finds that cab drivers do not actually earn any more per hour when it is raining. Occupancy increases, but traffic slows the cabs down. It’s a wash in terms of drivers’ hourly income. Furthermore, Farber casts doubt on the “income targeting” theory writ large. He argues that most cab drivers measure their day’s work by hours as well as earnings, and argues that their decisions to call it quits are “a function of many things, including accumulated hours, accumulated income, time of day, day of week, location in the city, etc.”

Farber adds another, more prosaic reason that drivers do not spend more time picking up fares when it is wet out, beyond the fact that it is not more lucrative to do it: Cabbies just find it unpleasant to drive in the rain.

So how to make supply and demand match up, and make sure you can hail a cab when you’re late and it is raining out? Just as Uber uses surge pricing, Farber suggests a rain surcharge that would boost drivers’ earnings and keep more taxis on the road.