View source: R/area_estimation.R
peaklist_fit_lorentzians | R Documentation |
The different methods are available for benchmarking while developing, we should pick one.
peaklist_fit_lorentzians(
peak_data,
nmr_dataset,
amplitude_method = c("intensity", "2nd_derivative", "intensity_without_baseline"),
refine_peak_model = c("none", "peak", "2nd_derivative")
)
peak_data |
The peak data |
nmr_dataset |
The nmr_dataset object with the data. This function for now assumes nmr_dataset is NOT be baseline corrected |
amplitude_method |
The method to estimate the amplitude. It may be:
|
refine_peak_model |
Whether a non linear least squares fitting should be used to refine the estimated parameters. It can be:
|
gamma is estimated using the inflection points of the signal and fitting them to the lorentzian inflection points
$A$ is estimated using the amplitude_method
below
The peak position ($x_0$) is given in peak_data
Those estimations may be refined with non-linear least squares using refine_peak_model
. If the nls does not converge,
the initial estimations are kept. Convergence -and other nls errors- are saved for further reference and diagnostic.
Use attr(peak_data_fitted, "errors")
to retreive the error messages, where peak_data_fitted
is assumed to be the
output of this function. The refining improves gamma, $A$ and $x_0$.
The baseline estimation (when calculated, see the arguments) is set to Asymmetric Least Squares with lambda = 6, p=0.05, maxit=20 and it is probably not optimal... yet.
The given data frame peak_data
, with added columns:
inflection points,
gamma
area
a norm_rmse fitting error
As well as some attributes
"errors": A data frame with any error in the peak fitting
"fit_baseline": Whether the method used has any consideration for the baseline of the signal (maybe not very useful attribute)
"method_description": A textual description of what we did, to include it in plots
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.