mlf | R Documentation |
Conformalized Forecasting using Machine Leaning models
mlf(
y,
h = 5,
level = 95,
lags = 15L,
fit_func = ahead::ridge,
predict_func = predict,
coeffs = NULL,
type_pi = c("kde", "surrogate", "bootstrap"),
B = 250L,
agg = c("mean", "median"),
seed = 123,
...
)
y |
A numeric vector or time series of class |
h |
Forecasting horizon |
level |
Confidence level for prediction intervals |
lags |
Number of lags of the input time series considered in the regression |
fit_func |
Fitting function (Statistical/ML model). Default is Ridge regression. |
predict_func |
Prediction function (Statistical/ML model) |
coeffs |
Coefficients of the fitted model. If provided, a linear combination with the coefficients is used to compute the prediction. |
type_pi |
Type of prediction interval |
B |
Number of bootstrap replications or number of simulations |
agg |
"mean" or "median" (aggregation method) |
... |
additional parameters passed to the fitting function |
res <- ahead::mlf(USAccDeaths, h=10L, lags=15L, type_pi="surrogate", B=250L)
plot(res)
res <- ahead::mlf(USAccDeaths, fit_func = glmnet::cv.glmnet, h=15L, lags=15L,
type_pi="kde", B=250L)
plot(res)
(res <- ahead::mlf(USAccDeaths, fit_func = e1071::svm, h=15L, lags=15L,
type_pi="kde", B=250L))
plot(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.