A method of determining an estimated leak flow Qest in a gas delivery system is provided that includes determining for each of N breaths (N>1): (i) an average total flow Formula (I) of the gas delivery system, and (ii) M values of Formula (II) (M>1) using M gamma values, wherein each P is a leak pressure of the gas delivery system and each gamma value is an integer or non-integer real number, determining which one of the gamma values results in a minimum variation of the values of a coefficient g over the N breaths, wherein for each breath and each gamma value the coefficient g is determined by Formula and determining the estimated leak flow Qest using at least the determined one of the gamma values.