The disclosure provides a method for controlling the delivery of a breathing gas to a patient. The method may include regulating the delivery of the breathing gas delivered to the patient, determining a value for a first ventilation parameter, comparing the determined value of the first ventilation parameter to a pre-determined target value for the first ventilation parameter, automatically adjusting the breathing gas delivered to the patient in response to the comparison between the determined value of the first ventilation parameter and the pre-determined target value for the first ventilation parameter, and automatically determining a new target value for the first ventilation parameter based at least in part on the determined value of the first ventilation parameter.