autoplot.ycevo | R Documentation |
Plot discount function and yield curve
## S3 method for class 'ycevo'
autoplot(
object,
est = c("both", "discount", "yield"),
against = c("tau", "x", "both"),
loess = TRUE,
...
)
object |
A ycevo object |
est |
Which estimated values to plot: discount function, yield curve, or both. Default is both. |
against |
Which variable to plot against, i.e. what is on the x axis.
Time-to-maturity |
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. |
A ggplot2::ggplot()
object if only one dimension is specified in
against
. A plotly::plot_ly()
object if against
is set to both.
ycevo()
# Simulating bond data
bonds <- ycevo_data(n = 10)
# Estimation can take up to 30 seconds
res <- ycevo(bonds, x = lubridate::ymd("2023-03-01"))
# Plot
autoplot(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.