Fit peak parameters using exponential-gaussian hybrid or gaussian function.
fit_peaks(
y,
pos = NULL,
sd.max = 50,
fit = c("egh", "gaussian", "raw"),
max.iter = 1000,
...
)
Function fit_peaks
returns a matrix, whose columns contain
the following information:
location of the maximum of the peak (x)
start of peak (only included in table if `bounds==TRUE`)
end of peak (only included in table if `bounds==TRUE`)
width of the peak (x)
tau parameter (only included in table if `fit=="egh"`)
full width at half maximum (x)
height of the peak (y)
peak area
r-squared value for linear fit of model to data.
Again, the first five elements (rt, start, end, sd and FWHM) are expressed
as indices, so not in terms of the real retention times. The transformation
to "real" time is done in function get_peaks
.
response (numerical vector)
Locations of peaks in vector y. If NULL, find_peaks
will
run automatically to find peak positions.
Maximum width (standard deviation) for peaks. Defaults to 50.
Function for peak fitting. (Currently exponential-gaussian hybrid
egh
, gaussian
and raw
settings are supported). If
raw
is selected, trapezoidal integration will be performed on raw data
without fitting a peak shape. Defaults to egh
.)
Maximum number of iterations to use in nonlinear least squares peak-fitting. (Defaults to 1000).
Additional arguments to find_peaks
.
Ethan Bass
Peak parameters are calculated using fit_peaks
, which fits the data
to a gaussian or exponential-gaussian hybrid curve using non-linear least
squares estimation as implemented in nlsLM
.
Area under the fitted curve is estimated using trapezoidal estimation.
Lan, K. & Jorgenson, J. W. 2001. A hybrid of exponential and gaussian functions as a simple model of asymmetric chromatographic peaks. Journal of Chromatography A 915:1-13. tools:::Rd_expr_doi("10.1016/S0021-9673(01)00594-5").
Naish, P. J. & Hartwell, S. 1988. Exponentially Modified Gaussian functions - A good model for chromatographic peaks in isocratic HPLC? Chromatographia, /bold26: 285-296. tools:::Rd_expr_doi("10.1007/BF02268168").
find_peaks
, get_peaks
data(Sa_pr)
fit_peaks(Sa_pr[[1]][,"220"])
Run the code above in your browser using DataLab