[R] formula for nls

Gabor Grothendieck ggrothendieck at gmail.com
Wed Jan 23 21:15:14 CET 2008


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)


On Jan 23, 2008 2:58 PM, Jarek Jasiewicz <jarekj at amu.edu.pl> wrote:
> Hi!
>
> How to write in model's formula of type:
>
> nls(y~k/(x^n), data=data, start=list(k=1,n=1))
> i.e the problem is on x^n, I(x^n) generate error
>
> thanks
> Jarek



More information about the R-help mailing list