Re: [R] Code to calculate internal rate of return

2010-05-26 Thread Dimitri Shvorob
Unfortunately, this is not a robust implementation, and is derailed by Error in uniroot(f, c(-1, 1)) : f() values at end points not of opposite sign -- View this message in context: http://r.789695.n4.nabble.com/Code-to-calculate-internal-rate-of-return-tp864645p2231910.html Sent from the R

Re: [R] Code to calculate internal rate of return

2008-08-14 Thread Paul Bivand
You could look at how the same problem is dealt with in package "financial". Paul Bivand 2008/8/1 Moshe Olshansky <[EMAIL PROTECTED]> > > You can use uniroot (see ?uniroot). > > As an example, suppose you have a $100 bond which pays 3% every half year (6% > coupon) and lasts for 4 years. Suppose

Re: [R] Code to calculate internal rate of return

2008-07-31 Thread Moshe Olshansky
You can use uniroot (see ?uniroot). As an example, suppose you have a $100 bond which pays 3% every half year (6% coupon) and lasts for 4 years. Suppose that it now sells for $95. In such a case your time intervals are 0,0.5,1,...,4 and the payoffs are: -95,3,3,...,3,103. To find internal rate