MultiPeakFit: Performs a multi-peak fit.

View source: R/RcppExports.R

MultiPeakFitR Documentation

Performs a multi-peak fit.

Description

MultiPeakFit performs a multi-peak fit for (partially) overlapping peaks. All peaks in a multi-peak cluster share common peak parameters except amplitude and position. Various options allow for a more or less constrained fit (see description of options below).

Usage

MultiPeakFit(dataX, dataY, mass, intensity, commonPar, options)

Arguments

dataX

x axis data.

dataY

y axis data.

mass

Vector of the known positions of the peaks.

intensity

Vector of initial guesses for intensities. If all values are 0 the guess values for peak intensities are generated automatically.

commonPar

Vector of guess values of common peak parameters. commonPar has 6 elements: [1] offset of common baseline, [2] slope of common baseline, [3] left FWHM, [4] right FWHM (same as left FWHM for symmetric peaks), [5] shape parameter mu (applies only for peak model Pseudo-Voigt), [6] common mass shift of peaks. options determines which of the common parameters are optimized.

options

List of peak model and optimization options (see Details).

Details

The peak positions are not optimized, but the common mass shift parameter in commonPar allows for minimal refinement of the peak positions due to imperfect mass calibration.

options is a list containing:

peakModel = 0 (Gauss) or 1 (Lorentz) or 2 (Pseudo-Voigt)
asymmetric = 0 (symmetric peak model) or 1 (asymmetric peak model)
baseline = 0 (no optimization of baseline parameters) or 1 (optimize baseline parameters)
width = 0 (no optimization of width parameters) or 1 (optimize width parameters)
peakShape = 0 (no optimization of peak shape (mu) parameter) or 1 (optimize peak shape (mu) parameter (applies only to pseudo-Voigt))
massShift = 0 (no optimization of common mass shift parameters) or 1 (optimize common mass shift parameters)
amplitude = 0 (no constraint on amplitudes) or 1 (constrain sum of baseline and all peaks to total intensity in spectrum)

Note that if a given parameter is not activated for optimization, the supplied (guess) values are still used (e.g. specify a known baseline without optimizing the parameters).

Value

List with the optimized intensities and common peak parameters.

See Also

Other Peak fitting functions: EvalMultiPeak(), EvalSinglePeak(), FitSinglePeak2(), FitSinglePeak()


pasturm/TofDaqR documentation built on July 20, 2024, 9:44 a.m.