discountFactors | R Documentation |
YieldCurve
or DynamicYieldCurve
object.Discount factors for specified tenors are extracted from a
YieldCurve
or DynamicYieldCurve
object according to the compounding method specified.
discountFactors(object, to, from, method = "continuous",
period = "Y", refdate = NULL, ...)
## S4 method for signature 'YieldCurve'
discountFactors(object, ...)
## S4 method for signature 'numeric'
discountFactors(object, to, from, ...)
## S4 method for signature 'DynamicYieldCurve'
discountFactors(
object,
to,
from,
by,
method = "continuous",
period = "Y",
ad = NULL,
refdate,
...
)
object |
An object of class |
... |
Additional parameters to be passed.
|
to |
character reflecting the discounting period end date. Can be a single value or a vector of tenors. |
from |
(optional) a character defining the discounting period start date. If it is a single value combined with a vector for 'end', then 'start' remains the same for all dates defined in 'end'. |
by |
(optional) |
method |
|
period |
|
ad |
|
refdate |
numeric vector of discount factors for the defined periods.
rates
tenors <- c("1W", "1M", "6M", "1Y", "2Y", "5Y")
rates <- c(0.001, 0.0015, 0.002, 0.01, 0.02, 0.03)
yc <- DynamicYieldCurve(label = "YC_Prim",
ReferenceDate = "2015-01-01",
Tenors = tenors,
Rates = rates)
discountFactors(yc, by="1Y")
discountFactors(yc, to="2016-01-01", isDateEnd = TRUE)
discountFactors(yc, by="1Y", from="2015-07-01")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.