Learning Motion Primitives for the Quantification and Diagnosis of Mobility Deficits