vis_kernel | R Documentation |
Visualise kernel weights surrounding a specific grid point using Epanechnikov kernel function and the given bandwidth.
vis_kernel(data, x = NULL, hx = NULL, tau = NULL, ht = NULL, ...)
data |
Bond data. If |
x |
Time grids at which the discount curve is evaluated. Should be
specified using the same class of object as the quotation date ( |
hx |
Numeric vector of the bandwidth parameter corresponds to each time
point |
tau |
Numeric vector that represents time-to-maturities in years where
discount function and yield curve will be found for each time point |
ht |
Numeric vector of the bandwidth parameter corresponding to each
time-to-maturities |
... |
Specification of an additional covariate, taking the form of |
If x
and hx
are provided, the kernel weights surrounding time
points x
will be plotted.
If tau
and ht
are provided, the kernel weights surrounding time
points tau
will be plotted.
If the grid and bandwidth of a covariate are provided in ...
, the
kernel weights of that covariate will be plotted.
The kernel weights can only be plotted in one dimension (time, time-to-maturity, or covariate) at a time.
A ggplot2::ggplot()
object.
ycevo_data()
, ycevo()
bonds <- ycevo_data()
vis_kernel(bonds, x = lubridate::ymd("2023-06-01"), hx = 0.2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.