[R] non-linear solve?

Liaw, Andy andy_liaw at merck.com
Mon Nov 1 15:53:47 CET 2004


See ?uniroot:

> uniroot(irr.in, c(-1, 1), c1=-100, c2=60, c3=70)
$root
[1] 0.1888196

$f.root
[1] -1.514979e-05

$iter
[1] 8

$estim.prec
[1] 6.103516e-05

Warning message: 
NA/Inf replaced by maximum positive value 

Andy

> From: ivo_welch-rstat8783 at mailblocks.com
> 
> hi:  could someone please point me to a function that allows me to 
> solve general non-linear functions?
> 
>    > irr.in <- function(r, c1, c2, c3 ) {  return(c1+c2/(1+r) + 
> c3/(1+r)^2); }
>   > solve.nonlinear( irr.in, -100, 60, 70 );
>   0.189
> 
> If someone has written an irr function, this would be helpful, 
> too---though not difficult to write, either.  thanks for any pointers.
> 
> Regards,
> 
> /iaw
> ---
> ivo welch
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
>




More information about the R-help mailing list