Apparatus for monitoring a subject is described. A sensor monitors the subject during a sleeping session of the subject, and generates a sensor signal in response thereto. A control unit analyzes the sensor signal. In response to analyzing the sensor signal, the control unit performs an action selected from the group consisting of: identifying that the subject is currently undergoing an apnea episode, and predicting that the subject is going to undergo an apnea episode. In response thereto, the control unit changes a position of at least a portion of a body of the subject by activating a device. Other applications are also described.