fit_peaks | R Documentation |
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, ... )
y |
response (numerical vector) |
pos |
Locations of peaks in vector y. If NULL, |
sd.max |
Maximum width (standard deviation) for peaks. Defaults to 50. |
fit |
Function for peak fitting. (Currently exponential-gaussian hybrid
|
max.iter |
Maximum number of iterations to use in nonlinear least squares peak-fitting. (Defaults to 1000). |
... |
Additional arguments to |
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.
Function fit_peaks
returns a matrix, whose columns contain
the following information:
rt |
location of the maximum of the peak (x) |
start |
start of peak (only included in table if 'bounds==TRUE') |
end |
end of peak (only included in table if 'bounds==TRUE') |
sd |
width of the peak (x) |
tau |
tau parameter (only included in table if 'fit=="egh"') |
FWHM |
full width at half maximum (x) |
height |
height of the peak (y) |
area |
peak area |
r.squared |
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
.
The fit_peaks
function is adapted from Dr. Robert
Morrison's
DuffyTools package
as well as code published in Ron Wehrens'
alsace package.
Ethan Bass
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. 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. doi: 10.1007/BF02268168.
find_peaks
, get_peaks
data(Sa_pr) fit_peaks(Sa_pr[[1]][,"220"])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.