If G is the cumulative number of good moments and B is bad moments, happiness is (rounding the happiness ratio to 3):
happiness = (G/B-3)*G = G^2/B-3G
Seems there could be a physics of happiness from this equation.