FitSinglePeak: Performs a peak fit.

View source: R/RcppExports.R

FitSinglePeakR Documentation

Performs a peak fit.

Description

FitSinglePeak performs a peak fit. Gaussian, Lorentzian and Pseudo-Voigt peak shapes are supported.

Usage

FitSinglePeak(
  yVals,
  xVals,
  peakType = 0L,
  blOffset = 0,
  blSlope = 0,
  amplitude = 0,
  fwhmLo = 0,
  fwhmHi = 0,
  peakPos = 0,
  mu = 0
)

Arguments

yVals

y axis data.

xVals

x axis data.

peakType

peak model to use.

blOffset

Initial value of baseline offset at first data point.

blSlope

Initial value of slope of baseline.

amplitude

Initial value of peak amplitude.

fwhmLo

Initial value of left peak width (full width at half maximum).

fwhmHi

Initial value of right peak width (full width at half maximum).

peakPos

Initial value of peak position.

mu

Initial value of Gaussian/Lorentzian contribution.

Details

Peak parameters are optimized using a Levenberg-Marquardt algorithm as implemented by the library lmfit. The following peak types are available:

peak type index peak function symmetric baseline
-1 Gaussian through highest point and its neighbours yes no
0 Gaussian yes no
1 Lorentzian yes no
2 Pseudo-Voigt yes no
3 Gaussian yes yes
4 Lorentzian yes yes
5 Pseudo-Voigt yes yes
6 Gaussian no no
7 Lorentzian no no
8 Pseudo-Voigt no no
9 Gaussian no yes
10 Lorentzian no yes
11 Pseudo-Voigt no yes

The function for peakType = -1 is not an actual peak fit but rather the Gaussian function (symmetric, no baseline) defined by the maximum intensity point and its neighbors. It is used to automatically generate guess values for position, width and amplitude if all peak parameters are set to 0.

Value

List with peak parameters.

See Also

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


pasturm/TofDaqR documentation built on March 29, 2024, 12:10 a.m.