This paper proposes the use of dynamic warping (DW) methods for improving automatic sleep and wake classification using actigraphy and respiratory effort. DW is an algorithm that finds an optimal non-linear alignment between two series allowing scaling and shifting. It is widely used to quantify (dis)similarity between two series. To compare the respiratory effort between sleep and wake states by means of (dis)similarity, we constructed two novel features based on DW. For a given epoch of a respiratory effort recording, the features search for the optimally aligned epoch within the same recording in time and frequency domain. This is expected to yield a high (or low) similarity score when this epoch is sleep (or wake). Since the comparison ...