Évaluation et analyse des obligations avec R
Clifford Ang
Senior Vice President, Compass Lexecon
uniroot() en R pour automatiser le calculytm <- function(cf) {
uniroot(bval, c(0, 1), cf = cf)$root
}
ytm() avec uniroot()cf) et utilise une fonction d'évaluation d'obligation modifiée (bval)c(0,1) borne la recherche à un rendement entre 0 % et 100 %cf <- c(-92.64, 5, 5, 5, 5, 5, 5, 5, 5, 5, 105)
bval <- function(i, cf, t = seq(along = cf)) sum(cf / (1 + i)^t)
bval() that uses the modified cash flow vector (cf)bondprc() functiont)i)Évaluation et analyse des obligations avec R