Fit Gradient Models to Data
fit_gradients.Rd
This function fits three gradient models (exponential, power, and modified power) to given data. It then ranks the models based on their R-squared values and returns diagnostic plots for each model.
Arguments
- data
A dataframe containing the data, with columns "x" representing distances and "Y" representing the corresponding measurements or counts.
- C
A constant to be used in the modified power model. Defaults to 1.
Value
A list containing:
data
The input data, which will include an additional column 'mod_x'.results_table
A table of the model parameters and R-squared values.plot_exponential
Diagnostic plot for the exponential model.plot_power
Diagnostic plot for the power model.plot_modified_power
Diagnostic plot for the modified power model.plot_exponential_original
Plot of the original data with the exponential model fit.plot_power_original
Plot of the original data with the power model fit.plot_modified_power_original
Plot of the original data with the modified power model fit.