interpolation_error: Interpolation error

interpolation_errorR Documentation

Interpolation error

Description

Computes interpolation error as the root mean square error of differences between interpolated terms and SpotRateCurve values.

Usage

interpolation_error(x, ...)

Arguments

x

a SpotRateCurve object.

...

additional arguments. Currently unused.

The curve must have a interpolation set to compute the interpolation error. This is useful to evaluate parametric methods like NelsonSiegel and NelsonSiegelSvensson.

Value

A numeric value with the root mean squared error between the curve data point and interpolated points.

Examples

terms <- c(1, 11, 26, 27, 28)
rates <- c(0.0719, 0.056, 0.0674, 0.0687, 0.07)
curve <- spotratecurve(rates, terms, "discrete", "actual/365", "actual")
interpolation(curve) <- interp_nelsonsiegel(
  0.1229, -0.0606, 0.1004, 1.9174
)
interpolation_error(curve)

fixedincome documentation built on July 9, 2023, 7:28 p.m.