Linear
timecave.data_generation.time_series_functions.linear_ts(number_samples, max_interval_size, slope=1, intercept=0)
Generate a linear time series array.
This function creates a time series array of given length where the values follow a linear pattern determined by the slope and intercept parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
number_samples |
int
|
The total number of samples in the time series array. |
required |
max_interval_size |
float
|
The maximum interval size for generating the time series array. |
required |
slope |
float
|
The slope of the linear pattern. |
1
|
intercept |
float
|
The intercept of the linear pattern. |
0
|
Returns:
| Type | Description |
|---|---|
ndarray
|
A time series array following a linear pattern determined by the slope and intercept parameters. |
Examples:
>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> from timecave.data_generation.time_series_functions import linear_ts
>>> ts = linear_ts(1000, 10);
>>> _ = plt.plot(np.arange(0, ts.shape[0]), ts);
>>> plt.show();
