curveopt {curvir} | R Documentation |
Optimise curve parameters
Description
Finds optimal curve parameters.
Usage
curveopt(
x,
y,
type = "logistic",
constant = c(TRUE, FALSE),
reps = 3,
sign = NULL,
q = NULL,
winit = NULL,
yhat = NULL,
wsel = c("select", "combine"),
dummy = NULL,
sameSign = c(TRUE, FALSE)
)
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. |
type |
The type of the reserve demand curve. This can be any of |
constant |
A logical ( |
reps |
Number of repetitions for the particle swarm optimisation. |
sign |
A vector of equal length to the number of additional regressors in |
q |
The desired quantile to optimise for. Use |
winit |
A vector of initial values for the optimisation. This will also carry over to sign restrictions if |
yhat |
Useful when estimating quantiles. Supply here the predicted values for the conditional expectation to add restrictions for the quantiles to not cross the conditional expectation. Use |
wsel |
Use the minimum error set of parameters ( |
dummy |
Optional input to signify a regime change (vertical shifts in the curve). Must be a vector of equal length to the rows of |
sameSign |
Used if |
Value
Returns a list of
-
w
The optimal parameters -
mse
The Mean Squared Error of the fitted curve.
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).
Kourentzes, N., Barrow, D., & Petropoulos, F. (2019). Another look at forecast selection and combination: Evidence from forecast pooling. International Journal of Production Economics, 209, 226-235.
See Also
Examples
# Use ECB example data
rate <- ecb$rate
x <- ecb$x[,1,drop=FALSE]
curveopt(x,rate)