1. A computer-implemented method comprising: decomposing a training set to obtain a principal component matrix having a plurality of principal component vectors; variably rejecting portions of a sample spectrum vector that do not correspond to a selected one of the plurality of principal component vectors by incrementally: selecting a sub-region of the sample spectrum vector and a corresponding sub-region of the selected principal component vector; and multiplying the selected sub-region of the sample spectrum vector with the corresponding sub-region of the selected principal component vector to provide a coefficient indicative of the weighting of the selected principal component vector for the selected sub-regions; excluding sub-regions of the sample spectrum vector and corresponding principal component vector based on the incrementally provided coefficients; multiplying the sample spectrum vector with the principal component matrix for the non-excluded sub-regions to provide a weighting vector indicative of the contribution of the principal component matrix; multiplying the weighting vector by the principal component matrix to provide a predicted interference vector; and subtracting the predicted interference vector from the sample spectrum vector to provide a corrected spectrum vector.