Search

Friends

Atomspheric CO2 (PPM)

Archives

Blather

Uptime verified by Wormly.com

22 June 2007

Calculating a Bond Yield

> f = function(y) (5/(1+y) + 5/((1+y)^2) + 105/((1+y)^3) - 88)^2
> optimize(f, c(0,1))
$minimum
[1] 0.09807912

$objective
[1] 8.321122e-06

Two lines. R is so sweet.

Comments

No comments yet.

Leave a comment

Markdown

0.101 seconds