| yc_curve | R Documentation |
Construct a yc_curve object from observed maturity-rate pairs. This is
the core data structure used throughout the package.
yc_curve(maturities, rates, type = c("zero", "par", "forward"), date = NULL)
maturities |
Numeric vector of maturities in years (e.g., 0.25 for 3 months, 2 for 2 years). |
rates |
Numeric vector of yields as decimals (e.g., 0.05 for 5\
Must be the same length as |
type |
Character. The type of rate: |
date |
Optional Date for the curve observation. |
A yc_curve object (S3 class) with components:
Numeric vector of maturities in years.
Numeric vector of rates as decimals.
Character string indicating rate type.
Character string indicating fitting method.
List of model parameters (empty for observed curves).
Numeric vector of fitted rates (NULL for observed curves).
Numeric vector of residuals (NULL for observed curves).
Date of the curve observation.
Integer count of maturity points.
# US Treasury yields (2Y, 5Y, 10Y, 30Y)
maturities <- c(2, 5, 10, 30)
rates <- c(0.045, 0.042, 0.040, 0.043)
curve <- yc_curve(maturities, rates)
curve
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.