Methods and apparatus infer or indicate sleep stage(s) of a patient from a respiratory flow rate signal of the patient. The method may include applying a plurality of detection pathways to a signal representing a respiratory flow rate of the patient, wherein each detection pathway is configured to generate start events and end events indicating start times and end times of episodes respectively of a corresponding sleep stage, wherein each start event and each end event has a priority; and combining the start events and end events based on their priorities to produce an indication of the sleep stage of the patient. The apparatus may include a sensor configured to generate a signal representing a property of a flow of air within a patient interface; and a processor configured to implement a method of inferring a sleep stage of the patient from the signal.