A method for automatically selecting the wave numbers best suited for quantitative analysis as well as for simultaneously estimating the parameters in the emerging model is presented. As an indicator of the goodness of the model, Akaike's information theoretic criterion (AIC) is used. Since this approach involves the maximum likelihood estimate of the parameters, the problem of how to scale the data prior to the calculations is eliminated. The method described in this paper is not restricted to Fourier transform infrared (FTIR) problems, but can be applied to other similar problems, where both the model structure and the parameters should be determined. During the calibration stage, a mixed-integer nonlinear programming problem must be solved. It is demonstrated that the use of such modern optimization techniques makes it possible to solve these types of problems without tremendous computational effort. During the prediction stage the obtained model is easy to use.