Money can't make you happy but perhaps math can predict how much less unhappy you will be than if you lived in poverty.

The happiness of over 18,000 people worldwide has been predicted by a mathematical equation, with results showing that moment-to-moment happiness reflects not just how well things are going, but whether things are going better than expected.

The new equation accurately predicts exactly how happy people will say they are from moment to moment based on recent events, such as the rewards they receive and the expectations they have during a decision-making task. Scientists found that overall wealth accumulated during the experiment was not a good predictor of happiness. Instead, moment-to-moment happiness depended on the recent history of rewards and expectations. These expectations depended, for example, on whether the available options could lead to good or bad outcomes.

Does it really work? These kinds of equations take an end result and finds ways to predict it. That is topology matching rather than being predictive.

For this paper, the scholars investigated the relationship between happiness and reward, and the neural processes that lead to feelings that are central to our conscious experience, such as happiness. Before now, it was known that life events affect an individual's happiness but not exactly how happy people will be from moment to moment as they make decisions and receive outcomes resulting from those decisions, something the new equation can predict.

Scientists believe that quantifying subjective states mathematically could help doctors better understand mood disorders, by seeing how self-reported feelings fluctuate in response to events like small wins and losses in a smartphone game. A better understanding of how mood is determined by life events and circumstances, and how that differs in people suffering from mood disorders, will hopefully lead to more effective treatments.

Research examining how and why happiness changes from moment to moment in individuals could also assist governments who deploy population measures of wellbeing to inform policy, by providing quantitative insight into what the collected information means. This is especially relevant to the UK following the launch of the National Wellbeing Programme in 2010 and subsequent annual reports by the Office for National Statistics on 'Measuring National Wellbeing'.

For the study, 26 subjects completed a decision-making task in which their choices led to monetary gains and losses, and they were repeatedly asked to answer the question 'how happy are you right now?'. The participant's neural activity was also measured during the task using functional MRI and from these data, scientists built a computational model in which self-reported happiness was related to recent rewards and expectations. The model was then tested on 18,420 participants in the game 'What makes me happy?' in a smartphone app developed at UCL called 'The Great Brain Experiment'. Scientists were surprised to find that the same equation could be used to predict how happy subjects would be while they played the smartphone game, even though subjects could win only points and not money.

As part of the Great Brain Experiment smartphone app, users are periodically asked how happy they feel. Credit: Robb Rutledge, UCL

Lead author of the study, Dr Robb Rutledge (UCL Wellcome Trust Centre for Neuroimaging and the new Max Planck UCL Centre for Computational Psychiatry and Ageing), said: "We expected to see that recent rewards would affect moment-to-moment happiness but were surprised to find just how important expectations are in determining happiness. In real-world situations, the rewards associated with life decisions such as starting a new job or getting married are often not realised for a long time, and our results suggest expectations related to these decisions, good and bad, have a big effect on happiness.

"Life is full of expectations - it would be difficult to make good decisions without knowing, for example, which restaurant you like better. It is often said that you will be happier if your expectations are lower. We find that there is some truth to this: lower expectations make it more likely that an outcome will exceed those expectations and have a positive impact on happiness. However, expectations also affect happiness even before we learn the outcome of a decision. If you have plans to meet a friend at your favourite restaurant, those positive expectations may increase your happiness as soon as you make the plan. The new equation captures these different effects of expectations and allows happiness to be predicted based on the combined effects of many past events.

This is the happiness equation, where t is the trial number, w0 is a constant term, other weights w capture the influence of different event types, 0 ≤ γ ≤ 1 is a forgetting factor that makes events in more recent trials more influential than those in earlier trials, CRj is the CR if chosen instead of a gamble on trial j, EVj is the EV of a gamble (average reward for the gamble) if chosen on trial j, and RPEj is the RPE on trial j contingent on choice of the gamble. The RPE is equal to the reward received minus the expectation in that trial EVj. If the CR was chosen, then EVj = 0 and RPEj = 0; if the gamble was chosen, then CRj = 0. The variables in the equation are quantities that the neuromodulator dopamine has been associated with in previous neuroscience studies. Credit: Robb Rutledge, UCL

"It's great that the data from the large and varied population using The Great Brain Experiment smartphone app shows that the same happiness equation applies to thousands people worldwide playing our game, as with our much smaller laboratory-based experiments which demonstrate the tremendous value of this approach for studying human well-being on a large scale."

The team used functional MRI to demonstrate that neural signals during decisions and outcomes in the task in an area of the brain called the striatum can be used to predict changes in moment-to-moment happiness. The striatum has a lot of connections with dopamine neurons, and signals in this brain area are thought to depend at least partially on dopamine. These results raise the possibility that dopamine may play a role in determining happiness.