A method for analyzing a gas sample, by comparison between a light wave incident on the sample and a light wave transmitted by the sample, the method comprising the following steps: i) illuminating the sample, with a light source, the light source emitting the incident light wave, which propagates to the sample; ii) detecting, with a photodetector called the measurement photodetector, a light wave transmitted by the sample, the transmitted light wave resulting from an attenuation of the incident light wave by the sample; iii) detecting a light wave called the reference light wave (12 ref) with a reference photodetector (20 ref), the reference light wave (12 ref) being emitted by the light source, the reference light wave being representative of a light wave reaching the reference photodetector without interaction with the sample; iv) reiterating steps i) to iii) at various times ( k), called measurement times; the method being characterized in that it further comprises: v) from each reference light wave (12 ref) detected in the various steps iii), at each measurement time, estimating an intensity ( Î ref,k) of the reference light wave (12 ref) at said measurement times, by implementing the following substeps: b) estimating the intensity of the reference light wave ( Î ref,k | k -1) at a measurement time ( k), depending on an initial intensity ( I ref,k =0) or an estimation of the intensity ( Î ref,k -1) of the reference light wave at a prior measurement time ( k -1); c) measuring the intensity ( Î ref,k) of the reference light wave detected at the measurement time; d) updating the estimation of the intensity ( Î ref,k) of the reference light wave at the measurement time, depending on the intensity ( I ref,k) measured in substep c) and the intensity ( Î ref,k | k- 1) estimated in substep b); e) reiterating steps b) to d), on the basis of the estimation of the intensity ( Î ref, k) of the reference light wave obtained in substep d), while incrementing the measurement time; vi) taking into account the intensity ( Î ref,k) of the reference light wave estimated, at each measurement time, i.e. the estimated intensity resulting from step v), and an intensity ( I k) of the transmitted light wave detected in step ii) in order to perform a comparison ( att k), at each measurement time, based on the reference light wave (12 ref) and on the light wave transmitted by the sample; vii) analyzing the gas sample depending on the comparison performed in step vi). i) illuminating the sample, with a light source, the light source emitting the incident light wave, which propagates to the sample; ii) detecting, with a photodetector called the measurement photodetector, a light wave transmitted by the sample, the transmitted light wave resulting from an attenuation of the incident light wave by the sample; iii) detecting a light wave called the reference light wave (12 ref) with a reference photodetector (20 ref), the reference light wave (12 ref) being emitted by the light source, the reference light wave being representative of a light wave reaching the reference photodetector without interaction with the sample; iv) reiterating steps i) to iii) at various times ( k), called measurement times; v) from each reference light wave (12 ref) detected in the various steps iii), at each measurement time, estimating an intensity ( Î ref,k) of the reference light wave (12 ref) at said measurement times, by implementing the following substeps: b) estimating the intensity of the reference light wave ( Î ref,k | k -1) at a measurement time ( k), depending on an initial intensity ( I ref,k =0) or an estimation of the intensity ( Î ref,k -1) of the reference light wave at a prior measurement time ( k -1); c) measuring the intensity ( Î ref,k) of the reference light wave detected at the measurement time; d) updating the estimation of the intensity ( Î ref,k) of the reference light wave at the measurement time, depending on the intensity ( I ref,k) measured in substep c) and the intensity ( Î ref,k | k- 1) estimated in substep b); e) reiterating steps b) to d), on the basis of the estimation of the intensity ( Î ref, k) of the reference light wave obtained in substep d), while incrementing the measurement time; b) estimating the intensity of the reference light wave ( Î ref,k | k -1) at a measurement time ( k), depending on an initial intensity ( I ref,k =0) or an estimation of the intensity ( Î ref,k -1) of the reference light wave at a prior measurement time ( k -1); c) measuring the intensity ( Î ref,k) of the reference light wave detected at the measurement time; d) updating the estimation of the intensity ( Î ref,k) of the reference light wave at the measurement time, depending on the intensity ( I ref,k) measured in substep c) and the intensity ( Î ref,k | k- 1) estimated in substep b); e) reiterating steps b) to d), on the basis of the estimation of the intensity ( Î ref, k) of the reference light wave obtained in substep d), while incrementing the measurement time; vi) taking into account the intensity ( Î ref,k) of the reference light wave estimated, at each measurement time, i.e. the estimated intensity resulting from step v), and an intensity ( I k) of the transmitted light wave detected in step ii) in order to perform a comparison ( att k), at each measurement time, based on the reference light wave (12 ref) and on the light wave transmitted by the sample; vii) analyzing the gas sample depending on the comparison performed in step vi).