[R] non-linear solve?

2004-11-01 Thread ivo_welch-rstat8783
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,

RE: [R] non-linear solve?

2004-11-01 Thread Liaw, Andy
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 fun

Re: [R] non-linear solve?

2004-11-01 Thread Timur Elzhov
From: <[EMAIL PROTECTED]> Date: Tue 02 Nov 2004 - 00:55:31 EST > 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 ); >