Package: onlineforecast 1.0.2

onlineforecast: Forecast Modelling for Online Applications

A framework for fitting adaptive forecasting models. Provides a way to use forecasts as input to models, e.g. weather forecasts for energy related forecasting. The models can be fitted recursively and can easily be setup for updating parameters when new data arrives. See the included vignettes, the website <https://onlineforecasting.org> and the paper "onlineforecast: An R package for adaptive and recursive forecasting" <https://journal.r-project.org/articles/RJ-2023-031/>.

Authors:Peder Bacher [cre], Hjorleifur G Bergsteinsson [aut]

onlineforecast_1.0.2.tar.gz
onlineforecast_1.0.2.zip(r-4.5)onlineforecast_1.0.2.zip(r-4.4)onlineforecast_1.0.2.zip(r-4.3)
onlineforecast_1.0.2.tgz(r-4.4-x86_64)onlineforecast_1.0.2.tgz(r-4.4-arm64)onlineforecast_1.0.2.tgz(r-4.3-x86_64)onlineforecast_1.0.2.tgz(r-4.3-arm64)
onlineforecast_1.0.2.tar.gz(r-4.5-noble)onlineforecast_1.0.2.tar.gz(r-4.4-noble)
onlineforecast_1.0.2.tgz(r-4.4-emscripten)onlineforecast_1.0.2.tgz(r-4.3-emscripten)
onlineforecast.pdf |onlineforecast.html
onlineforecast/json (API)

