Welcome to Time Series Oracle’s documentation!¶
Generation¶
-
tsoracle.generate.
arima
(size:int=100, phi:Union[float, numpy.ndarray]=0, theta:Union[float, numpy.ndarray]=0, d:int=0, var:float=0.01) → numpy.ndarray¶ Simulate a realization from an ARIMA characteristic.
- Parameters
- size: scalar int
Number of samples to generate.
- phi: scalar float or list-like
AR process order
- theta: scalar float or list-like
MA process order
- d: scalar int
ARIMA process difference order
- var: scalar float, optional
Nosie variance level.
- Returns
- signal: np.ndarray
Simulated ARIMA.
-
tsoracle.generate.
arima_with_seasonality
(size:int=100, phi:Union[float, numpy.ndarray]=0, theta:Union[float, numpy.ndarray]=0, d:int=0, s:int=0, var:float=0.01) → numpy.ndarray¶ Simulate a realization from an ARIMA with seasonality characteristic.
- Parameters
- size: scalar int
Number of samples to generate.
- phi: scalar float or list-like
AR process order
- theta: scalar float or list-like
MA process order
- d: scalar int
ARIMA process difference order
- s: scalar int
Seasonality process order
- var: scalar float, optional
Nosie variance level.
- Returns
- signal: np.ndarray
Simulated ARIMA with seasonality.
-
tsoracle.generate.
arma
(size:int=100, phi:Union[float, numpy.ndarray]=0, theta:Union[float, numpy.ndarray]=0, var:float=0.01) → numpy.ndarray¶ Simulate a realization from an ARMA characteristic.
- Parameters
- size: scalar int
Number of samples to generate.
- phi: scalar float or list-like
AR process order
- theta: scalar float or list-like
MA process order
- var: scalar float, optional
Nosie variance level.
- Returns
- signal: np.ndarray
Simulated ARMA.
-
tsoracle.generate.
linear
(intercept:float, slope:float, size:int, var:float=0.01)¶ Generate linear signal plus noise.
- Parameters
- intercept: scalar float
Intercept of linear signal.
- slope: scalar float
Slope of linear signal.
- size: scalar int
Number of samples to generate.
- var: scalar float, optional
Nosie variance level.
- Returns
- signal: np.ndarray
Sequential linear signal.
-
tsoracle.generate.
noise
(var:float, size:int) → numpy.ndarray¶ Generate sequential noise from a random normal .
- Parameters
- var: scalar float
Nosie variance level.
- size: scalar int
Number of samples to generate.
- Returns
- noise: np.ndarray
Sequential noise.
-
tsoracle.generate.
sinusoidal
(mag:Union[float, numpy.ndarray, pandas.core.series.Series, List], freq:Union[float, numpy.ndarray, pandas.core.series.Series, List], shift:Union[float, numpy.ndarray, pandas.core.series.Series, List], size:int, var:float=0.01)¶ Generate sinusoidal signal plus noise.
- Parameters
- mag: scalar or list-like
Signal magnitudes(ies).
- freq: scalar or list-like
Signal frequency(ies).
- shift: scalar or list-like
Phase shift(s).
- size: scalar int
Number of samples to generate.
- var: scalar float, optional
Nosie variance level.
- Returns
- signal: np.ndarray
Sequential sinusoidal signal.
Plotting¶
-
tsoracle.plotting.
realization
(x:Union[numpy.ndarray, pandas.core.series.Series, List], figsize:Tuple[float, float]=None) → None¶ Plot a given realization
Acts like tswge::plotts.wge().
- Parameters
- x: list-like
A time series realization.
- figsize: Tuple[float, float], optional
Size of the plotting grid. If None is provided, (10, 10) will be used.
-
tsoracle.plotting.
sample
(x:Union[numpy.ndarray, pandas.core.series.Series, List], figsize:Tuple[float, float]=None, window:Callable=None) → None¶ Show the typical sample plots.
The following plots are generated in a grid
Realization
Sample autocorrelations
Periodogram
Windowed Spectral Density
Acts like tswge::plotts.sample.wge().
- Parameters
- x: list-like
A time series realization.
- figsize: Tuple[float, float], optional
Size of the plotting grid. If None is provided, (10, 10) will be used.
- window: Callable, optional
A callable windowing function. Must work like window functions from scipy.signal. If None is provided, scipy.signal.parzen() will be used.