augment.ycevo {ycevo} | R Documentation |
Augment data with predicted discount functions and yield curves
Description
Augment data with predicted discount functions and yield curves
Usage
## S3 method for class 'ycevo'
augment(x, newdata = NULL, loess = TRUE, ...)
Arguments
x |
A ycevo object |
newdata |
A data frame containing time-to-maturity in years |
loess |
Logical. If TRUE, the returned discount functions and yield curves are loess smoothed. |
... |
Additional arguments required for generic consistency. Currently not used. Warning: A misspelled argument will not raise an error. The misspelled argument will be either disregarded, or the default value will be applied if one exists. |
Details
If newdata
is not provided, returns the discount function and yield curve
at the specified estimation points in ycevo()
.
If newdata
is provided, the discount functions at the time-to-maturities
specified in newdata
are generated from loess smoothing (see
stats::loess()
), and interpolated to produce the discount function values at the
quotation date specified in newdata
, before being converted to the yield curves.
Value
newdata
augmented with .discount
and .yield
for the discount
function and the yield curve respectively.
See Also
Examples
# Simulating bond data
bonds <- ycevo_data(n = 10)
# Estimation can take up to 30 seconds
res <- ycevo(bonds, x = lubridate::ymd("2023-03-01"))
# Augmentation
augment(res)