fmbasics (version 0.3.0)

interpolate.ZeroCurve: Interpolate a ZeroCurve

Description

There are two key interpolation schemes available in the stats package: constant and linear interpolation via stats::approxfun() and spline interpolation via stats::splinefun(). The interpolate() method is a simple wrapper around these methods that are useful for the purposes of interpolation financial market objects like zero coupon interest rate curves.

Usage

# S3 method for ZeroCurve
interpolate(x, at, ...)

Arguments

x

a ZeroCurve object

at

a non-negative numeric vector representing the years at which to interpolate the zero curve

...

unused in this method

Value

a numeric vector of zero rates (continuously compounded, act/365)

See Also

Other interpolate functions: interpolate_dfs, interpolate_zeros, interpolate

Examples

Run this code
# NOT RUN {
zc <- build_zero_curve(LogDFInterpolation())
interpolate(zc, c(1.5, 3))
# }

Run the code above in your browser using DataCamp Workspace