A longitudinal study of the evolution of cognitive function and affective state in patients with amyotrophic lateral sclerosis