Systems and methods for estimating a leak flow in a breathing assistance system including a ventilation device connected to a patient are provided. Data of a flow waveform indicating the flow of gas between the ventilation device and the patient is accessed. A specific portion of the flow waveform is identified, and a linear regression of the identified portion of the flow waveform is performed to determine an estimated leak flow in the breathing assistance system.