Learn R Programming

utsf

The utsf package provides an engine for univariate time series forecasting using different regression models in an autoregressive way. The engine provides an uniform interface for applying the different models. Furthermore, it is extensible so that users can easily apply their own regression models to univariate time series forecasting and benefit from all the features of the engine, such as preprocessings or estimation of forecast accuracy.

Installation

You can install the development version of utsf from GitHub with:

# install.packages("devtools")
devtools::install_github("franciscomartinezdelrio/utsf")

Example

This is a basic example which shows you how to solve a common problem:

library(utsf)
# Forecast the next 12 future values of time series AirPassengers using random forest
m <- create_model(AirPassengers, method = "rf")
f <- forecast(m, h = 12)
f$pred # to see the forecast
#>           Jan      Feb      Mar      Apr      May      Jun      Jul      Aug
#> 1961 453.9965 445.0194 471.3746 489.6408 511.3382 574.8855 637.5217 636.8638
#>           Sep      Oct      Nov      Dec
#> 1961 550.5418 503.2502 452.0925 475.6288
library(ggplot2)
autoplot(f)

If you are interested in this package you can read its vignette where all its important features are described.

Copy Link

Version

Install

install.packages('utsf')

Monthly Downloads

159

Version

1.3.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Francisco Martinez

Last Published

July 8th, 2025

Functions in utsf (1.3.0)

create_model

Train an univariate time series forecasting model
predict.utsf

Prediction from utsf objects
tune_grid

Estimate the forecast accuracy of a model on a time series according to a grid of parameters
reexports

Objects exported from other packages
build_examples

Build the training examples
efa

Estimate the forecast accuracy of a model on a time series
autoplot.utsf_forecast

Create a ggplot object from an utsf_forecast object
forecast.utsf

Forecasting a time series
trend

Specifying the transformation for dealing with trended series
utsf-package

utsf: Univariate Time Series Forecasting