[R] formula for nls

Jarek Jasiewicz jarekj at amu.edu.pl
Wed Jan 23 21:44:17 CET 2008


Gabor Grothendieck wrote:
> Try port algorithm.  Please provide complete reproducible code and data
> when posting.
>
>   
>> y <- 1/(x <- 1:5)
>> nls(y~k/x^n, start=list(k=1, n=1), algorithm = "port")
>>     
> Nonlinear regression model
>   model:  y ~ k/x^n
>    data:  parent.frame()
> k n
> 1 1
>  residual sum-of-squares: 0
>
> Algorithm "port", convergence message: both X-convergence and relative
> convergence (5)
>
>
>   
thanks, but unfortunaltly not work

here data and problem:
 
tmp=data.frame(t=c(0,40,100,330,950,15200), 
h=c(0.362,0.278,0.218,0.169,0.139,0.024))
fm=formula(t~    tr+    (ts-tr)/    ((1+    (a*h)^n)^(1-(1/n))))
start=list(a=0.05, n=1.5, ts=0.5, tr=0.05)

p=nls(fm, data=tmp,start=start, algorithm = "port")
------
Error in numericDeriv(form[[3]], names(ind), env, ifelse(internalPars <  :
        Missing value or an infinity produced when evaluating the model


hope, someone can help

Jarek



More information about the R-help mailing list