A computer-implemented method for estimating peak intensities in pulse height spectra obtained by wave-length dispersive X-ray fluorescence spectrometers, comprising: receiving a pulse height spectrum obtained by a multi-channel analyzer of a wavelength-dispersive X-ray fluorescence spectrometer from a sample; generating a pulse height spectrum model with a plurality of diffraction order profile ensembles by: creating a plurality of diffraction order profiles with predefined profile shapes at photon energy positions corresponding to respective diffraction orders of a monochromator of the spectrometer, wherein the widths of the diffraction profiles are determined by using a calibrated width model reflecting dependencies of the widths on respective energy positions and total incoming count rates of a detector of the spectrometer, and wherein the relative positions of the diffraction order profiles are determined by their respective energies and a pulse-height-to-energy mapping; for created diffraction order profiles where the corresponding photon energy is higher than the edge energy of the detector material of the detector, adding a respective escape profile at the position of the photon energy of the diffraction order profile diminished by the fluorescence energy of the photon escaped from the detector material, wherein the intensity of the escape profile is determined by using a calibrated escape intensity model reflecting dependencies of the intensity on respective energy positions; wherein a particular diffraction order profile ensemble comprises all generated profiles associated with the respective diffraction order; adjusting pulse-height-to-energy-mapping parameters and contribution area of each diffraction order profile ensemble of the pulse height spectrum model using a fitting algorithm to minimize the difference between the pulse height spectrum model and the received pulse height spectrum; and providing the contribution area of the first order profile ensemble as the intensity at the energy to be determined by the wavelength-dispersive X-ray fluorescence spectrometer. receiving a pulse height spectrum obtained by a multi-channel analyzer of a wavelength-dispersive X-ray fluorescence spectrometer from a sample; generating a pulse height spectrum model with a plurality of diffraction order profile ensembles by: creating a plurality of diffraction order profiles with predefined profile shapes at photon energy positions corresponding to respective diffraction orders of a monochromator of the spectrometer, wherein the widths of the diffraction profiles are determined by using a calibrated width model reflecting dependencies of the widths on respective energy positions and total incoming count rates of a detector of the spectrometer, and wherein the relative positions of the diffraction order profiles are determined by their respective energies and a pulse-height-to-energy mapping; for created diffraction order profiles where the corresponding photon energy is higher than the edge energy of the detector material of the detector, adding a respective escape profile at the position of the photon energy of the diffraction order profile diminished by the fluorescence energy of the photon escaped from the detector material, wherein the intensity of the escape profile is determined by using a calibrated escape intensity model reflecting dependencies of the intensity on respective energy positions; creating a plurality of diffraction order profiles with predefined profile shapes at photon energy positions corresponding to respective diffraction orders of a monochromator of the spectrometer, wherein the widths of the diffraction profiles are determined by using a calibrated width model reflecting dependencies of the widths on respective energy positions and total incoming count rates of a detector of the spectrometer, and wherein the relative positions of the diffraction order profiles are determined by their respective energies and a pulse-height-to-energy mapping; for created diffraction order profiles where the corresponding photon energy is higher than the edge energy of the detector material of the detector, adding a respective escape profile at the position of the photon energy of the diffraction order profile diminished by the fluorescence energy of the photon escaped from the detector material, wherein the intensity of the escape profile is determined by using a calibrated escape intensity model reflecting dependencies of the intensity on respective energy positions; wherein a particular diffraction order profile ensemble comprises all generated profiles associated with the respective diffraction order; adjusting pulse-height-to-energy-mapping parameters and contribution area of each diffraction order profile ensemble of the pulse height spectrum model using a fitting algorithm to minimize the difference between the pulse height spectrum model and the received pulse height spectrum; and providing the contribution area of the first order profile ensemble as the intensity at the energy to be determined by the wavelength-dispersive X-ray fluorescence spectrometer.