incident light is some function of x y and z at each wavelength the function is determined by directing light at a subject and repeatedly adapting a model until the model outputs an estimated light intensity that is within an acceptable error margin of a detected light intensity the resulting model is then representative of the relationship between detected light intensity and the concentrations of substances x y and z for specific wavelengths of incident light if substance x is the substance whose concentration it is desired to estimate then light including the specific wavelengths on which the model is based i e light of wavelengths that x y and z are responsive to is directed at the subject and the detected light intensity at each wavelength is fed into the model the output of the model is compared to the measured light intensity and the parameters defining the model are altered until the modelled light intensity is within an acceptable margin of the detected light intensity at this point the model is considered to be representative of the subject and the concentration of substance x in the subject can then be calculated from the model if altering the model parameters causes the difference between the estimated spectral response and the actual.