spread_DV01: Calculate Spread Change

Description Usage Arguments Value Examples

View source: R/spread_DV01.R

Description

spread_DV01 calculates the spread DV01 or change in upfront value when the spread rises by 1 basis point

Usage

1
2
3
4
spread_DV01(x, date.var = "date", currency.var = "currency",
  maturity.var = "maturity", tenor.var = "tenor", spread.var = "spread",
  coupon.var = "coupon", recovery.var = "recovery",
  notional.var = "notional", notional = 1e+07, recovery = 0.4)

Arguments

x

data frame, contains all the relevant columns.

date.var

character, column in x containing date variable.

currency.var

character, column in x containing currency.

maturity.var

character, column in x containing maturity date.

tenor.var

character, column in x containing tenors.

spread.var

character, column in x containing spread in basis points.

coupon.var

character, column in x containing coupon rates in basis points. It specifies the payment amount from the protection buyer to the seller on an annual basis.

recovery.var

character, column in x containing recovery rates. ISDA model standard recovery rate asscumption is 0.4.

notional.var

character, column in x containing the amount of the underlying asset on which the payments are based.

notional

numeric, the notional amount for all pricing if there isn't a notional.var

recovery

numeric, the recovery rate for all pricing if there isn't a recovery.var

Value

a vector containing the change in upfront when there is a 1 basis point increase in spread, for each corresponding CDS contract.

Examples

1
2
3
4
5
6
7
8
9
x <- data.frame(date = c(as.Date("2014-04-22"), as.Date("2014-04-22")),
                currency = c("USD", "EUR"),
                tenor = c(5, 5),
                spread = c(120, 110),
                coupon = c(100, 100),
                recovery = c(0.4, 0.4),
                notional = c(10000000, 10000000),
                stringsAsFactors = FALSE)
spread_DV01(x)

Example output

IF YOU USE THIS CDS PACKAGE, YOUR USE WILL SIGNIFY YOUR
    UNDERSTANDING 
AND IRREVOCABLE ACCEPTANCE OF THIS LICENSE AND ITS
    TERMS, WHICH INCORPORATE 
BY REFERENCE THE INTERNATIONAL SWAPS AND
    DERIVATIVES ASSOCIATION, INC.'S CDS 
STANDARD MODEL PUBLIC LICENSE,
    WHICH IS AVAILABLE AT
    
http://www.cdsmodel.com/cdsmodel/cds-disclaimer.page before using
    the package. 

NOTHING IN THIS LICENSE RESTRICTS YOUR ABILITY TO USE
    THE ISDA(R) CDS 
STANDARD MODEL.
 
DISCLAIMER: ISDA HAS NEITHER
    REVIEWED, APPROVED NOR ENDORSED THE USE OF 
THE CDS PACKAGE. THOSE
    PERSONS USING THIS CDS PACKAGE ARE ENCOURAGED TO SEEK 
THE ADVICE OF
    A LEGAL PROFESSIONAL TO EVALUATE ITS SUITABILITY FOR THEIR USE.

    
ISDA(R) is a registered mark of the International Swaps and
    Derivatives 
Association, Inc.
 
Please type **yes** to assent to
    the aforementioned terms.

[1] 4768.084 4878.017

creditr documentation built on May 29, 2017, 8:46 p.m.