diff options
| -rw-r--r-- | R/creditIndex.R | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/R/creditIndex.R b/R/creditIndex.R index b1f15a42..6ac58375 100644 --- a/R/creditIndex.R +++ b/R/creditIndex.R @@ -35,7 +35,8 @@ print.creditIndex <- function(index){ cat("losstodate:", index$loss, "\n\n") } if("quotes" %in% names(index)){ - cat("Index ref:", index$quotes$ref, "\n") + cat("Index price ref:", index$quotes$refprice, "\n") + cat("Index price spread:", index$quotes$refspread, "\n") cat("Index basis:", index$basis, "\n\n") } @@ -63,7 +64,8 @@ csvheaders <- function(index){ stop("argument needs to be of class creditIndex") } tranche.names <- row.names(index$tranches) - headers <- c("date", "indexprice", "indexref", "indexBasis", "indexEL", "indexTheta", + headers <- c("date", "indexpriceref", "indexspreadref", "indexprice", + "indexBasis", "indexEL", "indexduration", "indexTheta", paste(tranche.names, "Upfront"), paste(tranche.names, "Dealer Delta"), paste(tranche.names, "Model Delta"), @@ -82,8 +84,8 @@ tocsv <- function(index){ if(class(index)!="creditIndex"){ stop("argument needs to be of class creditIndex") } - row <- c(as.character(index$tradedate), index$quotes$price, index$quotes$ref, index$basis, - index$EL, index$theta, + row <- c(as.character(index$tradedate), index$quotes$refprice, index$quotes$refspread, + index$quotes$price, index$basis, index$EL, index$duration, index$theta, unlist(index$tranches[c("upfront", "mkt.delta", "delta", "fw.delta","gamma", "theta")]), index$rho[-1], unlist(index$tranches[c("corr01", "duration", "EL")])) |
