Interpolate: Interpolation

Description Usage Arguments Value Examples

Description

Function useful for Interpolation. can be either "Dates" or "Numeric", allowing to easily Interpolate on discount curves. The interpolation can be done using linear or cubic-spline.

Usage

1
interpolate(X, Y, x, method = "linear")

Arguments

X, Y

Vectors giving the coordinates of the points to be interpolated. X can optionally be "Date" format, allowing to interpolate on a typical j discount curve structure.

x

A single point specifying where to interpolate on observations of X. Can be numeric, Date or character ("YYYY-MM-DD")

method

Either linear ("l") or cubicspline ("cs")

Value

The value corresponding to x of values in Y.

Examples

1
2
Interpolate(X = c(1,3,5),Y = c(100,200,300),x = 2,method="l")
Interpolate(Curve$Date, Curve$Discount_Factors, "2025-03-03", "linear")

ThVWh/ralibr documentation built on April 4, 2018, 4:41 a.m.