# Install 'onlineforecast' in R:
install.packages('onlineforecast', repos = c('https://smart-cities-accelerator.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
Datasets:
  • Dbuilding - Observations and weather forecasts from a single-family building, weather station and Danish Meteorological Institute

On CRAN:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

3.23 score 3 stars 14 scripts 309 downloads 98 exports 5 dependencies

Last updated 1 years agofrom:03eb51a5a1. Checks:OK: 1 NOTE: 8. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 05 2024
R-4.5-win-x86_64NOTENov 05 2024
R-4.5-linux-x86_64NOTENov 05 2024
R-4.4-win-x86_64NOTENov 05 2024
R-4.4-mac-x86_64NOTENov 05 2024
R-4.4-mac-aarch64NOTENov 05 2024
R-4.3-win-x86_64NOTENov 05 2024
R-4.3-mac-x86_64NOTENov 05 2024
R-4.3-mac-aarch64NOTENov 05 2024

Exports:%**%ARas.data.frame.data.listas.data.listas.data.list.data.frameasltaslt.characteraslt.numericaslt.POSIXctaslt.POSIXltbsplinecache_namecache_savecomplete_casescomplete_cases.data.framecomplete_cases.listctct.characterct.numericct.POSIXctct.POSIXltdata.listdepthflattenlistforecastmodelfsgetsegofin_rangeinput_classlagdflagdf.characterlagdf.data.framelagdf.factorlagdf.logicallagdf.matrixlagdf.numericlagdllagveclapply_cbindlapply_cbind_dflapply_rbindlapply_rbind_dflm_fitlm_optimlm_predictlong_formatlplp_vectorlp_vector_cppmake_inputmake_periodicmake_tdaynamsnams<-onepairs.data.listpar_tspbsplinepersistenceplot_tsplot_ts_iseqplot_ts_seriesplot_ts.data.frameplot_ts.data.listplot_ts.matrixplot_ts.rls_fitplotly_tsplotly_ts.data.frameplotly_ts.data.listprint_to_messageprint.forecastmodelpstresampleresample.data.frameresiduals.data.frameresiduals.forecastmodel_fitresiduals.listresiduals.matrixrls_fitrls_optimrls_predictrls_prmrls_summaryrls_updaterls_update_cpprmsescorescore.data.framescore.listsetparstairsstate_getvalstate_setvalstep_optimsubset.data.listsummary.data.listsummary.rls_fit

Dependencies:digestpbsR6RcppRcppArmadillo

Forecast evaluation

Rendered fromforecast-evaluation.Rmdusingknitr::rmarkdownon Nov 05 2024.

Last update: 2022-05-10
Started: 2020-09-15

Model selection

Rendered frommodel-selection.Rmdusingknitr::rmarkdownon Nov 05 2024.

Last update: 2022-05-10
Started: 2021-08-21

Setup and use onlineforecast models

Rendered fromsetup-and-use-model.Rmdusingknitr::rmarkdownon Nov 05 2024.

Last update: 2022-05-10
Started: 2020-09-15

Setup of data for an onlineforecast model

Rendered fromsetup-data.Rmdusingknitr::rmarkdownon Nov 05 2024.

Last update: 2022-05-10
Started: 2020-09-15

Readme and manuals

Help Manual

Help pageTopics
Multiplication of list with y, elementwise%**%
Determine if two data.lists are identical==.data.list
Auto-Regressive (AR) inputAR
Convert to data.frameas.data.frame.data.list
Convert to data.list classas.data.list as.data.list.data.frame
Convertion to POSIXltaslt aslt.character aslt.numeric aslt.POSIXct aslt.POSIXlt
Compute base splines of a variable using the R function 'splines::bs', use in the transform stage.bspline
Generation of a name for a cache file for the value of a function.cache_name
Save a cache file (name generated with 'code_name()'cache_save
Find complete cases in forecast matricescomplete_cases complete_cases.data.frame complete_cases.list
Convertion to POSIXctct ct.character ct.numeric ct.POSIXct ct.POSIXlt
Make a data.listdata.list
Observations and weather forecasts from a single-family building, weather station and Danish Meteorological Institute (DMI)Dbuilding
Depth of a listdepth
Flattens listflattenlist
Class for forecastmodelsforecastmodel
Generation of Fourrier series.fs
Getting subelement from list.getse
Simple wrapper for graphics.off()gof
Selects a periodin_range
Class for forecastmodel inputsinput_class
Lagging which returns a data.framelagdf lagdf.data.frame
Lagging which returns a data.framelagdf.character
Lagging which returns a data.framelagdf.factor
Lagging which returns a data.framelagdf.logical
Lagging which returns a data.framelagdf.matrix
Lagging which returns a data.framelagdf.numeric
Lagging which returns a data.listlagdl
Lag by shiftinglagvec
Helper which does lapply and then cbindlapply_cbind
Helper which does lapply, cbind and then as.data.framelapply_cbind_df
Helper which does lapply and then rbindlapply_rbind
Helper which does lapply, rbind and then as.data.framelapply_rbind_df
Fit an onlineforecast model with 'lm'lm_fit
Optimize parameters for onlineforecast model fitted with LMlm_optim
Prediction with an lm forecast model.lm_predict
Long format of prediction data.framelong_format
First-order low-pass filteringlp
First-order low-pass filteringlp_vector
Low pass filtering of a vector.lp_vector_cpp
Make a forecast matrix (as data.frame) from observations.make_input
Make an forecast matrix with a periodic time signal.make_periodic
Make an hour-of-day forecast matrixmake_tday
Return the column namesnams nams<-
Create ones for model input interceptone
Generation of pairs plot for a data.list.pairs.data.list
Set parameters for 'plot_ts()'par_ts
Wrapper for 'bspline' with 'periodic=TRUE'pbspline
Generate persistence forecastspersistence
Time series plottingplotly_ts plot_ts plot_ts.data.frame plot_ts.data.list plot_ts.matrix plot_ts.rls_fit plot_ts_iseq plot_ts_series
Time series plottingplotly_ts.data.frame
Time series plottingplotly_ts.data.list
Simple function for capturing from the print function and send it in a message().print_to_message
Print forecast modelprint.forecastmodel
Simple wrapper for paste0().pst
Resampling to equidistant time seriesresample
Resampling to equidistant time seriesresample.data.frame
Calculate the residuals given a forecast matrix and the observations.residuals.data.frame residuals.forecastmodel_fit residuals.list residuals.matrix
Fit an onlineforecast model with Recursive Least Squares (RLS).rls_fit
Optimize parameters for onlineforecast model fitted with RLSrls_optim
Prediction with an rls model.rls_predict
Function for generating the parameters for RLS regressionrls_prm
Print summary of an onlineforecast model fitted with RLSrls_summary
Updates the model fitsrls_update
Calculating k-step recursive least squares estimatesrls_update_cpp
Computes the RMSE score.rmse
Calculate the score for each horizon.score score.data.frame score.list
Setting 'par()' plotting parameterssetpar
Plotting stairs with time point at end of interval.stairs
Get the state value kept in last call.state_getval
Set a state value to be kept for next the transformation function is called.state_setval
Forward and backward model selectionstep_optim
Take a subset of a data.list.subset.data.list
Summary with checks of the data.list for appropriate form.summary.data.list
Print summary of an onlineforecast model fitted with RLSsummary.rls_fit