ts_generate: Generate time series with various length by GRATIS.

Description Usage Arguments Value References Examples

View source: R/ts_generate.R

Description

Generate time series with certain seasonal period and length according to GRATIS proposed by Kang et al. (2019).

Usage

1
2
3
4
5
6
7
8
9
ts_generate(
  n.ts = 1,
  freq = 1,
  nComp = NULL,
  length = NULL,
  h = 1,
  parallel = FALSE,
  num.cores = 2
)

Arguments

n.ts

number of time series to be generated.

freq

seasonal period of time series to be generated. For example, freq of the yearly, quarterly, and monthly series are 1, 4, and 12, respectively.

nComp

number of mixing components when simulating time series using MAR models.

length

length vector of time series to be generated. The length of the generated time series is simply sampled from the length vector.

h

forecasting horizon of the generated time series.

parallel

logical. If TRUE then the generation process is conducted in parallel.

num.cores

the specified amount of parallel processes to be used if parallel = TRUE.

Value

A list of the generated time series.

References

Kang et al. (2019).

Examples

1
2
3
 x_y <- ts_generate(n.ts = 10, freq = 4, nComp = 2, length = c(20,25,30), h = 8)
 x_y$Q1$pars
 forecast::autoplot(x_y$Q1$x)

xqnwang/fuma documentation built on May 29, 2021, 6:38 a.m.