Learn R Programming

⚠️There's a newer version (1.0.2) of this package.Take me there.

onlineforecast (version 1.0.1)

Forecast Modelling for Online Applications

Description

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 and the pre-print paper "onlineforecast: An R package for adaptive and recursive forecasting" .

Copy Link

Version

Install

install.packages('onlineforecast')

Monthly Downloads

337

Version

1.0.1

License

GPL-3

Maintainer

Peder Bacher

Last Published

May 10th, 2022

Functions in onlineforecast (1.0.1)

complete_cases

Find complete cases in forecast matrices
AR

Auto-Regressive (AR) input
as.data.list

Convert to data.list class
aslt

Convertion to POSIXlt
ct

Convertion to POSIXct
as.data.frame.data.list

Convert to data.frame
bspline

Compute base splines of a variable using the R function splines::bs, use in the transform stage.
cache_name

Generation of a name for a cache file for the value of a function.
Dbuilding

Observations and weather forecasts from a single-family building, weather station and Danish Meteorological Institute (DMI)
data.list

Make a data.list
one

Create ones for model input intercept
fs

Generation of Fourrier series.
forecastmodel

Class for forecastmodels
onlineforecast

Functions for online forecasting
lagdl

Lagging which returns a data.list
pbspline

Wrapper for bspline with periodic=TRUE
depth

Depth of a list
make_input

Make a forecast matrix (as data.frame) from observations.
lagvec

Lag by shifting
make_periodic

Make an forecast matrix with a periodic time signal.
input_class

Class for forecastmodel inputs
pairs.data.list

Generation of pairs plot for a data.list.
persistence

Generate persistence forecasts
lagdf

Lagging which returns a data.frame
par_ts

Set parameters for plot_ts()
summary.data.list

Summary with checks of the data.list for appropriate form.
rls_optim

Optimize parameters for onlineforecast model fitted with RLS
subset.data.list

Take a subset of a data.list.
rls_fit

Fit an onlineforecast model with Recursive Least Squares (RLS).
cache_save

Save a cache file (name generated with code_name()
in_range

Selects a period
%**%

Multiplication of list with y, elementwise
lapply_cbind

Helper which does lapply and then cbind
==.data.list

Determine if two data.lists are identical
rls_summary

Print summary of an onlineforecast model fitted with RLS
lm_predict

Prediction with an lm forecast model.
long_format

Long format of prediction data.frame
lapply_cbind_df

Helper which does lapply, cbind and then as.data.frame
rls_update

Updates the model fits
lp

First-order low-pass filtering
resample

Resampling to equidistant time series
residuals.data.frame

Calculate the residuals given a forecast matrix and the observations.
lp_vector_cpp

Low pass filtering of a vector.
lm_fit

lm_optim

Optimize parameters for onlineforecast model fitted with LM
score

Calculate the score for each horizon.
getse

Getting subelement from list.
gof

Simple wrapper for graphics.off()
print_to_message

Simple function for capturing from the print function and send it in a message().
setpar

Setting par() plotting parameters
stairs

Plotting stairs with time point at end of interval.
flattenlist

Flattens list
lapply_rbind

Helper which does lapply and then rbind
state_getval

Get the state value kept in last call.
plot_ts

Time series plotting
make_tday

Make an hour-of-day forecast matrix
lapply_rbind_df

Helper which does lapply, rbind and then as.data.frame
nams

Return the column names
pst

Simple wrapper for paste0().
rls_prm

Function for generating the parameters for RLS regression
rls_predict

Prediction with an rls model.
print.forecastmodel

Print forecast model
rls_update_cpp

Calculating k-step recursive least squares estimates
rmse

Computes the RMSE score.
step_optim

Forward and backward model selection
state_setval

Set a state value to be kept for next the transformation function is called.