elcf4R: Forecasting Individual Electricity Load Curves

Frédéric Bertrand, Fatima Fahs and Myriam Maumy

R-CMD-check R-hub

Implements Kernel Wavelet Functional (KWF), clustered KWF, Generalized Additive Models (GAM), Multivariate Adaptive Regression Splines (MARS) and RNN LSTM models to forecast individual electricity load curves, following the methodology described in Fahs (2023) and related articles and posters. Includes normalized dataset adapters for iFlex, StoreNet, Low Carbon London and REFIT, scaffolded download/read support for IDEAL and GX, compact shipped example panels, and saved benchmark artifacts.

This site was created by F. Bertrand and the examples reproduced on it were created by F. Bertrand, F. Fahs and M. Maumy-Bertrand.

Installation

You can install the latest version of the elcf4R package from github with:

devtools::install_github("fbertran/elcf4R")

Current Scope

The exported forecasting methods currently covered by the package are:

For the LSTM path, Python selection is explicit and user-driven:

The current dataset adapters and shipped benchmark artifacts cover:

The current download helpers are:

Scaffolded, unshipped dataset adapters:

The current unshipped scaffold readers are:

LSTM backend configuration

elcf4r_fit_lstm() does not auto-select a Python interpreter. Configure the TensorFlow backend explicitly before fitting an LSTM model, for example:

library(reticulate)
library(elcf4R)

elcf4r_use_tensorflow_env(virtualenv = "r-tensorflow", required = TRUE)
# or:
# reticulate::use_virtualenv("r-tensorflow", required = TRUE)
# reticulate::use_python("/path/to/python", required = TRUE)

Shipped example and benchmark datasets

The package now ships compact example panels and saved benchmark results for iFlex, StoreNet, Low Carbon London and REFIT, so the main documentation can run without external downloads. These artifacts are derived from local raw files through the reproducible scripts in data-raw/.

The current shipped benchmark artifacts are:

Vignettes

There are more insights and examples in the vignettes.

vignette("elcf4R-iflex-workflow", package = "elcf4R")
vignette("elcf4R-datasets-vignette", package = "elcf4R")

Quick Benchmark Summary

The shipped benchmark artifacts now cover iFlex, StoreNet, Low Carbon London and REFIT. The same workflow is available programmatically through elcf4r_build_benchmark_index() and elcf4r_benchmark().

benchmark_summary <- Filter(
  Negate(is.null),
  list(
    .elcf4r_benchmark_summary("elcf4r_iflex_benchmark_results", "iflex"),
    .elcf4r_benchmark_summary("elcf4r_storenet_benchmark_results", "storenet"),
    .elcf4r_benchmark_summary("elcf4r_lcl_benchmark_results", "lcl"),
    .elcf4r_benchmark_summary("elcf4r_refit_benchmark_results", "refit")
  )
)

if (length(benchmark_summary) == 0L) {
  data.frame()
} else {
  do.call(rbind, benchmark_summary)
}
#> data frame with 0 columns and 0 rows