Learn R Programming

tsfgrnn

The goal of tsfgrnn is to forecast time series using GRNN regression.

Installation

You can install the released version of tsfgrnn from CRAN with:

install.packages("tsfgrnn")

And the development version from GitHub with:

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

Example

This is a basic example which shows how to forecast with tsfgrnn:

library(tsfgrnn)
pred <- grnn_forecasting(USAccDeaths, h = 12)
pred$prediction # To see a time series with the forecasts
#>            Jan       Feb       Mar       Apr       May       Jun       Jul
#> 1979  8148.640  7237.667  8131.874  8466.715  9440.860  9793.261 10896.977
#>            Aug       Sep       Oct       Nov       Dec
#> 1979 10184.601  9463.049  9412.852  8985.240  9583.652
plot(pred)      # To see a plot with the forecast

To know more, the open access paper Francisco Martinez et al. (2022) describes the package. Also, you can read the package’s vignette.

Acknowledgements

Funds: This work was partially supported by the project TIN2015-68854-R (FEDER Founds) of the Spanish Ministry of Economy and Competitiveness.

Copy Link

Version

Install

install.packages('tsfgrnn')

Monthly Downloads

252

Version

1.0.5

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Francisco Martinez

Last Published

February 15th, 2024

Functions in tsfgrnn (1.0.5)

grnn_examples

Examples of a GRNN model
autoplot.grnnForecast

Create a ggplot object from a grnnForecast object
plot.grnnForecastRO

Plot the prediction for a test set
plot_example

Plot an example used in a prediction of a grnnForecast object
predict.grnnForecast

Predict method for GRNN models for time series forecasting.
rolling_origin

Assessing forecasting accuracy with rolling origin
grnn_forecasting

Time series forecasting using GRNN regression
grnn_weights

Training examples and their corresponding weights used in a prediction