When gas prices fall, Americans reliably do two things that don’t make much sense.

They spend more of the windfall on gasoline than they would if the money came from somewhere else.

And they don’t just buy more gasoline. They switch from regular gas to high-octane.

A new report by the JPMorgan Chase Institute, looking at the impact of lower gas prices on consumer spending, finds the same pattern as earlier studies. The average American would have saved about $41 a month last winter by buying the same gallons and grades. Instead, Americans took home roughly $22 a month. People, in other words, used almost half of the windfall to buy more and fancier gas.

This is not rational behavior. Americans spent about 4 percent of pretax income on gas in 2014. One might expect them to spend about the same share of any windfall at the pump — maybe a little more because gas got cheaper. Instead they spent almost half.

Americans, in short, have not been behaving like the characters in economics textbooks.

There is, however, a pretty good explanation for this kind of pattern. Researchers have found that people treat money as earmarked for particular kinds of spending, a tendency behavioral economists call “mental accounting.” If someone is buying rounds at the neighborhood bar, people tend to treat the money they didn’t spend as “beer money,” and sooner or later they tend to spend it disproportionately on beer. As a result, they end up drinking more beer than they had originally intended.