[R] Estimating parameters in a nonlinear model with observations

mathr jesper at hvidkildehusene.dk
Wed May 6 14:14:26 CEST 2009


Hi,

I have a problem. I want to estimate some parameters in a function. I
already have an empirical function (made from 100 observations), which
I want to estimate the parameters from.

The function is f(x) = 1-((a+1)b^x)/(a+b^x)

f(x) in [0,1], x in [0,1].

I want to estimate a and b.

I tried to use least squares, where the code was
(the dataset 'data' contains two columns: f.obs and x.obs)

nls.emp <- nls(f.obs ~ 1-(a+1)*b^x.obs/(a+b^x.obs),
			data= data,
			start=list(a = -.9871731343, b = 51.78568669),
			trace=TRUE, algorithm = "port")

But it just returns
 0:     15.777046: -0.987173  51.7857
Error in numericDeriv(form[[3]], names(ind), env, ifelse(internalPars
<  :
  Missing value or an infinity produced when evaluating the model

My initial values is calculated in maple in a nonlinear equation
system. I used f(0.05) and f(0.5).

Thanks,
J




More information about the R-help mailing list