Today, give a try to Techtonique web app, a tool designed to help you make informed, data-driven decisions using Mathematics, Statistics, Machine Learning, and Data Visualization. Here is a tutorial with audio, video, code, and slides: https://moudiki2.gumroad.com/l/nrhgb
Scroll down for the post.
In the world of time series forecasting, capturing nonlinear relationships between multiple series is a challenging yet crucial task. A relatively recent study (2018) by me explored this problem using Quasi-Randomized Functional Link Neural Networks (RVFL networks). The approach offers a novel way to forecast multiple time series while accounting for potential nonlinear interactions. As of March 2025, the model can handle univariate time series and additional regressors and the R Package ahead
containing the implementation has been updated to include conformal prediction, a proven way to obtain higher quality prediction intervals.
How does it work?¶
Forecasting multiple time series is a common problem in fields like economics, finance, energy, weather forecasting, insurance, etc. While models like Long Short-Term Memory (LSTM) networks have gained popularity, they can be computationally expensive to train.
Random Vector Functional Link (RVFL) networks are a type of randomized neural network that combine linear and nonlinear components, making them both efficient and effective for multivariate time series forecasting.
RVFL networks, in the context of the paper, are a type of single-layer feedforward neural network with two key features:
- Direct Link: A linear relationship between the input predictors and the output variable.
- Hidden Nodes: Nonlinear transformations of the input data, generated using quasi-random sequences and an activation functions.
- Two regularization parameters; one for the direct link, the other one for the hidden nodes.
The hidden nodes are not trained but are instead created using deterministic quasi-random numbers, such as Sobol sequences.
Conformal prediction for time series forecasting is described in:
- https://www.researchgate.net/publication/379643443_Conformalized_predictive_simulations_for_univariate_time_series
- https://thierrymoudiki.github.io/blog/2024/11/23/r/generic-conformal-forecast
- https://www.researchgate.net/publication/382589729_Probabilistic_Forecasting_with_nnetsauce_using_Density_Estimation_Bayesian_inference_Conformal_prediction_and_Vine_copulas
For more details, you can read the full paper here.
Code¶
%load_ext rpy2.ipython
%%R
options(repos = c(techtonique = "https://r-packages.techtonique.net",
CRAN = "https://cloud.r-project.org"))
install.packages("ahead")
install.packages("fpp")
%%R
# read the docs for more details: https://docs.techtonique.net/ahead/reference/ridge2f.html
plot(ahead::ridge2f(AirPassengers, n_hidden_features=5L, lags=20L, h=25L, type_pi="conformal-block-bootstrap"))
%%R
obj <- ahead::ridge2f(fpp::insurance,
h=10L, lags=2L,
type_pi = "conformal-bootstrap")
par(mfrow=c(2, 1))
plot(obj, "TV.advert", type = "sims")
plot(obj, "Quotes", type = "dist")
Comments powered by Talkyard.