[R] Trouble with parameter estimation in nonlinear regression model

Syela Mohd Noor syelamohdnoor at gmail.com
Mon Oct 3 19:23:21 CEST 2016


Hi all, I had a problem with the parameter estimation of the Brass Gompertz
model for my dissertation. I run the code for several times based on
different years and it was fine until the seventh year onward where I got
negative values for the parameter (a) which did not make sense since it
represents the total fertility rate of a country.
This is my code :

gom.eq=function(a, b, c)

{

    age=c(17.5, 22.5, 27.5, 32.5, 37.5, 42.5 , 47.5)

    k=(-(age-14)/b)

    (a*((c/b)*(exp((k)-(c*(exp(k)))))))

}



varlist=list(
ASFR$Y1960,ASFR$Y1965,ASFR$Y1970,ASFR$Y1975,ASFR$Y1980,ASFR$Y1985,

ASFR$Y1990,ASFR$Y1995,ASFR$Y2000,ASFR$Y2005,ASFR$Y2010,ASFR$Y2013)



gom.models=lapply(varlist, function(varlist)

{

nlsLM(varlist~gom.eq(a,b,c),data=ASFR,start=list(a=1 , b=1, c=1),trace=T)

})

summary(gom.models)



gom.models[1:12]




Any idea to solve the problem?


Regards,

Syela M.N.

	[[alternative HTML version deleted]]



More information about the R-help mailing list