vis_kernel {ycevo} | R Documentation |
Visualise kernel weights
Description
vis_kernel()
visualises kernel weights assigned to the intervals
surrounding specific grid points using the Epanechnikov
kernel function and given bandwidths.
Usage
vis_kernel(data, x = NULL, hx = NULL, tau = NULL, ht = NULL, ...)
Arguments
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. Bandwidth parameters corresponding to each time
point |
tau |
Numeric vector. Time-to-maturities in years where
discount function and yield curve will be estimated for each of time points |
ht |
Numeric vector. Bandwidth parameters corresponding to each value of
time-to-maturities |
... |
Specification of an additional covariate, taking the form of |
Details
If x
and hx
are provided, the kernel weights assigned to the intervals
surrounding each of time points x
will be plotted.
If tau
and ht
are provided, the kernel weights assigned to the intervals
surrounding each of time-to-maturities 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.
Value
A ggplot2::ggplot()
object.
See Also
Examples
bonds <- ycevo_data()
vis_kernel(bonds, x = lubridate::ymd("2023-06-01"), hx = 0.2)