The equation was developed by researchers at University College London (UCL), 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.
The study 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.
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.
The study was published in the journal PNAS.