1. A method for estimating a leak flow in a breathing assistance system including a ventilation device connected to a patient, the method comprising: accessing data of a flow waveform indicating the flow of gas between the ventilation device and the patient; identifying a specific portion of the flow waveform; and performing a linear regression of the identified portion of the flow waveform to determine an estimated leak flow in the breathing assistance system.