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 tau and the quotation date at which the discount functions and the yield curves are to be predicted. The quotation date is to be named after the quotation date column in x, which is also the name of the quotation date column of the data argument in ycevo() that produces x. The default is qdate.

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

ycevo()

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)



[Package ycevo version 0.2.1 Index]