cvnpcurve {curvir}R Documentation

Cross-validated errors for non-parametric curve

Description

Obtain cross-validated errors for a non-parametric curve with given sample splits.

Usage

cvnpcurve(x, y, cvIndex, type = "rforest", dummy = NULL)

Arguments

x

A matrix of explanatory variables. Excess reserve must be the first input.Additional regressor follow (optional).

y

A vector of normalised interest rates.

cvIndex

A matrix detailing how the sample was split for the cross-validation. Output from cvfit.

type

The type of the reserve demand curve. This can be any of rforecast for random forecast or spline for spline regression.

dummy

Optional input to signify a regime change (vertical shifts in the curve). Must be a vector of equal length to the rows of x. If not needed use NULL.

Value

Returns summary cross-validated errors, comparable with the output from cvfit.

Author(s)

Nikolaos Kourentzes, nikolaos@kourentzes.com

References

Chen, Z., Kourentzes, N., & Veyrune, R. (2023). Modeling the Reserve Demand to Facilitate Central Bank Operations. IMF Working Papers, 2023(179).

See Also

cvfit, and cvfitplot.

Examples


  # Use ECB example data
  rate <- ecb$rate
  x <- ecb$x[,1:3,drop=FALSE]
  cvKeep <- cvfit(x,rate,folds=5,alltype=c("logistic","arctan"),parallel=TRUE)
  # Get non-parametric curve cross-validated errors
  cvRF <- cvnpcurve(x,rate,cvKeep$cvIndex)
  cvSP <- cvnpcurve(x,rate,cvKeep$cvIndex,type="spline")



[Package curvir version 0.1.1 Index]