augment.ycevo: Augment data with predicted discount function and yield curve

View source: R/augment.R

augment.ycevoR Documentation

Augment data with predicted discount function and yield curve

Description

Augment data with predicted discount function and yield curve

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 function and the yield curve is to be predicted. The quotation date is to be named the same as the quotation date column in x, depending on the name of the quotation date column when it was first provided to the data argument ycevo().The default is qdate.

loess

Logical. Whether the returned discount function and yield curve 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 values at points specified for the estimation in ycevo().

If newdata is provided, the discount function at the time-to-maturities specified in newdata will be generated from loess smoothing (see stats::loess()), then interpolated to produce the discount function at the quotation date specified in newdata.

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)



FinYang/ycevo documentation built on April 10, 2024, 8:17 a.m.