This package selects the best-fit model by comparing AIC and BIC. Currently, seven basic fitting models are supported. The seven basic models include one simple linear fitting model (line2P), one quadratic curve model (line3P), one logarithmic model (log2P), two exponential models (exp2P and exp3P), and two power-law models (power2P and power3P). The formulas of these seven basic fitting models are y = ax+b (line2P), y = ax^2+bx+c (line3P), y = aexp(bx)+ c (exp3P), y=aln(x)+b (log2P), y = aexp(bx) (exp2P), y = ax^b (power2P), y = a*x^b+ c (power3P), respectively.
##require "devtools"
devtools::install_github("fhruilin/BestFitM")
library(BestFitM)
data("mtcars")
bestFitM(data= mtcars, x= "mpg", y = "disp")
#Considering that not all data is applicable to the exp3P and power3P models, we give another function, BestFitM2, which contains only five basic fitting models.
bestFitM2(data= mtcars, x= "mpg", y = "disp")
#Once the best-fitting model has been selected, you can use the FitM function to look at the other parameters of the model.
FitM(data= mtcars, x= "mpg", y = "disp",model = "line2P")