CyxWiz LogoCyxWiz
DocsTime Series

Time Series Tools

Tools for analyzing, forecasting, and processing temporal data sequences.

Available Tools

Decomposition
Trend, seasonality, residual
Stationarity Tests
ADF, KPSS, PP tests
Autocorrelation
ACF, PACF analysis
Forecasting
ARIMA, Prophet, exponential smoothing
Anomaly Detection
Detect unusual patterns

Time Series Decomposition

Separate time series into trend, seasonal, and residual components.

import cyxwiz.timeseries as ts

# Seasonal decomposition
result = ts.seasonal_decompose(
    data,
    model='additive',  # or 'multiplicative'
    period=12
)

trend = result.trend
seasonal = result.seasonal
residual = result.residual

# STL decomposition (more robust)
stl = ts.STL(data, period=12)
result = stl.fit()

Stationarity Tests

# Augmented Dickey-Fuller test
adf_stat, p_value, lags, nobs, crit_values = ts.adfuller(data)
print(f"ADF Statistic: {adf_stat:.4f}")
print(f"p-value: {p_value:.4f}")

if p_value < 0.05:
    print("Series is stationary")
else:
    print("Series is non-stationary")

# KPSS test
kpss_stat, p_value, lags, crit_values = ts.kpss(data)

# Make series stationary
diff_data = ts.diff(data)  # First difference
diff2_data = ts.diff(data, periods=2)  # Second difference

Autocorrelation Analysis

# Autocorrelation function
acf_values = ts.acf(data, nlags=40)

# Partial autocorrelation function
pacf_values = ts.pacf(data, nlags=40)

# Plot ACF and PACF
ts.plot_acf(data, lags=40)
ts.plot_pacf(data, lags=40)

# Ljung-Box test for autocorrelation
lb_stat, p_value = ts.ljung_box(residuals, lags=20)

Forecasting Models

ARIMA
from cyxwiz.timeseries import ARIMA

model = ARIMA(data, order=(1, 1, 1))
fitted = model.fit()

# Forecast
forecast = fitted.forecast(steps=30)

# With confidence intervals
forecast, conf_int = fitted.forecast(
    steps=30,
    return_conf_int=True
)
Exponential Smoothing
from cyxwiz.timeseries import ExponentialSmoothing

model = ExponentialSmoothing(
    data,
    trend='add',
    seasonal='mul',
    seasonal_periods=12
)
fitted = model.fit()

forecast = fitted.forecast(steps=12)

Window Functions

# Rolling statistics
rolling_mean = ts.rolling_mean(data, window=7)
rolling_std = ts.rolling_std(data, window=7)

# Exponential weighted
ewm_mean = ts.ewm(data, span=7).mean()

# Lag features
lagged = ts.lag(data, periods=1)
lagged_multi = ts.lag(data, periods=[1, 7, 30])

Node Editor Integration

NodeInputsOutputs
DecomposeTime series, periodTrend, seasonal, residual
DiffTime series, periodsDifferenced series
ARIMATime series, orderForecast
RollingTime series, windowRolling statistics