Skip to content
/ dejavu Public

Efficient algorithms for forecasting with similarity

License

Notifications You must be signed in to change notification settings

kl-lab/dejavu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dejavu

The R package dejavu provides efficient algorithms for forecasting with Similarity of a bunch of time series.

Installation

You can install dejavu package from GitHub Repository with:

devtools::install_github("kl-lab/dejavu")

Usage

Load the package

require("dejavu")

Forecasting with Similarity

Using Reference data from M3 Competition (Download the repository to local first)

  • First download the reference data from GitHub to a folder e.g. workspace. Note that the reference git repository is git-lfs controlled, please use a recent version of git and git-lfs software to clone it.

    cd workspace
    git clone https://github.com/kl-lab/dejavu-refdata.git
  • Now within R, you switch the work directory to workspace

    setwd('workspace')
    library(dtw)
    library(robustbase)
    library(forecast)
    fc_Simi <- Similarity(AirPassengers, fh = 20, LoadData = TRUE, path = NULL)
    fcs_result <- ts(fc_Simi$fcs, start = 1961, frequency = 12)
    PIL_result <- ts(fc_Simi$PIL, start = 1961, frequency = 12)
    PIU_result <- ts(fc_Simi$PIU, start = 1961, frequency = 12)
    autoplot(AirPassengers)+autolayer(fcs_result)+autolayer(PIL_result)+autolayer(PIU_result)


Using user-defined reference data

Assume you have created a user-defined reference in the folder my-dejavu-refdata

fc_Simi <- Similarity(AirPassengers, fh = 20, LoadData = FALSE, path = "my-dejavu-refdata")

References

License

This package is free and open source software, licensed under GPL-3.

About

Efficient algorithms for forecasting with similarity

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages