A computer-implemented method for predicting a property value of a sample of a particular sample type, based on a NIR/MIR spectrum obtained from the sample, comprising: applying a wavelet transformation to the obtained spectrum to compute a sample set (111, 311s) of wavelet coefficients in a plurality of wavelet bands (B0, B1, B2); accessing a library comprising a plurality of calibration sets (311-1 to 311-n, 311c) of wavelet coefficients defining a calibration coefficient space, the calibration sets (311-1 to 311-n, 311c) computed by wavelet transformations of respective NIR/MIR spectra (300-1 to 300-n) previously obtained from calibration samples of at least the particular sample type, each calibration set being associated with one or more reference property values (PV-1 to PV-n) of the respective calibration sample, wherein each calibration set in the library has a rank that was determined by a cross-validation of a corresponding local regression model for the respective calibration set with regard to a corresponding property; creating a local PLS model of the to-be-determined property value of said sample by: selecting a predefined number k of nearest neighbors of the sample set in the calibration coefficient space, and computing the local PLS model based on the selected k nearest neighbors and their associated reference property values; wherein a rank of the created local PLS model used for determining said property value of said sample is computed based on ranks of the selected k nearest neighbors; predicting the property value of said sample by applying the local PLS model to the sample set. applying a wavelet transformation to the obtained spectrum to compute a sample set (111, 311s) of wavelet coefficients in a plurality of wavelet bands (B0, B1, B2); accessing a library comprising a plurality of calibration sets (311-1 to 311-n, 311c) of wavelet coefficients defining a calibration coefficient space, the calibration sets (311-1 to 311-n, 311c) computed by wavelet transformations of respective NIR/MIR spectra (300-1 to 300-n) previously obtained from calibration samples of at least the particular sample type, each calibration set being associated with one or more reference property values (PV-1 to PV-n) of the respective calibration sample, wherein each calibration set in the library has a rank that was determined by a cross-validation of a corresponding local regression model for the respective calibration set with regard to a corresponding property; creating a local PLS model of the to-be-determined property value of said sample by: selecting a predefined number k of nearest neighbors of the sample set in the calibration coefficient space, and computing the local PLS model based on the selected k nearest neighbors and their associated reference property values; wherein a rank of the created local PLS model used for determining said property value of said sample is computed based on ranks of the selected k nearest neighbors; selecting a predefined number k of nearest neighbors of the sample set in the calibration coefficient space, and computing the local PLS model based on the selected k nearest neighbors and their associated reference property values; wherein a rank of the created local PLS model used for determining said property value of said sample is computed based on ranks of the selected k nearest neighbors; predicting the property value of said sample by applying the local PLS model to the sample set.