Defining cognitive and functional profiles in schizophrenia and affective disorders