# Question:How Can I do a Nonlinear fit with some data

## Question:How Can I do a Nonlinear fit with some data

Maple

I am trying to fit  this function with some data
F:= M*(  (1 -  ( 1 - a)*e^(-k*q*t)) /q)^(1/(1-q)) ;
where a:= (No/M)^(1-q). I need to know the values
of k, q and M, I do have No (initial condition)

DATA:=
[[13.2621 ,  0.0012],
[14.0740 ,  0.0017],
[15.4272 ,  0.0031],
[16.7803 ,  0.0063],
[18.1335 ,  0.0174],
[19.2161 ,  0.0317],
[20.5692 ,  0.0598],
[21.6518 ,  0.0821],
[23.0049 ,  0.1501],
[24.0875 ,  0.2061],
[25.1700 ,  0.2742],
[26.5232  , 0.3534],
[27.3351,   0.4852],
[28.6883 ,  0.5337],
[29.2295 ,  0.6059],
[30.5827,   0.7565],
[32.4772 ,  1.0723],
[34.1010 ,  1.1068],
[34.6422  , 1.2173]]:

I did try to do this but it does not work
with(Optimization):
f:= x -> M*(  (1 -  ( 1 - q*(0.0012/M)^(1-q))*exp(-k*q*t)) /q)^(1/(1-q)) :

residuals := map(p -> (f(p[1])-p[2]), DATA):
R:= LSSolve(residuals);
Error, (in Optimization:-LSSolve) complex value encountered

Please let me know How can I solve  this problem.