generate_ar_data#

pytorch_forecasting.data.examples.generate_ar_data(n_series: int = 10, timesteps: int = 400, seasonality: float = 3.0, trend: float = 3.0, noise: float = 0.1, level: float = 1.0, exp: bool = False, seed: int = 213) DataFrame[source]#

Generate multivariate data without covariates.

Eeach timeseries is generated from seasonality and trend. Important columns:

  • series: series ID

  • time_idx: time index

  • value: target value

Parameters
  • n_series (int, optional) – Number of series. Defaults to 10.

  • timesteps (int, optional) – Number of timesteps. Defaults to 400.

  • seasonality (float, optional) – Normalized frequency, i.e. frequency is seasonality / timesteps. Defaults to 3.0.

  • trend (float, optional) – Trend multiplier (seasonality is multiplied with 1.0). Defaults to 3.0.

  • noise (float, optional) – Level of gaussian noise. Defaults to 0.1.

  • level (float, optional) – Level multiplier (level is a constant to be aded to timeseries). Defaults to 1.0.

  • exp (bool, optional) – If to return exponential of timeseries values. Defaults to False.

  • seed (int, optional) – Random seed. Defaults to 213.

Returns

data

Return type

pd.DataFrame