- Notifications
You must be signed in to change notification settings - Fork30
GRATIS: GeneRAting TIme Series with diverse and controllable characteristics
License
ykang/gratis
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
The R packagegratis (previously known astsgeneration) providesefficient algorithms for generating time series with diverse andcontrollable characteristics.
install.packages("gratis")You can install thedevelopment version ofgratis package fromGitHub Repository with:
devtools::install_github("ykang/gratis")
Watchthis YouTube videoprovided byProf. Rob Hyndman.
library(gratis)library(feasts)
set.seed(1)mar_model(seasonal_periods=12) %>% generate(length=120,nseries=2) %>% autoplot(value)
mar_model(seasonal_periods=c(24,24*7)) %>% generate(length=24*7*10,nseries=12) %>% autoplot(value)
library(dplyr)# Function to return spectral entropy, and ACF at lags 1 and 2# given a numeric vector inputmy_features<-function(y) { c(tsfeatures::entropy(y),acf= acf(y,plot=FALSE)$acf[2:3,1,1])}# Produce series with entropy = 0.5, ACF1 = 0.9 and ACF2 = 0.8df<- generate_target(length=60,feature_function=my_features,target= c(0.5,0.9,0.8))df %>% as_tibble() %>% group_by(key) %>% summarise(value= my_features(value),feature=c("entropy","acf1","acf2"),.groups="drop")#> # A tibble: 30 × 3#> key value feature#> <chr> <dbl> <chr>#> 1 Series 1 0.533 entropy#> 2 Series 1 0.850 acf1#> 3 Series 1 0.735 acf2#> 4 Series 10 0.478 entropy#> 5 Series 10 0.880 acf1#> 6 Series 10 0.764 acf2#> 7 Series 2 0.507 entropy#> 8 Series 2 0.890 acf1#> 9 Series 2 0.899 acf2#> 10 Series 3 0.454 entropy#> # … with 20 more rowsautoplot(df)
You can also run the time series generation procedure in a shiny app
app_gratis()
Or visit ouronline ShinyAPP
- R package
tsfeaturesfromGitHubRepository.
- Kang, Y., Hyndman, R., and Li, F. (2020).GRATIS:GeneRAtingTImeSeries with diverse and controllablecharacteristics.Statistical Analysis and DataMining.
This package is free and open source software, licensed under GPL-3.
Feng Li and Yanfei Kang are supported by the National Natural ScienceFoundation of China (No. 11501587 and No. 11701022 respectively). Rob JHyndman is supported by the Australian Centre of Excellence inMathematical and Statistical Frontiers.
About
GRATIS: GeneRAting TIme Series with diverse and controllable characteristics
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors6
Uh oh!
There was an error while loading.Please reload this page.


