A method for evaluating the physiological state of a subject, comprising: obtaining at least one speech model constructed from one or more reference speech samples, which were produced by the subject at a first time while a physiological state of the subject was known, the speech model including (i) one or more acoustic states exhibited in the reference speech samples, the acoustic states being associated with respective local distance functions such that, given any acoustic feature vector within a domain of the local distance functions, the local distance function of each acoustic state returns a local distance indicating a degree of correspondence between the given acoustic feature vector and the acoustic state, and (ii) provided that the speech model includes multiple acoustic states, allowed transitions between the acoustic states; receiving at least one test speech sample that was produced by the subject at a second time while the physiological state of the subject was unknown; computing a plurality of test-sample feature vectors that quantify acoustic features of different respective portions of the test speech sample; based on the local distance functions and on the allowed transitions, mapping the test speech sample to a minimum-distance sequence of the acoustic states, by mapping the test-sample feature vectors to respective ones of the acoustic states such that a first total distance between the test-sample feature vectors and the respective ones of the acoustic states is minimized, the first total distance being based on respective local distances between the test-sample feature vectors and the respective ones of the acoustic states to which the test-sample feature vectors are mapped; computing a second total distance between the test-sample feature vectors and the minimum-distance sequence of the acoustic states by weighting the respective local distances by respective weights and summing the weighted local distances, at least two of the weights being different from one another and the second total distance being different from the first total distance; and in response to the second total distance, generating an output indicating the physiological state of the subject at the second time. obtaining at least one speech model constructed from one or more reference speech samples, which were produced by the subject at a first time while a physiological state of the subject was known, the speech model including (i) one or more acoustic states exhibited in the reference speech samples, the acoustic states being associated with respective local distance functions such that, given any acoustic feature vector within a domain of the local distance functions, the local distance function of each acoustic state returns a local distance indicating a degree of correspondence between the given acoustic feature vector and the acoustic state, and (ii) provided that the speech model includes multiple acoustic states, allowed transitions between the acoustic states; receiving at least one test speech sample that was produced by the subject at a second time while the physiological state of the subject was unknown; computing a plurality of test-sample feature vectors that quantify acoustic features of different respective portions of the test speech sample; based on the local distance functions and on the allowed transitions, mapping the test speech sample to a minimum-distance sequence of the acoustic states, by mapping the test-sample feature vectors to respective ones of the acoustic states such that a first total distance between the test-sample feature vectors and the respective ones of the acoustic states is minimized, the first total distance being based on respective local distances between the test-sample feature vectors and the respective ones of the acoustic states to which the test-sample feature vectors are mapped; computing a second total distance between the test-sample feature vectors and the minimum-distance sequence of the acoustic states by weighting the respective local distances by respective weights and summing the weighted local distances, at least two of the weights being different from one another and the second total distance being different from the first total distance; and in response to the second total distance, generating an output indicating the physiological state of the subject at the second time.