R - fitting function to data by deoptim

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

R - fitting function to data by deoptim

Enigmaze
Hi! For project on unieversity i need to do an shiny app in R. This must fit sigmoidal function to data. I have problem with fit parametres function using DEoptim (is requirement). I have list of function:

funkcje<-list(
  list(nazwa='logistyczna',wzor=function(param,x){param[1]/(1+exp(-param[2]*(x-param[3])))}),
  list(nazwa='tangens hiperboliczny',wzor=function(param,x){param[1]*tanh(param[2]*(x-param[3]))}),
  list(nazwa='zgeneralizowana funkcja logistyczna',wzor=function(param,x){param[1]*(1+exp^(-param[2]*(x-param[3])))}),
  list(nazwa='specyficzna algebraiczna funkcja',wzor=function(param,x){param[1]*x/(sqrt(param[2]*(1+(x-param[3])^2)))})
)

and now i want to fit data, for example vectors x,y, to function, for example funkcje[[1]]$wzor using deoptim. Can anyone help with this?