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_steps
int Number of steps.
- trend_degree
int Number of degree for the trend function. Usually 1 or 2.
- periods
list[int] Computes the seasonality component. A period lower than n_step leads to a pattern which is repeating.
- fourier_orders
list[int] Computes the complexity of the seasonality component. Higher order means higher complexity.
- trend_mean
int Mean value associated to the trend component. Default to 0.
- trend_std
int Deviation value associated to the trend component. Default to 1.
- seasonality_mean
int Mean value associated to the seasonality component. Default to 0.
- seasonality_std
int Deviation value associated to the seasonality component. Default to 1.
- batch_size
intorlist[int]orNone Computes the batch_size of the time series. Default to None.
- n_variables
int Number of variables. Default to 1.
- noisebool
Add centered normal distributed noise to the series. Default to False.
- seed
intorNone Allow reproducible results. Default to None.
- n_steps
- 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])