| Title: | Forecasting With Meta-learned ridge2f |
|---|---|
| Description: | Forecasting with meta-learned ridge2f. |
| Authors: | T. Moudiki [aut, cre] |
| Maintainer: | T. Moudiki <[email protected]> |
| License: | BSD_3_clause + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-26 15:05:06 UTC |
| Source: | https://github.com/Techtonique/metalearnedridge2f |
Forecasting with meta-learned ridge2f.
Index of help topics:
conformalize Conformal-style forecasting via dependent
residual bootstrap
forecast.ridge2 Forecast method for ridge2 model using
simulation-based uncertainty
get_stock_params Retrieve Meta-Learned (on RMSE) Hyperparameters
for Stock Return Forecasting
get_stock_params_crps Retrieve Meta-Learned (on CRPS) Hyperparameters
for Stock Return Forecasting
get_stock_params_crps_stochvol
Retrieve Meta-Learned (on CRPS) Hyperparameters
for Stock Return Forecasting "Stoch vol"
get_stock_params_crps_stochvol_on_garch_synth
Retrieve Meta-Learned (on CRPS) Hyperparameters
for Stock Return Forecasting "Stoch vol",
pretrained on GARCH(1, 1) synthetic data
get_stock_params_crps_with_garch_synth
Retrieve Meta-Learned (on CRPS) Hyperparameters
for Stock Return Forecasting pretrained on
GARCH(1, 1) synthetic data
metalearnedridge2f-package
Forecasting With Meta-learned ridge2f
rcpp_hello_world Simple function using Rcpp
returns_list Daily log-returns for international equity
tickers
ridge2 Ridge2 model for use with 'forecast::forecast'
ridge2f Ridge2 model retrieved from
https://github.com/Techtonique/ahead/blob/main/R/ridge2.R
on 2026-05-17, removed "rvinecopula" for
univariate forecasting
simulate.ridge2 Simulate future paths from a ridge2f forecast
object
stocklogreturns2f Forecasting stock log-returns 2 (pretrained to
minimize CRPS)
stocklogreturns3f Forecasting stock log-returns 2 (pretrained to
minimize CRPS) with stoch vol (finally, vol
with forecast::meanf)
stocklogreturns4f Forecasting stock log-returns 2 (pretrained to
minimize CRPS) with stoch vol (finally, vol
with forecast::meanf), pretrained on GARCH(1,
1) synthetic data
stocklogreturns5f Forecasting stock log-returns, pretrained to
minimize CRPS on GARCH(1, 1) synthetic data
stocklogreturnsf Forecasting stock log-returns
T. Moudiki <[email protected]>
T. Moudiki [aut, cre]
Constructs predictive distributions for time series forecasting models by combining a generic forecasting function with calibration residuals and dependent resampling via stationary bootstrap.
The method is not strict conformal prediction. Instead, it is a
simulation-based forecasting framework where uncertainty is obtained
by resampling calibrated residuals using a data-driven block length
estimated via b.star.
conformalize( FUN, y, h, level = 95, nsim = 250L, scale_residuals = TRUE, seed = 123L, ... )conformalize( FUN, y, h, level = 95, nsim = 250L, scale_residuals = TRUE, seed = 123L, ... )
FUN |
A forecasting function compatible with
|
y |
A numeric vector or |
h |
Forecast horizon (number of steps ahead). |
level |
Confidence level for prediction intervals (e.g. 95). |
nsim |
Number of bootstrap simulations for residual paths. |
scale_residuals |
Logical. If TRUE, residuals are standardized before resampling (stabilization, not volatility modeling). |
seed |
Random seed for reproducibility. |
... |
Additional arguments passed to |
The procedure is:
Split the series into training and calibration sets.
Fit the forecasting model on the training set.
Compute calibration residuals.
Estimate dependence structure using np::b.star.
Generate dependent residual paths using
tseries::tsbootstrap (stationary bootstrap).
Add simulated residuals to forecast means to obtain predictive distributions.
This method is particularly suited for financial time series such as log-returns, where dependence and non-Gaussianity are present but explicit parametric volatility models may be undesirable.
An object of class forecast with components:
Point forecasts as a ts object
Lower prediction bounds
Upper prediction bounds
Simulated forecast paths
Calibration residuals used for bootstrap
Data-driven block length from np::b.star
Fitted values from final model
## Not run: y <- diff(log(fpp2::goog)) fit <- conformalize(FUN = forecast::auto.arima, y = y, h = 20) plot(fit) ## End(Not run)## Not run: y <- diff(log(fpp2::goog)) fit <- conformalize(FUN = forecast::auto.arima, y = y, h = 20) plot(fit) ## End(Not run)
Generate multi-step ahead forecasts from a fitted ridge2 model by refitting the underlying ridge2f model and propagating uncertainty through Monte Carlo simulation of residuals.
## S3 method for class 'ridge2' forecast( object, h = 5L, level = 95, type_pi = c("bootstrap", "gaussian", "sv_generic"), vol_model = forecast::auto.arima, nsim = 250, seed = 42, ... )## S3 method for class 'ridge2' forecast( object, h = 5L, level = 95, type_pi = c("bootstrap", "gaussian", "sv_generic"), vol_model = forecast::auto.arima, nsim = 250, seed = 42, ... )
object |
An object containing a fitted ridge2 model, including:
|
h |
Integer. Forecast horizon (number of steps ahead). |
level |
Numeric vector. Confidence levels for prediction intervals
(e.g. |
type_pi |
A string. The type of prediction interval. "bootstrap"
or "gaussian" or "sv_generic" (the latter use |
vol_model |
volatility model, could be anything, e.g |
nsim |
Integer. Number of Monte Carlo simulation paths used to
approximate the predictive distribution. Default is |
seed |
Integer. Random seed for reproducibility of simulations. |
... |
Additional parameters to be passed to the forecasting
function for |
This method produces probabilistic forecasts by: (1) reconstructing the underlying ridge2f model, (2) generating future sample paths via residual-based simulation, (3) summarizing the simulated paths into point forecasts and prediction intervals.
Forecasts are generated using a simulation-based approximation of the
predictive distribution. The underlying ridge2f model is refitted internally
with horizon h, and future paths are generated using residual-based
bootstrap simulation via metalearnedridge2f::simulate.
Let denote simulated future paths:
where are resampled residuals.
Summary statistics are then computed as:
Mean: rowMeans(sims)
Lower bound: empirical quantiles at (1 - level)/2
Upper bound: empirical quantiles at 1 - (1 - level)/2
This approach produces coherent probabilistic forecasts suitable for evaluation using proper scoring rules such as CRPS.
An object of class "forecast" containing:
meanPoint forecasts computed as row means of simulated paths
lowerLower prediction bounds computed from empirical quantiles
upperUpper prediction bounds computed from empirical quantiles
levelRequested confidence levels for prediction intervals
methodForecasting method identifier ("ridge2")
fittedIn-sample fitted values from original model
residualsIn-sample residuals used for simulation
ridge2f,
simulate,
crps_sample,
forecast
require(forecast) par(mfrow=c(2, 2)) fit <- ridge2(USAccDeaths, lags = 15) (fc1 <- forecast(fit, h = 20, nsim = 500, type_pi = "bootstrap")) plot(fc1) fit <- ridge2(USAccDeaths, lags = 15) (fc2 <- forecast(fit, h = 20, nsim = 500, type_pi = "gaussian")) plot(fc2) fit <- ridge2(USAccDeaths, lags = 15) (fc3 <- forecast(fit, h = 20, nsim = 500, type_pi = "sv_generic")) plot(fc3) fit <- ridge2(USAccDeaths, lags = 15) (fc4 <- forecast(fit, h = 20, nsim = 500, type_pi = "sv_generic", vol_model=forecast::thetaf)) plot(fc4) par(mfrow=c(1, 1)) par(mfrow=c(2, 2)) fit <- ridge2(diff(log(fpp2::goog200)), lags = 15) (fc1 <- forecast(fit, h = 20, nsim = 500, type_pi = "bootstrap")) plot(fc1) fit <- ridge2(diff(log(fpp2::goog200)), lags = 15) (fc2 <- forecast(fit, h = 20, nsim = 500, type_pi = "gaussian")) plot(fc2) fit <- ridge2(diff(log(fpp2::goog200)), lags = 15) (fc3 <- forecast(fit, h = 20, nsim = 500, type_pi = "sv_generic")) plot(fc3) fit <- ridge2(diff(log(fpp2::goog200)), lags = 15) (fc4 <- forecast(fit, h = 20, nsim = 500, type_pi = "sv_generic", vol_model=forecast::thetaf)) plot(fc4) par(mfrow=c(1, 1)) # CRPS evaluation: # scoringRules::crps_sample(y_true, dat = fc$sims)require(forecast) par(mfrow=c(2, 2)) fit <- ridge2(USAccDeaths, lags = 15) (fc1 <- forecast(fit, h = 20, nsim = 500, type_pi = "bootstrap")) plot(fc1) fit <- ridge2(USAccDeaths, lags = 15) (fc2 <- forecast(fit, h = 20, nsim = 500, type_pi = "gaussian")) plot(fc2) fit <- ridge2(USAccDeaths, lags = 15) (fc3 <- forecast(fit, h = 20, nsim = 500, type_pi = "sv_generic")) plot(fc3) fit <- ridge2(USAccDeaths, lags = 15) (fc4 <- forecast(fit, h = 20, nsim = 500, type_pi = "sv_generic", vol_model=forecast::thetaf)) plot(fc4) par(mfrow=c(1, 1)) par(mfrow=c(2, 2)) fit <- ridge2(diff(log(fpp2::goog200)), lags = 15) (fc1 <- forecast(fit, h = 20, nsim = 500, type_pi = "bootstrap")) plot(fc1) fit <- ridge2(diff(log(fpp2::goog200)), lags = 15) (fc2 <- forecast(fit, h = 20, nsim = 500, type_pi = "gaussian")) plot(fc2) fit <- ridge2(diff(log(fpp2::goog200)), lags = 15) (fc3 <- forecast(fit, h = 20, nsim = 500, type_pi = "sv_generic")) plot(fc3) fit <- ridge2(diff(log(fpp2::goog200)), lags = 15) (fc4 <- forecast(fit, h = 20, nsim = 500, type_pi = "sv_generic", vol_model=forecast::thetaf)) plot(fc4) par(mfrow=c(1, 1)) # CRPS evaluation: # scoringRules::crps_sample(y_true, dat = fc$sims)
Returns the internally stored meta-learned hyperparameters obtained from clustering-based optimization for stock return forecasting models.
get_stock_params()get_stock_params()
These hyperparameters are loaded when the package is attached and can be used as defaults, warm starts, or priors for forecasting workflows.
The returned object is stored internally in the package namespace and accessed through a package-private environment.
A list, data frame, or other structured object containing the best hyperparameter configurations associated with clustered stock return forecasting tasks.
params <- get_stock_params()params <- get_stock_params()
Returns the internally stored meta-learned hyperparameters obtained from clustering-based optimization for stock return forecasting models.
get_stock_params_crps()get_stock_params_crps()
These hyperparameters are loaded when the package is attached and can be used as defaults, warm starts, or priors for forecasting workflows.
The returned object is stored internally in the package namespace and accessed through a package-private environment.
A list, data frame, or other structured object containing the best hyperparameter configurations associated with clustered stock return forecasting tasks.
params <- get_stock_params_crps()params <- get_stock_params_crps()
Returns the internally stored meta-learned hyperparameters obtained from clustering-based optimization for stock return forecasting models.
get_stock_params_crps_stochvol()get_stock_params_crps_stochvol()
These hyperparameters are loaded when the package is attached and can be used as defaults, warm starts, or priors for forecasting workflows.
The returned object is stored internally in the package namespace and accessed through a package-private environment.
A list, data frame, or other structured object containing the best hyperparameter configurations associated with clustered stock return forecasting tasks.
params <- get_stock_params_crps_stochvol()params <- get_stock_params_crps_stochvol()
Returns the internally stored meta-learned hyperparameters obtained from clustering-based optimization for stock return forecasting models.
get_stock_params_crps_stochvol_on_garch_synth()get_stock_params_crps_stochvol_on_garch_synth()
These hyperparameters are loaded when the package is attached and can be used as defaults, warm starts, or priors for forecasting workflows.
The returned object is stored internally in the package namespace and accessed through a package-private environment.
A list, data frame, or other structured object containing the best hyperparameter configurations associated with clustered stock return forecasting tasks.
params <- get_stock_params_crps_stochvol_on_garch_synth()params <- get_stock_params_crps_stochvol_on_garch_synth()
These hyperparameters are loaded when the package is attached and can be used as defaults, warm starts, or priors for forecasting workflows.
get_stock_params_crps_with_garch_synth()get_stock_params_crps_with_garch_synth()
The returned object is stored internally in the package namespace and accessed through a package-private environment.
A list, data frame, or other structured object containing the best hyperparameter configurations associated with clustered stock return forecasting tasks.
params <- get_stock_params_crps_with_garch_synth()params <- get_stock_params_crps_with_garch_synth()
Simple function using Rcpp
rcpp_hello_world()rcpp_hello_world()
## Not run: rcpp_hello_world() ## End(Not run)## Not run: rcpp_hello_world() ## End(Not run)
A named list of univariate time series objects containing daily log-returns computed from adjusted closing prices downloaded from Yahoo Finance using 'quantmod::getSymbols'.
A named list of 10 objects of class 'ts'.
Apple daily log-returns
Microsoft daily log-returns
JPMorgan Chase daily log-returns
Airbus daily log-returns
LVMH daily log-returns
Sanofi daily log-returns
Volkswagen daily log-returns
SAP daily log-returns
Nestlé daily log-returns
Novartis daily log-returns
Returns are computed as:
where denotes the adjusted closing price at time .
The series have trading-day frequency ('frequency = 252') and cover the period from 2018-01-01 to 2019-12-02.
The dataset includes equity tickers from multiple international indices:
United States: AAPL, MSFT, JPM
France (CAC 40): AIR.PA, MC.PA, SAN.PA
Germany (DAX): VOW3.DE, SAP.DE
Switzerland (SMI): NESN.SW, NOVN.SW
Adjusted daily prices obtained from Yahoo Finance.
data(returns_list) names(returns_list) plot(returns_list$AAPL) summary(returns_list$MC.PA)data(returns_list) names(returns_list) plot(returns_list$AAPL) summary(returns_list$MC.PA)
forecast::forecast
Random Vector functional link network model with 2 regularization parameters
ridge2( y, xreg = NULL, lags = 1, nb_hidden = 5, nodes_sim = c("sobol", "halton", "unif"), activ = c("relu", "sigmoid", "tanh", "leakyrelu", "elu", "linear"), a = 0.01, lambda_1 = 0.1, lambda_2 = 0.1, dropout = 0, seed = 1, centers = NULL, type_clustering = c("kmeans", "hclust"), cl = 1L, ... )ridge2( y, xreg = NULL, lags = 1, nb_hidden = 5, nodes_sim = c("sobol", "halton", "unif"), activ = c("relu", "sigmoid", "tanh", "leakyrelu", "elu", "linear"), a = 0.01, lambda_1 = 0.1, lambda_2 = 0.1, dropout = 0, seed = 1, centers = NULL, type_clustering = c("kmeans", "hclust"), cl = 1L, ... )
y |
A univariate of multivariate time series of class |
xreg |
External regressors. A data.frame (preferred) or a |
lags |
Number of lags |
|
Number of nodes in hidden layer |
|
nodes_sim |
Type of simulation for nodes in the hidden layer |
activ |
Activation function |
a |
Hyperparameter for activation function "leakyrelu", "elu" |
lambda_1 |
Regularization parameter for original predictors |
lambda_2 |
Regularization parameter for transformed predictors |
dropout |
dropout regularization parameter (dropping nodes in hidden layer) |
seed |
Reproducibility seed for 'nodes_sim == unif' |
centers |
Number of clusters for |
type_clustering |
"kmeans" (K-Means clustering) or "hclust" (Hierarchical clustering) |
cl |
An integer; the number of clusters for parallel execution, for bootstrap |
... |
An object of class "mtsforecast"; a list containing the following elements:
method |
The name of the forecasting method as a character string |
mean |
Point forecasts for the time series |
lower |
Lower bound for prediction interval |
upper |
Upper bound for prediction interval |
sims |
Model simulations for bootstrapping (basic, or block) |
x |
The original time series |
residuals |
Residuals from the fitted model |
coefficients |
Regression coefficients for |
T. Moudiki
Moudiki, T., Planchet, F., & Cousin, A. (2018).
Multiple time series forecasting using quasi-randomized
functional link neural networks. Risks, 6(1), 22.
(fit <- ridge2(AirPassengers, lags = 20))(fit <- ridge2(AirPassengers, lags = 20))
Random Vector functional link network model with 2 regularization parameters
ridge2f( y, h = 5, level = 95, xreg = NULL, lags = 1, nb_hidden = 5, nodes_sim = c("sobol", "halton", "unif"), activ = c("relu", "sigmoid", "tanh", "leakyrelu", "elu", "linear"), a = 0.01, lambda_1 = 0.1, lambda_2 = 0.1, dropout = 0, type_forecast = c("recursive", "direct"), type_pi = c("gaussian", "bootstrap", "blockbootstrap", "movingblockbootstrap", "none"), block_length = NULL, seed = 1, B = 100L, type_aggregation = c("mean", "median"), centers = NULL, type_clustering = c("kmeans", "hclust"), cl = 1L, show_progress = TRUE, ... )ridge2f( y, h = 5, level = 95, xreg = NULL, lags = 1, nb_hidden = 5, nodes_sim = c("sobol", "halton", "unif"), activ = c("relu", "sigmoid", "tanh", "leakyrelu", "elu", "linear"), a = 0.01, lambda_1 = 0.1, lambda_2 = 0.1, dropout = 0, type_forecast = c("recursive", "direct"), type_pi = c("gaussian", "bootstrap", "blockbootstrap", "movingblockbootstrap", "none"), block_length = NULL, seed = 1, B = 100L, type_aggregation = c("mean", "median"), centers = NULL, type_clustering = c("kmeans", "hclust"), cl = 1L, show_progress = TRUE, ... )
y |
A univariate of multivariate time series of class |
h |
Forecasting horizon |
level |
Confidence level for prediction intervals |
xreg |
External regressors. A data.frame (preferred) or a |
lags |
Number of lags |
|
Number of nodes in hidden layer |
|
nodes_sim |
Type of simulation for nodes in the hidden layer |
activ |
Activation function |
a |
Hyperparameter for activation function "leakyrelu", "elu" |
lambda_1 |
Regularization parameter for original predictors |
lambda_2 |
Regularization parameter for transformed predictors |
dropout |
dropout regularization parameter (dropping nodes in hidden layer) |
type_forecast |
Recursive or direct forecast |
type_pi |
Type of prediction interval currently "gaussian", "bootstrap", "blockbootstrap", "movingblockbootstrap" |
block_length |
Length of block for circular or moving block bootstrap |
seed |
Reproducibility seed for random stuff |
B |
Number of bootstrap replications or number of simulations (yes, 'B' is unfortunate) |
type_aggregation |
Type of aggregation, ONLY for bootstrapping; either "mean" or "median" |
centers |
Number of clusters for |
type_clustering |
"kmeans" (K-Means clustering) or "hclust" (Hierarchical clustering) |
cl |
An integer; the number of clusters for parallel execution, for bootstrap |
show_progress |
A boolean; show progress bar for bootstrapping? Default is TRUE. |
... |
An object of class "mtsforecast"; a list containing the following elements:
method |
The name of the forecasting method as a character string |
mean |
Point forecasts for the time series |
lower |
Lower bound for prediction interval |
upper |
Upper bound for prediction interval |
sims |
Model simulations for bootstrapping (basic, or block) |
x |
The original time series |
residuals |
Residuals from the fitted model |
coefficients |
Regression coefficients for |
T. Moudiki
Moudiki, T., Planchet, F., & Cousin, A. (2018).
Multiple time series forecasting using quasi-randomized
functional link neural networks. Risks, 6(1), 22.
require(forecast) plot(metalearnedridge2f::ridge2f(AirPassengers, h=20, lags=20)) plot(metalearnedridge2f::ridge2f(USAccDeaths, h=20, lags=15))require(forecast) plot(metalearnedridge2f::ridge2f(AirPassengers, h=20, lags=20)) plot(metalearnedridge2f::ridge2f(USAccDeaths, h=20, lags=15))
Generate Monte Carlo sample paths from a fitted ridge2f model
using a residual bootstrap approach. Future values are simulated by
adding resampled in-sample residuals to the model's point forecasts.
## S3 method for class 'ridge2' simulate( object, nsim = length(object$x), type = c("bootstrap", "gaussian", "sv_generic"), vol_model = forecast::auto.arima, seed = 42, ... )## S3 method for class 'ridge2' simulate( object, nsim = length(object$x), type = c("bootstrap", "gaussian", "sv_generic"), vol_model = forecast::auto.arima, seed = 42, ... )
object |
An object of class |
nsim |
Integer. Number of Monte Carlo simulation paths to generate.
Default is |
type |
A string. The type of simulation, either "bootstrap" or "gaussian" or
"sv_generic" (the latter use |
vol_model |
volatility model, could be anything, e.g |
seed |
Integer. Random seed for reproducibility. Default is |
... |
Additional parameters to be passed to the forecasting
function for |
This provides an empirical approximation of the predictive distribution,
which can be used for probabilistic forecasting, uncertainty quantification,
and proper scoring rules such as CRPS via scoringRules::crps_sample.
The simulation model assumes:
where is the point forecast and is
a residual sampled with replacement from in-sample residuals.
This is a non-parametric bootstrap approximation of the predictive distribution and does not assume Gaussianity.
A numeric matrix of dimension h x nsim, where:
hForecast horizon (length of object$mean)
nsimNumber of simulated future trajectories
Each column represents one simulated future path.
ridge2f, crps_sample,
forecast
fit <- metalearnedridge2f::ridge2(AirPassengers, lags = 20L) sims <- simulate(fit, nsim = 500, seed = 123) # CRPS evaluation # scoringRules::crps_sample(y = true_values, dat = sims)fit <- metalearnedridge2f::ridge2(AirPassengers, lags = 20L) sims <- simulate(fit, nsim = 500, seed = 123) # CRPS evaluation # scoringRules::crps_sample(y = true_values, dat = sims)
Forecasting stock log-returns with a meta-learned (to minimize CRPS) model based on ridge2f
stocklogreturns2f(y, h = 10L, level = 95, seed = 1, B = 250L)stocklogreturns2f(y, h = 10L, level = 95, seed = 1, B = 250L)
y |
A univariate time series of class |
h |
Forecasting horizon |
level |
Confidence level for prediction intervals |
seed |
Reproducibility seed for random stuff |
B |
Number of bootstrap replications or number of simulations |
require(fpp2) plot(metalearnedridge2f::stocklogreturns2f(diff(log(fpp2::goog200)), h=20))require(fpp2) plot(metalearnedridge2f::stocklogreturns2f(diff(log(fpp2::goog200)), h=20))
Forecasting stock log-returns with a meta-learned (to minimize CRPS) model based on ridge2f with stoch vol (finally, vol with forecast::meanf)
stocklogreturns3f(y, h = 10L, level = 95, seed = 1, B = 250L)stocklogreturns3f(y, h = 10L, level = 95, seed = 1, B = 250L)
y |
A univariate time series of class |
h |
Forecasting horizon |
level |
Confidence level for prediction intervals |
seed |
Reproducibility seed for random stuff |
B |
Number of bootstrap replications or number of simulations |
# this returns an error; the hyperparams produce a degenerate matrix #require(fpp2) #plot(metalearnedridge2f::stocklogreturns3f(diff(log(fpp2::goog200)), h=20))# this returns an error; the hyperparams produce a degenerate matrix #require(fpp2) #plot(metalearnedridge2f::stocklogreturns3f(diff(log(fpp2::goog200)), h=20))
Forecasting stock log-returns with a meta-learned (to minimize CRPS) model based on ridge2f with stoch vol (finally, vol with forecast::meanf)
stocklogreturns4f(y, h = 10L, level = 95, seed = 1, B = 250L)stocklogreturns4f(y, h = 10L, level = 95, seed = 1, B = 250L)
y |
A univariate time series of class |
h |
Forecasting horizon |
level |
Confidence level for prediction intervals |
seed |
Reproducibility seed for random stuff |
B |
Number of bootstrap replications or number of simulations |
require(fpp2) plot(metalearnedridge2f::stocklogreturns4f(diff(log(fpp2::goog200)), h=20))require(fpp2) plot(metalearnedridge2f::stocklogreturns4f(diff(log(fpp2::goog200)), h=20))
Forecasting stock log-returns with a meta-learned (to minimize CRPS) model based on ridge2f pretrained on GARCH(1, 1) synthetic data
stocklogreturns5f(y, h = 10L, level = 95, seed = 1, B = 250L)stocklogreturns5f(y, h = 10L, level = 95, seed = 1, B = 250L)
y |
A univariate time series of class |
h |
Forecasting horizon |
level |
Confidence level for prediction intervals |
seed |
Reproducibility seed for random stuff |
B |
Number of bootstrap replications or number of simulations |
require(fpp2) plot(metalearnedridge2f::stocklogreturns5f(diff(log(fpp2::goog200)), h=20))require(fpp2) plot(metalearnedridge2f::stocklogreturns5f(diff(log(fpp2::goog200)), h=20))
Forecasting stock log-returns with a meta-learned (to minimize RMSE) model based on ridge2f
stocklogreturnsf( y, h = 10L, level = 95, type_pi = c("gaussian", "bootstrap", "blockbootstrap", "movingblockbootstrap"), seed = 1, B = 250L )stocklogreturnsf( y, h = 10L, level = 95, type_pi = c("gaussian", "bootstrap", "blockbootstrap", "movingblockbootstrap"), seed = 1, B = 250L )
y |
A univariate time series of class |
h |
Forecasting horizon |
level |
Confidence level for prediction intervals |
type_pi |
Type of prediction interval currently "gaussian", "bootstrap", "blockbootstrap", "movingblockbootstrap", "conformal-split", "conformal-bootstrap", "conformal-block-bootstrap" |
seed |
Reproducibility seed for random stuff |
B |
Number of bootstrap replications or number of simulations (yes, 'B' is unfortunate) |
require(fpp2) plot(metalearnedridge2f::stocklogreturnsf(diff(log(fpp2::goog200)), h=20))require(fpp2) plot(metalearnedridge2f::stocklogreturnsf(diff(log(fpp2::goog200)), h=20))