A method for detecting and quantifying the presence of elements or of corpuscles by spectrometry using knowledge of one or more reference spectra, characterised in that it comprises at least the following steps: • measuring one or more radiation originating from one or more sources (100, 101) containing said elements, representing said measurements in the form of a spectrum Y expressed in the form of a vector Y Mx1 of M energy channels resulting from the sum of the N reference spectra, each component of the vector Y Mx1 corresponding to the sum of the contributions of a j-th element represented by its reference spectrum on the i-th channel of the spectrum observed for N measured spectra, an element being associated with a proportion: y 1 ⋮ y M = P a 11 ⋯ a 1 ⁢ N ⋮ ⋱ ⋮ a M 1 ⋯ a MN w 1 ⋮ w N, with y i = ∑ j = 1 N x ij i = 1,..., M being the coefficient of the vector Y M ×1 with i=1...M energy channels and j=1,..., N measured spectra; • initialising with random values the vector W of the proportions of the radioelements present in the spectrum and the vector X of the contributions of the elements represented by their reference spectrum on the M energy channels; • defining a number L of iterations and executing at least the following two steps for l =1 to L: • drawing a component x ij l + 1 of the vector Y of the observed spectrum corresponding to the iteration ( l +1) for a given element j and a reference channel i, using a multinomial distribution Mult() and by considering the values obtained during a previous iteration l, Mult y i; a i 1 w 1 l ∑ j a ij w j l,..., a iN w N l ∑ j a ij w j l, where y i corresponds to the measurement carried out on the channel i, a i 1 w 1 l ∑ j a ij w j l corresponds to the values obtained during the previous iteration l, for the various elements a ij w j l, with j=1,..., N and for the M channels; • using the found values x ij l + 1 to determine, according to a Gamma distribution, a value corresponding to the proportion of an element j, with j varying from 1 to N, on the N reference spectra, with α, β being fixed values; • determining an estimated value for a given element j, w J ̅ ^ ≈ 1 L ∑ l = 1 L w ̅ j l, and associating this estimated value of the proportion of an element with a credibility value. • measuring one or more radiation originating from one or more sources (100, 101) containing said elements, representing said measurements in the form of a spectrum Y expressed in the form of a vector Y Mx1 of M energy channels resulting from the sum of the N reference spectra, each component of the vector Y Mx1 corresponding to the sum of the contributions of a j-th element represented by its reference spectrum on the i-th channel of the spectrum observed for N measured spectra, an element being associated with a proportion: y 1 ⋮ y M = P a 11 ⋯ a 1 ⁢ N ⋮ ⋱ ⋮ a M 1 ⋯ a MN w 1 ⋮ w N, with y i = ∑ j = 1 N x ij i = 1,..., M being the coefficient of the vector Y M ×1 with i=1...M energy channels and j=1,..., N measured spectra; • initialising with random values the vector W of the proportions of the radioelements present in the spectrum and the vector X of the contributions of the elements represented by their reference spectrum on the M energy channels; • defining a number L of iterations and executing at least the following two steps for l =1 to L: • drawing a component x ij l + 1 of the vector Y of the observed spectrum corresponding to the iteration ( l +1) for a given element j and a reference channel i, using a multinomial distribution Mult() and by considering the values obtained during a previous iteration l, Mult y i; a i 1 w 1 l ∑ j a ij w j l,..., a iN w N l ∑ j a ij w j l, where y i corresponds to the measurement carried out on the channel i, a i 1 w 1 l ∑ j a ij w j l corresponds to the values obtained during the previous iteration l, for the various elements a ij w j l, with j=1,..., N and for the M channels; • using the found values x ij l + 1 to determine, according to a Gamma distribution, a value corresponding to the proportion of an element j, with j varying from 1 to N, on the N reference spectra, with α, β being fixed values; • determining an estimated value for a given element j, w J ̅ ^ ≈ 1 L ∑ l = 1 L w ̅ j l, and associating this estimated value of the proportion of an element with a credibility value.