R/fit_custom.R
fit_custom.Rd
Fits a curve using a generalised additive model
fit_custom(x, y, k = NULL)
vector of numeric predictor variable
vector of numeric response variable, of same length as x
passed onto smooth term of x. Default is length(x) - 1
function that accepts x and returns y based on fitted model
Fits a generalised additive model (GAM) using the mgcv package.
fit_null()
my_func <- EndoSim:::fit_custom( c(4, 8.87, 11.82, 14.22, 17.13, 19.92, 22.61, 25.77, 27.80, 30), c(0, 0.06, 0.09, 0.11, 0.13, 0.15, 0.16, 0.14, 0.04, 0) ) plot(seq(0, 50, by = 0.1), my_func(seq(0, 50, by = 0.1)), type = "l")