Learn R Programming

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

onlineforecast (version 1.0.0)

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

398

Version

1.0.0

License

GPL-3

Maintainer

Peder Bacher

Last Published

September 30th, 2021

Functions in onlineforecast (1.0.0)

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.
check

Checking the object for appropriate form.
cache_save

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

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

Checking the data.list for appropriate form.
aslt

Convertion to POSIXlt
as.data.frame.data.list

Convert to data.frame
Dbuilding

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

Convert to data.list class
==.data.list

Determine if two data.lists are identical
ct

Convertion to POSIXct
in_range

Selects a period
complete_cases

Find complete cases in forecast matrices
%**%

Multiplication of list with y, elementwise
lagdl

Lagging which returns a data.list
lagvec

Lag by shifting
fs

Generation of Fourrier series.
lapply_rbind_df

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

Class for forecastmodels
lapply_rbind

Helper which does lapply and then rbind
data.list

Make a data.list
depth

Depth of a list
long_format

Long format of prediction data.frame
lm_predict

Prediction with an lm forecast model.
one

Create ones for model input intercept
onlineforecast

Functions for online forecasting
input_class

Class for forecastmodel inputs
make_input

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

Simple wrapper for graphics.off()
make_tday

Make an hour-of-day forecast matrix
getse

Getting subelement from list.
lp

First-order low-pass filtering
pbspline

Wrapper for bspline with periodic=TRUE
lm_fit

lm_optim

Optimize parameters for onlineforecast model fitted with LM
lagdf

Lagging which returns a data.frame
rls_optim

Optimize parameters for onlineforecast model fitted with RLS
rls_fit

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

Low pass filtering of a vector.
plot_ts

Time series plotting
print_to_message

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

Return the column names
rmse

Computes the RMSE score.
stairs

Plotting stairs with time point at end of interval.
pst

Simple wrapper for paste0().
rls_update_cpp

Calculating k-step recursive least squares estimates
print.forecastmodel

Print forecast model
state_setval

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

Forward and backward model selection
state_getval

Get the state value kept in last call.
persistence

Generate persistence forecasts
residuals.data.frame

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

Setting par() plotting parameters
score

Calculate the score for each horizon.
resample

Resampling to equidistant time series
lapply_cbind

Helper which does lapply and then cbind
lapply_cbind_df

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

Flattens list
rls_update

Updates the model fits
rls_summary

Print summary of an onlineforecast model fitted with RLS
make_periodic

Make an forecast matrix with a periodic time signal.
par_ts

pairs.data.list

Generation of pairs plot for a data.list.
rls_predict

Prediction with an rls model.
subset.data.list

Take a subset of a data.list.
rls_prm

Function for generating the parameters for RLS regression