autopycoin.data.random_ts#

autopycoin.data.random_ts(n_steps: int = 100, trend_degree: int = 2, periods: List[int] = [10], fourier_orders: List[int] = [10], trend_mean: Optional[int] = 0, trend_std: Optional[int] = 1, seasonality_mean: Optional[int] = 0, seasonality_std: Optional[int] = 1, batch_size: Optional[Union[List[int], int]] = None, n_variables: Optional[int] = 1, noise: Optional[bool] = False, seed: Union[None, int] = None) tensorflow.python.framework.ops.Tensor[source]#

Generate random time series composed by a trend and seasonality components.

Coefficients for the trend and seasonality components are generated by Gaussian distributions.

Parameters
n_stepsint

Number of steps.

trend_degreeint

Number of degree for the trend function. Usually 1 or 2.

periodslist[int]

Computes the seasonality component. A period lower than n_step leads to a pattern which is repeating.

fourier_orderslist[int]

Computes the complexity of the seasonality component. Higher order means higher complexity.

trend_meanint

Mean value associated to the trend component. Default to 0.

trend_stdint

Deviation value associated to the trend component. Default to 1.

seasonality_meanint

Mean value associated to the seasonality component. Default to 0.

seasonality_stdint

Deviation value associated to the seasonality component. Default to 1.

batch_sizeint or list[int] or None

Computes the batch_size of the time series. Default to None.

n_variablesint

Number of variables. Default to 1.

noisebool

Add centered normal distributed noise to the series. Default to False.

seedint or None

Allow reproducible results. Default to None.

Returns
time_seriestensor of shape [D0, …, n_steps, n_variables]

Time series defined by a random process.

Examples

>>> from autopycoin.data import random_ts
>>> data = random_ts(n_steps=10,
...                  trend_degree=2,
...                  periods=[10],
...                  fourier_orders=[10],
...                  trend_mean=0,
...                  trend_std=1,
...                  seasonality_mean=0,
...                  seasonality_std=1,
...                  batch_size=None,
...                  n_variables=1,
...                  noise=True,
...                  seed=42)
>>> data.shape
TensorShape([10, 1])

Examples using autopycoin.data.random_ts#