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: [EMAIL PROTECTED]
> 
> 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
> 
> ______________________________________________
> [EMAIL PROTECTED] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
>

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to