Scaled Right Indicator
timecave.data_generation.time_series_functions.scaled_right_indicator_ts(number_samples, idx, constant=1)
Generate a time series array based on a indicator function that is 1 in the interval [idx, + inf[ and 0 otherwise.
This function creates a time series array of given length where the segment starting from the specified index to the end is marked as 1 and the rest as 0. The binary array is then scaled by a constant factor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
number_samples |
int
|
The total number of samples in the time series array. |
required |
idx |
int
|
The index from which the segment starts to be marked as 1. |
required |
constant |
float
|
A scaling constant to multiply the array by, by default 1. |
1
|
Returns:
| Type | Description |
|---|---|
ndarray
|
A scaled time series array where the segment starting from the specified index to the end is marked as 1 and the rest as 0. |
See also
indicator_ts: Indicator time series.
Examples:
>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> from timecave.data_generation.time_series_functions import scaled_right_indicator_ts
>>> ts = scaled_right_indicator_ts(100, 30, 5);
>>> _ = plt.plot(np.arange(0, ts.shape[0]), ts);
>>> plt.show();
