Determining the lung compliance and lung resistance of a subject undergoing respiratory therapy using non-invasive ventilation requires taking the presence of leaks into account. In particular, variable and unintentional leaks at or near a subject interface appliance may be dynamically determined based on an average resistance of the leak orifice of the subject.