Learn R Programming

curvir (version 0.1.1)

predict.curvir: Predict method for curvir reserve demand models

Description

Predicted values based on curvir model object

Predicted values based on npcurvir model object

Usage

# S3 method for curvir
predict(object, newdata = NULL, newdummy = NULL, ...)

# S3 method for npcurvir predict(object, newdata = NULL, newdummy = NULL, ...)

Value

Returns a matrix of predicted values. If the model has estimates for intervals then it will provide upper and lower intervals.

Returns a matrix of predicted values. If the model has estimates for intervals then it will provide upper and lower intervals.

Arguments

object

A model fit with npcurve.

newdata

New input data organised as the x matrix in curve. If NULL then the data used to fit the model is re-used.

newdummy

New input dummy organised as the dummy vector in curve. If NULL then the dummy used to fit the model is re-used.

...

Further arguments (unused)

Methods (by class)

  • predict(curvir): Predicted values for parametric curves

  • predict(npcurvir): Predicted values for non-parametric curves

Author

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

curve.

npcurve.

Examples

Run this code
# \dontshow{
  rate <- head(ecb$rate,10)
  x <- ecb$x[1:10,1,drop=FALSE]
  fit <- curve(x,rate,rep=1,type="fixExponential")
  predict(fit)
# }
# \donttest{
  # Use ECB example data
  rate <- ecb$rate
  x <- ecb$x[,1,drop=FALSE]
  fit <- curve(x,rate)
  predict(fit)

  # An example with new data
  predict(fit,newdata=tail(x))
 # }

# Use ECB example data
rate <- ecb$rate
x <- ecb$x[,1,drop=FALSE]
fit <- npcurve(x,rate)
predict(fit)

Run the code above in your browser using DataLab