FitSinglePeak2 | R Documentation |
FitSinglePeak2
performs a peak fit. Gaussian, Lorentzian and
Pseudo-Voigt peak shapes are supported.
FitSinglePeak2(
yVals,
xVals,
peakType = 0L,
param = as.numeric(c(0, 0, 0, 0, 0, 0, 0))
)
yVals |
y axis data. |
xVals |
x axis data. |
peakType |
peak model to use. |
param |
Vector of initial values (blOffset, blSlope, amplitude, fwhmLo, fwhmHi, peakPos, mu). |
Same as FitSinglePeak
, but takes the initial values of the
fit parameter as a vector argument instead of explicit parameters.
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.
List with peak parameters.
Other Peak fitting functions:
EvalMultiPeak()
,
EvalSinglePeak()
,
FitSinglePeak()
,
MultiPeakFit()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.