Learn R Programming

ycevo (version 0.3.0)

plot.ycevo: Plot the estimated discount functions and yield curves

Description

Plots the estimated discount functions and yield curves from a ycevo() object.

Usage

# S3 method for ycevo
plot(
  x,
  est = c("both", "discount", "yield"),
  against = c("tau", "x"),
  loess = TRUE,
  ...
)

Value

NULL. The functions produces a plot.

Arguments

x

A ycevo object

est

String. Indicates which estimated values to plot: discount function, yield curve, or both. Default is both.

against

String. Indicates which variable to plot against, i.e. what is on the x axis. Time-to-maturity tau or quotation date x.

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.

See Also

ycevo(), autoplot.ycevo()

Examples

Run this code
# Simulating bond data
bonds <- ycevo_data(n = 10)
# \donttest{
# Estimation can take up to 30 seconds
res <- ycevo(bonds, x = lubridate::ymd("2023-03-01"))
# Plot
plot(res)
# }

Run the code above in your browser using DataLab