A method for analyzing a sample, the method comprising: converting a portion of the sample into a plasma multiple times; recording a spectrum of electromagnetic radiation emitted in response to each of the sample conversions to define a sequence of spectra for the sample, wherein each spectrum of the sequence is recorded in response to a different one of the sample conversions: characterised by: scaling the recorded spectra by dividing each spectrum channel by the mean value of the energy used to generate the spectra, obtaining scaled spectra; forming a set of constituent spectra of the sequence of spectra by: using an electronic processor to compare the scaled spectra, wherein scaled spectra are considered to be the same constituent spectrum, if the scaled consituent spectra are sufficiently similar, and wherein scaled spectra are considered to be different constituent spectra, if the scaled constituent spectra are substantially different; using an electronic processor to compare the sequence of constituent spectra for the sample to a sequence of constituent spectra for each of at least one reference sample in a reference library, wherein the comparison by the electronic processor comprises comparing a probability distribution for the constituent spectra of the sequence of spectra for the sample being analyzed to a probability distribution for constituent spectra of the sequence of spectra for each of the reference samples; and using the electronic processor to determine information about the sample based on the comparison to the at least one reference sample in the library. converting a portion of the sample into a plasma multiple times; recording a spectrum of electromagnetic radiation emitted in response to each of the sample conversions to define a sequence of spectra for the sample, wherein each spectrum of the sequence is recorded in response to a different one of the sample conversions: characterised by: scaling the recorded spectra by dividing each spectrum channel by the mean value of the energy used to generate the spectra, obtaining scaled spectra; forming a set of constituent spectra of the sequence of spectra by: using an electronic processor to compare the scaled spectra, wherein scaled spectra are considered to be the same constituent spectrum, if the scaled consituent spectra are sufficiently similar, and wherein scaled spectra are considered to be different constituent spectra, if the scaled constituent spectra are substantially different; using an electronic processor to compare the sequence of constituent spectra for the sample to a sequence of constituent spectra for each of at least one reference sample in a reference library, wherein the comparison by the electronic processor comprises comparing a probability distribution for the constituent spectra of the sequence of spectra for the sample being analyzed to a probability distribution for constituent spectra of the sequence of spectra for each of the reference samples; and using the electronic processor to determine information about the sample based on the comparison to the at least one reference sample in the library. scaling the recorded spectra by dividing each spectrum channel by the mean value of the energy used to generate the spectra, obtaining scaled spectra; forming a set of constituent spectra of the sequence of spectra by: using an electronic processor to compare the scaled spectra, wherein scaled spectra are considered to be the same constituent spectrum, if the scaled consituent spectra are sufficiently similar, and wherein scaled spectra are considered to be different constituent spectra, if the scaled constituent spectra are substantially different; using an electronic processor to compare the sequence of constituent spectra for the sample to a sequence of constituent spectra for each of at least one reference sample in a reference library, wherein the comparison by the electronic processor comprises comparing a probability distribution for the constituent spectra of the sequence of spectra for the sample being analyzed to a probability distribution for constituent spectra of the sequence of spectra for each of the reference samples; and using the electronic processor to determine information about the sample based on the comparison to the at least one reference sample in the library. using an electronic processor to compare the scaled spectra, wherein scaled spectra are considered to be the same constituent spectrum, if the scaled consituent spectra are sufficiently similar, and wherein scaled spectra are considered to be different constituent spectra, if the scaled constituent spectra are substantially different; using an electronic processor to compare the sequence of constituent spectra for the sample to a sequence of constituent spectra for each of at least one reference sample in a reference library, wherein the comparison by the electronic processor comprises comparing a probability distribution for the constituent spectra of the sequence of spectra for the sample being analyzed to a probability distribution for constituent spectra of the sequence of spectra for each of the reference samples; and using the electronic processor to determine information about the sample based on the comparison to the at least one reference sample in the library.