1. A method for identifying a reference substance that matches a sample substance by comparing spectra, the method comprising performing, by a computer system: receiving a sample spectrum of the sample substance, the sample spectrum having an intensity value for each of a plurality of discriminating values of a discriminating property; for each of a plurality of reference substances: retrieving, from a database, a reference spectrum for the respective reference substance, the reference spectrum having intensity values for the plurality of discriminating values of the discriminating property; initially selecting one or more correction values for one or more correction parameters; for each of a plurality of iterations: applying the one or more correction values for the one or more correction parameters to at least one of the sample spectrum and the reference spectrum; computing a similarity score between the sample spectrum and the reference spectrum resulting from application of the one or more correction values; determining whether the similarity score satisfies one or more convergence criteria; when the similarity score satisfies the one or more convergence criteria, identifying the similarity score as an optimized similarity score corresponding to one or more optimized values of the one or more correction parameters; when the similarity score does not satisfy the one or more convergence criteria, updating the one or more correction values for use in performing another iteration; comparing the optimized similarity score to a threshold to determine whether the reference substance is a potential match for the sample substance; and outputting data about one or more of the plurality of reference substances that have optimized similarity scores that are above the threshold.