One night in 1975, Richard Thaler invited a bunch of his graduate economics student mates over for dinner. While they waited for the cooking to finish he put out a bowl of cashews.
But noticing everyone was getting stuck in, he decided he'd better take them away. His mates thanked him for doing it. It was a lightbulb moment for the young economist.
Why? Because the assumptions of the conventional economics they were studying said such a thing couldn't happen.
Each of us is assumed to have complete control over our appetites and urges. We eat no more cashews than we know is good for us.
We certainly don't need some agent of the Nanny State to limit our freedom by stepping in and taking the bowl away.
Were such a thing to happen, we wouldn't be pleased. We certainly wouldn't thank the perpetrator of this intervention.
So why did it happen? Because, contrary to the conventional model, all of us have problems stopping ourselves from doing things we know we'll regret. In one part of our lives or another, we have a problem with self-control.
And we're grateful rather than resentful when someone steps in to help us with our problem.
From then on the young Thaler – obviously a bit of a rebel and troublemaker – began compiling a list of what he came to call "anomalies" – things people actually did that the conventional model assumed they didn't.
Thaler tells the story of those cashews in his latest book, Misbehaving. It's an apt title because the book charts the development of a new school of economic thought known as "behavioural economics".
Behavioural economics studies the differences between the way people in the economy actually behave and the way the model assumes they do.
In deference to academic economists' obsession with mathematics – a preoccupation that began only after World War II, led by men such as Sir John Hicks, Kenneth Arrow and Paul Samuelson – younger behavioural economists search for ways to make more realistic the assumptions on which mathematical models of the economy are built.
Thaler says behavioural economics has three essential elements: bounded rationality (see below), bounded willpower (see above) and bounded self-interest – we can be more generous to others than the model assumes.
So what are the origins of "BE"? In their book, Animal Spirits, George Akerlof and Robert Shiller argue that John Maynard Keynes was the first behavioural economist.
Thaler says Keynes was "a true forerunner of behavioural finance". (Behavioural finance is the part of behavioural economics that focuses on behaviour in financial markets.)
Keynes argued that individuals' "animal spirits" – his word for their emotional responses – played an important role in their decision making. At times this could discourage business from investing, thus strengthening the case for governments to use their budgets to stimulate the economy.
Keynes wrote his magnum opus in 1936. But Thaler takes BE's origins back to the founder of economics, Adam Smith, and the less famous of his two books, The Theory of Moral Sentiments, published in 1759.
Smith was "an early pioneer of behavioural economics" because of his detailed description of problems of self-control.
A more obvious forerunner is the American academic Herb Simon who, in 1957, coined the term "bounded rationality" and was later awarded the Nobel prize in economics for his trouble.
Bounded rationality is the idea that people's ability to make "rational" – coolly calculating – decisions is limited by the information available to them, the trickiness of the decision, the brain's inadequate processing power and the time available for thinking about it.
Many people probably assume, however, that the true originator of BE is the Princeton psychologist Daniel Kahneman who, with his late partner, Amos Tversky, began in the early 1970s identifying the many "heuristics" (mental shortcuts) and biases that cause humans' decision making to be less than rational.
Behavioural economics has long been about incorporating the insights of psychology into economics. So it was no great surprise when the psychologist Kahneman was given the economics Nobel in 2002.
Thaler moved to California in 1977 to work with Kahneman and Tversky for a year, but that was because he'd already done a lot of thinking about "anomalies". His book leaves me in little doubt that he's the economist who should get most credit for establishing BE as a respectable subject for economists to study.
Thaler began writing a column about "anomalies" from the first issue of the American Economic Association's new Journal of Economic Perspectives in 1987.
In 1991 he teamed up with Shiller (who in 2013 got the Nobel for his work in behavioural finance) to organise a semi-annual workshop on behavioural finance under the auspices of the National Bureau of Economic Research.
One breakthrough in BE came when it was demonstrated that people's mental biases were systematic – that we were, in the title of Dan Ariely's book, Predictably Irrational.
If non-rational behaviour is predictable, it can and should be incorporated into economists' models.
And if people make predictable mistakes when buying shares and so forth, there ought to be scope for other investors to make a buck by betting against them.
Little wonder behavioural finance quickly gained a following in financial circles.
In economics, however, it's said that new ideas gain ascendancy "one funeral at a time". Oldies have a vested interest in preserving the received wisdom, but young academics are attracted to new and interesting ideas that seem to better explain the world.
Thaler's best-selling book with Cass Sunstein, Nudge, showing how governments can nudge people towards making more sensible decisions, led to the setting up of Britain's Behavioural Insights Team and copycat outfits in many countries, including Oz.
These days, BE is offered in most undergraduate university courses. So behavioural economics is now firmly rooted and can only grow in its influence on economists' thinking.