1. A computer-implemented method of assessing a mental state of a subject, the method comprising: receiving, as input, a heartbeat record of the subject, which comprises a sequence of heartbeat data samples obtained over a time span which includes a pre-sleep period, a sleep period having a sleep onset time and a sleep conclusion time, and a post-sleep period; identifying, within the heartbeat record, at least the sleep onset time and the sleep conclusion time; accessing a knowledge base comprising data obtained via expert evaluation of a training set of subjects and embodying a computational model of a relationship between mental state and heart rate characteristics; using information in the knowledge base, applying the computational model to compute at least one metric associated with the mental state of the subject, and to generate an indication of mental state based upon the metric; and providing, as output, the indication of mental state.