Study shows humans are optimists for most of life