1
$\begingroup$

I want to fit this model of population growth:

$$y(t) = α / (1 + βe^{−γt})$$

given the data:

time<-c (1.000,2.000,3.000,4.000,5.000,6.000,7.000,8.000,9.000,10.000,11.000,12.000)
population<-c (5.308,7.240,9.638,12.866,17.069,23.192,31.443,38.558,50.156,62.948,75.995,91.972)

I attempted to fit it into nls function with starting values as:

alpha=220; beta=50; gamma=0.3

and successfully got:

nls.fit<-nls(population~(alpha)/(1+(beta*exp(-gamma*x.pred))) , data=mydata, start=unscaled.init.values)

with output:

#Nonlinear regression model
#
#  model: population ~ (alpha)/(1 + (beta * exp(-gamma * x.pred)))
#
#   data: mydata
#
#   alpha     beta    gamma 
#
#196.1862  49.0916   0.3136 
#
# residual sum-of-squares: 2.587
#
#Number of iterations to convergence: 3 
#
#Achieved convergence tolerance: 4.493e-06

But then when I tried to rescale the parameter values as:

alpha'=100*alpha; beta'=10*beta; gamma'=0.1*gamma

with the function:

nls.fit2<-nls(population~0.01*alpha/(1+0.1*beta*exp(-10*gamma*x.pred)) , data=mydata, start=scaled.init.values)

and starting values as:

alpha=2.2; beta=5; gamma=3

I received the error:

#Error in nlsModel(formula, mf, start, wts) : 
#singular gradient matrix at initial parameter estimates

I don't understand why this happens as I only rescaled the parameters, but I also rescaled the starting values to fit the model, so the two nls() should give me the same output? Can someone please explain?

$\endgroup$
0

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.