A computer-implemented method for predicting a property value of interest of a material, comprising the steps of a) providing a population of infrared spectra of samples, wherein said spectra form an m × n input data matrix X, with m being the number of samples in rows and n being the data points in columns, b) removing spectral outliers from the spectra population of step a), comprising the steps of b1) obtaining the principal components by subjecting the matrix X to a principal component analysis, b2) producing a diagonal matrix Σ, containing singular values σ m of the matrix X, and a loadings matrix V, from the input data matrix X, b3) calculating a score x m for each spectrum by multiplying each data point of the input data matrix X with the loadings for each component of step b2), forming the mean of each column of the X -matrix to provide B 0, m values, and calculating a scoring index si by the formula si = ∑ i x m − B 0, m σ m b4) determining the number of components N c whose eigenvalues lead to a convergence in the regression of X on the scores of at least 99%, and calculating a distance measure threshold value D i for every spectrum of step a), by the formula D i = N C × si 2 × N C N C − 1 2 b5) calculating the mean for all scores of each principal component of each spectrum of step a) and calculating the distance measure between said mean and each of the scores of each principal component, b6) considering a sample spectrum as a spectral outlier when the value of the distance measure for a score of a principle component obtained in step b5) is larger than the distance measure threshold value of step b4), b7) removing the spectral outlier of step b6) from the spectra population of step a) to give a cleaned spectra population, c) generating a prediction function on the cleaned spectra population of step b7), d) providing an infrared spectrum of a sample of unknown origin and/or composition or of the same origin and/or composition as a sample in step a), and e) predicting a property value of interest from the spectrum of step d) by means of the prediction function of step c). a) providing a population of infrared spectra of samples, wherein said spectra form an m × n input data matrix X, with m being the number of samples in rows and n being the data points in columns, b) removing spectral outliers from the spectra population of step a), comprising the steps of b1) obtaining the principal components by subjecting the matrix X to a principal component analysis, b2) producing a diagonal matrix Σ, containing singular values σ m of the matrix X, and a loadings matrix V, from the input data matrix X, b3) calculating a score x m for each spectrum by multiplying each data point of the input data matrix X with the loadings for each component of step b2), forming the mean of each column of the X -matrix to provide B 0, m values, and calculating a scoring index si by the formula si = ∑ i x m − B 0, m σ m b4) determining the number of components N c whose eigenvalues lead to a convergence in the regression of X on the scores of at least 99%, and calculating a distance measure threshold value D i for every spectrum of step a), by the formula D i = N C × si 2 × N C N C − 1 2 b5) calculating the mean for all scores of each principal component of each spectrum of step a) and calculating the distance measure between said mean and each of the scores of each principal component, b6) considering a sample spectrum as a spectral outlier when the value of the distance measure for a score of a principle component obtained in step b5) is larger than the distance measure threshold value of step b4), b7) removing the spectral outlier of step b6) from the spectra population of step a) to give a cleaned spectra population, b1) obtaining the principal components by subjecting the matrix X to a principal component analysis, b2) producing a diagonal matrix Σ, containing singular values σ m of the matrix X, and a loadings matrix V, from the input data matrix X, b3) calculating a score x m for each spectrum by multiplying each data point of the input data matrix X with the loadings for each component of step b2), forming the mean of each column of the X -matrix to provide B 0, m values, and calculating a scoring index si by the formula si = ∑ i x m − B 0, m σ m b4) determining the number of components N c whose eigenvalues lead to a convergence in the regression of X on the scores of at least 99%, and calculating a distance measure threshold value D i for every spectrum of step a), by the formula D i = N C × si 2 × N C N C − 1 2 b5) calculating the mean for all scores of each principal component of each spectrum of step a) and calculating the distance measure between said mean and each of the scores of each principal component, b6) considering a sample spectrum as a spectral outlier when the value of the distance measure for a score of a principle component obtained in step b5) is larger than the distance measure threshold value of step b4), b7) removing the spectral outlier of step b6) from the spectra population of step a) to give a cleaned spectra population, c) generating a prediction function on the cleaned spectra population of step b7), d) providing an infrared spectrum of a sample of unknown origin and/or composition or of the same origin and/or composition as a sample in step a), and e) predicting a property value of interest from the spectrum of step d) by means of the prediction function of step c).