A method is developed for fitting theoretically predicted astronomical spectra to an observed spectrum . Using a hierarchical Bayesian principle , the method takes both systematic and statistical measurement errors into account , which has not been done before in the astronomical literature . The goal is to estimate fundamental stellar parameters and their associated uncertainties . The non-availability of a convenient deterministic relation between stellar parameters and the observed spectrum , combined with the computational complexities this entails , necessitate the curtailment of the continuous Bayesian model to a reduced model based on a grid of synthetic spectra . A criterion for model selection based on the so-called predictive squared error loss function is proposed , together with a measure for the goodness-of-fit between observed and synthetic spectra . The proposed method is applied to the infrared 2.38–2.60 \mu m ISO-SWS data ( Infrared Space Observatory - Short Wavelength Spectrometer ) of the star \alpha Bootis , yielding estimates for the stellar parameters : effective temperature T _ { eff } = 4230 \pm 83 K , gravity \log g = 1.50 \pm 0.15 dex , and metallicity [ Fe/H ] = -0.30 \pm 0.21 dex .