Search Shortcut cmd + k | ctrl + k
anofox_forecast

Statistical timeseries forecasting in DuckDB. Support ARIMA, SARIMA, ETS, TBATS, MFLES, MSTL, and other models.

Maintainer(s): sipemu

Installing and Loading

INSTALL anofox_forecast FROM community;
LOAD anofox_forecast;

Added Functions

function_name function_type description comment examples
_anofox_fcst_ts_backtest_native table NULL NULL  
_ts_backtest_native table NULL NULL  
_ts_coverage_native table NULL NULL  
_ts_cv_folds_native table NULL NULL  
_ts_cv_forecast_native table NULL NULL  
_ts_cv_hydrate_native table NULL NULL  
_ts_cv_split_native table NULL NULL  
_ts_data_quality scalar NULL NULL  
_ts_detect_changepoints_bocpd scalar NULL NULL  
_ts_detect_changepoints_by_native table NULL NULL  
_ts_detect_periods scalar NULL NULL  
_ts_features_native table NULL NULL  
_ts_fill_forward_native table NULL NULL  
_ts_fill_gaps_native table NULL NULL  
_ts_forecast scalar NULL NULL  
_ts_forecast_exog scalar NULL NULL  
_ts_forecast_native table NULL NULL  
_ts_forecast_scalar scalar NULL NULL  
_ts_mase_native table NULL NULL  
_ts_metrics_native table NULL NULL  
_ts_mstl_decomposition scalar NULL NULL  
_ts_mstl_decomposition_native table NULL NULL  
_ts_quantile_loss_native table NULL NULL  
_ts_rmae_native table NULL NULL  
_ts_stats scalar NULL NULL  
_ts_stats_by_native table NULL NULL  
_ts_stats_with_dates scalar NULL NULL  
anofox_fcst_ts_analyze_peak_timing table_macro Analyzes peak timing variability for a single time series. NULL [SELECT * FROM ts_analyze_peak_timing('sales', product_id, date, qty, 7)]
anofox_fcst_ts_analyze_peak_timing_by table_macro Analyzes peak timing variability for each group, returning timing statistics and stability score. NULL [SELECT * FROM ts_analyze_peak_timing_by('sales', product_id, date, qty, 7)]
anofox_fcst_ts_analyze_seasonality scalar Analyzes seasonal patterns in detail, returning amplitude, phase, strength, and period information. NULL [ts_analyze_seasonality(LIST(ts ORDER BY ts), LIST(value ORDER BY ts))]
anofox_fcst_ts_analyze_seasonality scalar Analyzes seasonal patterns in detail, returning amplitude, phase, strength, and period information. NULL [ts_analyze_seasonality(LIST(value ORDER BY date), 7)]
anofox_fcst_ts_bias scalar Computes mean forecast bias (mean error) between actual and predicted value arrays. NULL [ts_bias(LIST(actual ORDER BY date), LIST(forecast ORDER BY date))]
anofox_fcst_ts_bias_by table_macro Computes mean forecast bias between actual and forecast columns per group. NULL [SELECT * FROM ts_bias_by('results', product_id, date, actual, forecast)]
anofox_fcst_ts_bootstrap_intervals scalar Generates bootstrap prediction intervals by resampling historical residuals. Returns STRUCT(point[], lower[], upper[], coverage). NULL [ts_bootstrap_intervals(residuals, point_forecast, 1000, 0.90, 42)]
anofox_fcst_ts_bootstrap_quantiles scalar Generates bootstrap quantile intervals by resampling historical residuals. Returns STRUCT(point[], quantiles[], values[][]). NULL [ts_bootstrap_quantiles(residuals, point_forecast, 1000, [0.1, 0.5, 0.9], 42)]
anofox_fcst_ts_check_leakage table_macro Audits a cross-validation dataset for data leakage by checking that test features are not visible during training. NULL [SELECT * FROM ts_check_leakage('cv_splits', product_id, date, fold_id, split)]
anofox_fcst_ts_classify_seasonality scalar Classifies the seasonality type (timing and modulation) of a time series, returning timing_classification, modulation_type, and seasonal strength. NULL [ts_classify_seasonality(LIST(value ORDER BY date), 7)]
anofox_fcst_ts_classify_seasonality table_macro Single-series seasonality classification. Classifies seasonality type and returns timing metadata. NULL [SELECT * FROM ts_classify_seasonality('sales', product_id, date, qty)]
anofox_fcst_ts_classify_seasonality_agg aggregate Aggregate function: classifies the seasonality type (none, additive, multiplicative) for each group. NULL [SELECT product_id, anofox_fcst_ts_classify_seasonality_agg(date, value, MAP{}) FROM sales GROUP BY product_id]
anofox_fcst_ts_classify_seasonality_by table_macro Classifies seasonality type (additive/multiplicative/none) for each group. NULL [SELECT * FROM ts_classify_seasonality_by('sales', product_id, date, qty)]
anofox_fcst_ts_conformal_apply scalar Applies a pre-calibrated conformal quantile to new point forecasts to produce prediction intervals. NULL [ts_conformal_apply(point_forecast, conformal_q)]
anofox_fcst_ts_conformal_apply_by table_macro Applies a pre-calibrated conformal profile to new point forecasts to generate prediction intervals. NULL [SELECT * FROM ts_conformal_apply_by('forecasts', product_id, date, point_forecast, calibration_profile)]
anofox_fcst_ts_conformal_by table_macro One-step conformal prediction: calibrates on backtest residuals and applies to new forecasts. NULL [SELECT * FROM ts_conformal_by('backtest', product_id, actual, forecast, point_forecast)]
anofox_fcst_ts_conformal_calibrate table_macro Calibrates a conformal predictor from backtest residuals and returns the calibration profile for reuse. NULL [SELECT * FROM ts_conformal_calibrate('backtest', product_id, actual, forecast)]
anofox_fcst_ts_conformal_coverage scalar Computes empirical coverage rate of conformal prediction intervals on a test set. NULL [ts_conformal_coverage(actual, lower, upper)]
anofox_fcst_ts_conformal_evaluate scalar Evaluates conformal interval quality returning coverage, mean width, and efficiency metrics. NULL [ts_conformal_evaluate(actual, lower, upper, 0.1)]
anofox_fcst_ts_conformal_intervals scalar Computes symmetric conformal prediction intervals by applying a conformal quantile to point forecasts. NULL [ts_conformal_intervals(point_forecast, conformal_q)]
anofox_fcst_ts_conformal_learn scalar Calibrates a conformal predictor from calibration set actuals and forecasts. Returns conformal quantile for reuse. NULL [ts_conformal_learn(LIST(actual ORDER BY date), LIST(forecast ORDER BY date), 0.1)]
anofox_fcst_ts_conformal_predict scalar End-to-end symmetric conformal prediction: calibrates on residuals and applies to forecasts in one step. NULL [ts_conformal_predict(calibration_actuals, calibration_forecasts, point_forecast, 0.1)]
anofox_fcst_ts_conformal_predict_asymmetric scalar End-to-end asymmetric conformal prediction using separate upper and lower quantiles for skewed errors. NULL [ts_conformal_predict_asymmetric(calibration_actuals, calibration_forecasts, point_forecast, 0.1)]
anofox_fcst_ts_conformal_predict_per_step scalar Per-step conformal prediction that calibrates separate intervals for each forecast horizon step. NULL [ts_conformal_predict_per_step(calibration_actuals, calibration_forecasts, point_forecast, 0.1)]
anofox_fcst_ts_conformal_quantile scalar Computes the conformal quantile from calibration nonconformity scores at a given miscoverage rate alpha. NULL [ts_conformal_quantile(calibration_scores, 0.1)]
anofox_fcst_ts_coverage scalar Computes the empirical coverage rate of prediction intervals: fraction of actuals within [lower, upper]. NULL [ts_coverage(LIST(actual ORDER BY date), LIST(lower ORDER BY date), LIST(upper ORDER BY date))]
anofox_fcst_ts_coverage_by table_macro Computes prediction interval coverage rate per group. NULL [SELECT * FROM ts_coverage_by('results', product_id, date, actual, lower, upper)]
anofox_fcst_ts_cv_folds_by table_macro Generates cross-validation fold definitions (cutoff dates) without splitting the data. NULL [SELECT * FROM ts_cv_folds_by('sales', product_id, date, qty, 3, 12, '1d')]
anofox_fcst_ts_cv_forecast_by table_macro Runs forecasts on all cross-validation folds and returns predictions with fold metadata. NULL [SELECT * FROM ts_cv_forecast_by('cv_splits', product_id, date, qty, 'AutoETS')]
anofox_fcst_ts_cv_hydrate_by table_macro Joins external features to CV splits with proper masking to prevent data leakage. NULL [SELECT * FROM ts_cv_hydrate_by('cv_splits', product_id, date, qty, 'features', unknown_cols)]
anofox_fcst_ts_cv_split_by table_macro Creates cross-validation train/test splits from explicit fold boundary dates. NULL [SELECT * FROM ts_cv_split_by('sales', product_id, date, qty, 'folds', fold_id, cutoff)]
anofox_fcst_ts_cv_split_folds_by table_macro Splits time series into cross-validation folds with configurable gap, embargo, and window parameters. NULL [SELECT * FROM ts_cv_split_folds_by('sales', product_id, date, qty, 3, 12, '1d')]
anofox_fcst_ts_cv_split_index_by table_macro Memory-efficient cross-validation split using row indices instead of full data copies. NULL [SELECT * FROM ts_cv_split_index_by('sales', product_id, date, qty, 3, 12, '1d')]
anofox_fcst_ts_data_quality table_macro Assesses time series data quality per group, returning null rate, gap rate, duplicate count, and quality score. NULL [SELECT * FROM ts_data_quality('sales', product_id, date, qty)]
anofox_fcst_ts_data_quality_agg aggregate Aggregate function: assesses time series data quality for each group, reporting null counts, gap counts, duplicates, and quality score. NULL [SELECT product_id, anofox_fcst_ts_data_quality_agg(date, value) FROM sales GROUP BY product_id]
anofox_fcst_ts_data_quality_by table_macro Alias for ts_data_quality. Assesses time series data quality per group. NULL [SELECT * FROM ts_data_quality_by('sales', product_id, date, qty)]
anofox_fcst_ts_data_quality_summary table_macro Summarizes ts_data_quality output across all groups into aggregate quality metrics. NULL [SELECT * FROM ts_data_quality_summary('sales', product_id, date, qty)]
anofox_fcst_ts_detect_changepoints table_macro Detects structural changepoints in a single time series using Bayesian Online Changepoint Detection. NULL [SELECT * FROM ts_detect_changepoints('sales', product_id, date, qty)]
anofox_fcst_ts_detect_changepoints_agg aggregate Aggregate function: detects structural changepoints in time series for each group using Bayesian Online Changepoint Detection (BOCPD). NULL [SELECT product_id, anofox_fcst_ts_detect_changepoints_agg(date, value, MAP{}) FROM sales GROUP BY product_id]
anofox_fcst_ts_detect_changepoints_by table_macro Detects structural changepoints for each group using Bayesian Online Changepoint Detection. NULL [SELECT * FROM ts_detect_changepoints_by('sales', product_id, date, qty)]
anofox_fcst_ts_detect_peaks table_macro Detects peaks in a single time series, returning peak indices, values, and prominence scores. NULL [SELECT * FROM ts_detect_peaks('sales', product_id, date, qty)]
anofox_fcst_ts_detect_peaks_by table_macro Detects peaks in each group's time series, returning peak indices, values, and prominence scores. NULL [SELECT * FROM ts_detect_peaks_by('sales', product_id, date, qty)]
anofox_fcst_ts_detect_periods table_macro Detects seasonal periods for a single time series, returning ranked period candidates with confidence scores. NULL [SELECT * FROM ts_detect_periods('sales', product_id, date, qty)]
anofox_fcst_ts_detect_periods_agg aggregate Aggregate function: detects seasonal periods for each group, returning the primary period, confidence, and a ranked list of candidates. NULL [SELECT product_id, anofox_fcst_ts_detect_periods_agg(date, value) FROM sales GROUP BY product_id]
anofox_fcst_ts_detect_periods_agg aggregate Aggregate function: detects seasonal periods for each group, returning the primary period, confidence, and a ranked list of candidates. NULL [SELECT product_id, anofox_fcst_ts_detect_periods_agg(date, value, MAP{'method': 'auto'}) FROM sales GROUP BY product_id]
anofox_fcst_ts_detect_periods_by table_macro Detects seasonal periods for each group, returning ranked period candidates with confidence scores. NULL [SELECT * FROM ts_detect_periods_by('sales', product_id, date, qty)]
anofox_fcst_ts_detect_seasonality scalar Tests whether a time series exhibits statistically significant seasonality. Returns TRUE/FALSE or a confidence score. NULL [ts_detect_seasonality(LIST(value ORDER BY date))]
anofox_fcst_ts_detrend_by table_macro Removes the trend component from each group's time series. NULL [SELECT * FROM ts_detrend_by('sales', product_id, date, qty, 7)]
anofox_fcst_ts_diff_by table_macro Computes first-order differences for each group's time series (value[t] - value[t-1]). NULL [SELECT * FROM ts_diff_by('sales', product_id, date, qty)]
anofox_fcst_ts_drop_constant_by table_macro Removes groups whose time series values are all constant (zero variance). NULL [SELECT * FROM ts_drop_constant_by('sales', product_id, date, qty)]
anofox_fcst_ts_drop_edge_zeros_by table_macro Removes both leading and trailing zeros from each group's time series. NULL [SELECT * FROM ts_drop_edge_zeros_by('sales', product_id, date, qty)]
anofox_fcst_ts_drop_gappy_by table_macro Removes groups whose time series have a gap rate exceeding a threshold. NULL [SELECT * FROM ts_drop_gappy_by('sales', product_id, date, qty, '1d', 0.1)]
anofox_fcst_ts_drop_leading_zeros_by table_macro Removes leading zeros from each group's time series, trimming the start of the series. NULL [SELECT * FROM ts_drop_leading_zeros_by('sales', product_id, date, qty)]
anofox_fcst_ts_drop_short_by table_macro Removes groups with fewer observations than the specified minimum length. NULL [SELECT * FROM ts_drop_short_by('sales', product_id, date, qty, 20)]
anofox_fcst_ts_drop_trailing_zeros_by table_macro Removes trailing zeros from each group's time series, trimming the end of the series. NULL [SELECT * FROM ts_drop_trailing_zeros_by('sales', product_id, date, qty)]
anofox_fcst_ts_drop_zeros_by table_macro Removes groups whose time series are predominantly zero values. NULL [SELECT * FROM ts_drop_zeros_by('sales', product_id, date, qty, 0.8)]
anofox_fcst_ts_features_agg aggregate Aggregate function: extracts 117 tsfresh-compatible time series features for each group. Returns a STRUCT with all computed features. NULL [SELECT product_id, anofox_fcst_ts_features_agg(date, value) FROM sales GROUP BY product_id]
anofox_fcst_ts_features_agg aggregate Aggregate function: extracts 117 tsfresh-compatible time series features for each group. Returns a STRUCT with all computed features. NULL [SELECT product_id, anofox_fcst_ts_features_agg(date, value, ['mean'], NULL) FROM sales GROUP BY product_id]
anofox_fcst_ts_features_agg aggregate Aggregate function: extracts 117 tsfresh-compatible time series features for each group. Returns a STRUCT with all computed features. NULL [SELECT product_id, anofox_fcst_ts_features_agg(date, value, config) FROM sales GROUP BY product_id]
anofox_fcst_ts_features_by table_macro Extracts time series features for each group and returns results as a structured table. NULL [SELECT * FROM ts_features_by('sales', product_id, date, qty)]
anofox_fcst_ts_features_config_from_csv scalar Parses a CSV string of feature names into a feature configuration for use with ts_features_by(). NULL [ts_features_config_from_csv('mean,std,skewness')]
anofox_fcst_ts_features_config_from_json scalar Parses a feature configuration JSON string for use with ts_features_by() to select specific features. NULL [ts_features_config_from_json('{"features": ["mean", "std"]}')]
anofox_fcst_ts_features_table table_macro Extracts 117 tsfresh-compatible features and returns them as a wide table (one column per feature). NULL [SELECT * FROM ts_features_table('sales', product_id, date, qty)]
anofox_fcst_ts_fill_forward_by table_macro Forward-fills missing timestamps in each group's time series using the last known value. NULL [SELECT * FROM ts_fill_forward_by('sales', product_id, date, qty, '1d')]
anofox_fcst_ts_fill_forward_operator table Native table function: forward-fills NULL values in time series within groups. Used internally by ts_fill_forward_by(). NULL [SELECT * FROM anofox_fcst_ts_fill_forward_operator(source_table, group_col, date_col, value_col, target_date, frequency)]
anofox_fcst_ts_fill_gaps_by table_macro Fills missing timestamps in each group's time series to create a regular frequency grid. NULL [SELECT * FROM ts_fill_gaps_by('sales', product_id, date, qty, '1d')]
anofox_fcst_ts_fill_nulls_backward_by table_macro Backward-fills NULL values in each group's time series using the next known value. NULL [SELECT * FROM ts_fill_nulls_backward_by('sales', product_id, date, qty)]
anofox_fcst_ts_fill_nulls_const_by table_macro Fills NULL values in each group's time series with a constant value. NULL [SELECT * FROM ts_fill_nulls_const_by('sales', product_id, date, qty, 0.0)]
anofox_fcst_ts_fill_nulls_forward_by table_macro Forward-fills NULL values in each group's time series using the last known value. NULL [SELECT * FROM ts_fill_nulls_forward_by('sales', product_id, date, qty)]
anofox_fcst_ts_fill_nulls_mean_by table_macro Fills NULL values in each group's time series with the group mean. NULL [SELECT * FROM ts_fill_nulls_mean_by('sales', product_id, date, qty)]
anofox_fcst_ts_fill_unknown_by table_macro Fills unknown (NULL) feature values using a specified strategy for cross-validation. NULL [SELECT * FROM ts_fill_unknown_by('cv_data', product_id, date, feature_col, 'last_value')]
anofox_fcst_ts_forecast table_macro Generates a forecast for a single time series. Returns point forecasts with prediction intervals. NULL [SELECT * FROM ts_forecast('sales', product_id, date, qty, 'AutoETS', 12, '1d')]
anofox_fcst_ts_forecast_agg aggregate Aggregate function: produces a time series forecast for each group. Supports 32 forecasting models. Returns STRUCT(point[], lower[], upper[], fitted[], residuals[], model, aic, bic, mse). NULL [SELECT product_id, anofox_fcst_ts_forecast_agg(date, value, 'AutoETS', 12, MAP{}) FROM sales GROUP BY product_id]
anofox_fcst_ts_forecast_by table_macro Generates forecasts for multiple time series grouped by one or more keys. Returns point forecasts with prediction intervals. NULL [SELECT * FROM ts_forecast_by('sales', product_id, date, qty, 'AutoETS', 12, '1d')]
anofox_fcst_ts_forecast_exog table_macro Generates a forecast for a single time series using exogenous regressors. NULL [SELECT * FROM ts_forecast_exog('sales', product_id, date, qty, 'future_features', 'AutoARIMA', 12, '1d')]
anofox_fcst_ts_forecast_exog_by table_macro Generates forecasts for multiple time series using exogenous regressors. NULL [SELECT * FROM ts_forecast_exog_by('sales', product_id, date, qty, 'future_features', 'AutoARIMA', 12, '1d')]
anofox_fcst_ts_interval_width_by table_macro Computes the mean width of prediction intervals for each group. NULL [SELECT * FROM ts_interval_width_by('forecasts', product_id, lower, upper)]
anofox_fcst_ts_mae scalar Computes Mean Absolute Error (MAE) between actual and predicted value arrays. NULL [ts_mae(LIST(actual ORDER BY date), LIST(forecast ORDER BY date))]
anofox_fcst_ts_mae_by table_macro Computes Mean Absolute Error between actual and forecast columns per group. NULL [SELECT * FROM ts_mae_by('results', product_id, date, actual, forecast)]
anofox_fcst_ts_mape scalar Computes Mean Absolute Percentage Error (MAPE) between actual and predicted value arrays. NULL [ts_mape(LIST(actual ORDER BY date), LIST(forecast ORDER BY date))]
anofox_fcst_ts_mape_by table_macro Computes Mean Absolute Percentage Error between actual and forecast columns per group. NULL [SELECT * FROM ts_mape_by('results', product_id, date, actual, forecast)]
anofox_fcst_ts_mark_unknown_by table_macro Marks future values as unknown (NULL) for cross-validation leakage prevention. NULL [SELECT * FROM ts_mark_unknown_by('features', product_id, date, feature_col, cutoff_date)]
anofox_fcst_ts_mase scalar Computes Mean Absolute Scaled Error (MASE) comparing forecast error to a baseline model. NULL [ts_mase(LIST(actual ORDER BY date), LIST(forecast ORDER BY date), LIST(naive ORDER BY date))]
anofox_fcst_ts_mase_by table_macro Computes Mean Absolute Scaled Error comparing forecast to a baseline model per group. NULL [SELECT * FROM ts_mase_by('results', product_id, date, actual, forecast, baseline)]
anofox_fcst_ts_mean_interval_width scalar Computes the mean width of prediction intervals: average of (upper - lower) across all steps. NULL [ts_mean_interval_width(lower, upper)]
anofox_fcst_ts_mqloss scalar Computes Mean Quantile Loss (MQLoss) across multiple quantile levels. NULL [ts_mqloss(LIST(actual ORDER BY date), LIST([lower, upper] ORDER BY date), [0.1, 0.9])]
anofox_fcst_ts_mse scalar Computes Mean Squared Error (MSE) between actual and predicted value arrays. NULL [ts_mse(LIST(actual ORDER BY date), LIST(forecast ORDER BY date))]
anofox_fcst_ts_mse_by table_macro Computes Mean Squared Error between actual and forecast columns per group. NULL [SELECT * FROM ts_mse_by('results', product_id, date, actual, forecast)]
anofox_fcst_ts_mstl_decomposition_by table_macro Decomposes each group's time series into trend, seasonal, and remainder components using MSTL. NULL [SELECT * FROM ts_mstl_decomposition_by('sales', product_id, date, qty, '[7,365]')]
anofox_fcst_ts_quality_report table_macro Generates a data quality report with null counts, gap counts, duplicate timestamps, and quality score per group. NULL [SELECT * FROM ts_quality_report('sales', product_id, date, qty)]
anofox_fcst_ts_quantile_loss scalar Computes the quantile (pinball) loss for a single quantile level. NULL [ts_quantile_loss(LIST(actual ORDER BY date), LIST(forecast ORDER BY date), 0.9)]
anofox_fcst_ts_quantile_loss_by table_macro Computes quantile (pinball) loss at a specified quantile level per group. NULL [SELECT * FROM ts_quantile_loss_by('results', product_id, date, actual, forecast, 0.9)]
anofox_fcst_ts_r2 scalar Computes the R-squared (coefficient of determination) between actual and predicted value arrays. NULL [ts_r2(LIST(actual ORDER BY date), LIST(forecast ORDER BY date))]
anofox_fcst_ts_r2_by table_macro Computes R-squared (coefficient of determination) between actual and forecast columns per group. NULL [SELECT * FROM ts_r2_by('results', product_id, date, actual, forecast)]
anofox_fcst_ts_rmae scalar Computes Relative MAE: ratio of MAE(actual, pred1) to MAE(actual, pred2). Values < 1 mean pred1 is better. NULL [ts_rmae(LIST(actual ORDER BY date), LIST(model_a ORDER BY date), LIST(model_b ORDER BY date))]
anofox_fcst_ts_rmae_by table_macro Computes Relative MAE (MAE ratio between two models) per group. NULL [SELECT * FROM ts_rmae_by('results', product_id, date, actual, pred1, pred2)]
anofox_fcst_ts_rmse scalar Computes Root Mean Squared Error (RMSE) between actual and predicted value arrays. NULL [ts_rmse(LIST(actual ORDER BY date), LIST(forecast ORDER BY date))]
anofox_fcst_ts_rmse_by table_macro Computes Root Mean Squared Error between actual and forecast columns per group. NULL [SELECT * FROM ts_rmse_by('results', product_id, date, actual, forecast)]
anofox_fcst_ts_smape scalar Computes Symmetric Mean Absolute Percentage Error (sMAPE) between actual and predicted value arrays. NULL [ts_smape(LIST(actual ORDER BY date), LIST(forecast ORDER BY date))]
anofox_fcst_ts_smape_by table_macro Computes Symmetric Mean Absolute Percentage Error between actual and forecast columns per group. NULL [SELECT * FROM ts_smape_by('results', product_id, date, actual, forecast)]
anofox_fcst_ts_stats table_macro Computes 34 time series statistics per group. Returns a wide table with one column per statistic. NULL [SELECT * FROM ts_stats('sales', product_id, date, qty, '1d')]
anofox_fcst_ts_stats_agg aggregate Aggregate function: computes 34 time series statistics for each group. Returns a STRUCT with mean, std, min, max, trend, seasonality, and many more. NULL [SELECT product_id, anofox_fcst_ts_stats_agg(date, value) FROM sales GROUP BY product_id]
anofox_fcst_ts_stats_by table_macro Alias for ts_stats. Computes 34 time series statistics per group. NULL [SELECT * FROM ts_stats_by('sales', product_id, date, qty, '1d')]
anofox_fcst_ts_stats_summary table_macro Aggregates ts_stats output across all groups into summary statistics (mean, std, min, max per metric). NULL [SELECT * FROM ts_stats_summary('sales', product_id, date, qty, '1d')]
anofox_fcst_ts_validate_timestamps_by table_macro Validates that timestamps are unique, monotonically increasing, and match the expected frequency per group. NULL [SELECT * FROM ts_validate_timestamps_by('sales', product_id, date, qty, '1d')]
anofox_fcst_ts_validate_timestamps_summary_by table_macro Summarizes ts_validate_timestamps_by results across all groups. NULL [SELECT * FROM ts_validate_timestamps_summary_by('sales', product_id, date, qty, '1d')]
ts_aggregate_hierarchy table Aggregates time series data up through a hierarchy of group keys, rolling up lower-level series to higher levels. NULL [SELECT * FROM ts_aggregate_hierarchy(TABLE(SELECT date, value, region, store, item FROM t), MAP {'separator': '|'})]
ts_aic_period scalar Estimates the seasonal period by minimizing the Akaike Information Criterion (AIC) over candidate periods. NULL [ts_aic_period(LIST(value ORDER BY date))]
ts_analyze_peak_timing scalar Analyzes timing patterns of peaks detected by ts_detect_peaks, returning periodicity and phase statistics. NULL [ts_analyze_peak_timing(LIST(value ORDER BY date), LIST(date ORDER BY date))]
ts_analyze_peak_timing table_macro Analyzes peak timing variability for a single time series. NULL [SELECT * FROM ts_analyze_peak_timing('sales', product_id, date, qty, 7)]
ts_analyze_peak_timing_by table_macro Analyzes peak timing variability for each group, returning timing statistics and stability score. NULL [SELECT * FROM ts_analyze_peak_timing_by('sales', product_id, date, qty, 7)]
ts_analyze_seasonality scalar Analyzes seasonal patterns in detail, returning amplitude, phase, strength, and period information. NULL [ts_analyze_seasonality(LIST(ts ORDER BY ts), LIST(value ORDER BY ts))]
ts_analyze_seasonality scalar Analyzes seasonal patterns in detail, returning amplitude, phase, strength, and period information. NULL [ts_analyze_seasonality(LIST(value ORDER BY date), 7)]
ts_autoperiod scalar Estimates the seasonal period using the Autoperiod algorithm combining FFT and autocorrelation. NULL [ts_autoperiod(LIST(value ORDER BY date))]
ts_bias scalar Computes mean forecast bias (mean error) between actual and predicted value arrays. NULL [ts_bias(LIST(actual ORDER BY date), LIST(forecast ORDER BY date))]
ts_bias_by table_macro Computes mean forecast bias between actual and forecast columns per group. NULL [SELECT * FROM ts_bias_by('results', product_id, date, actual, forecast)]
ts_bootstrap_intervals scalar Generates bootstrap prediction intervals by resampling historical residuals. Returns STRUCT(point[], lower[], upper[], coverage). NULL [ts_bootstrap_intervals(residuals, point_forecast, 1000, 0.90, 42)]
ts_bootstrap_quantiles scalar Generates bootstrap quantile intervals by resampling historical residuals. Returns STRUCT(point[], quantiles[], values[][]). NULL [ts_bootstrap_quantiles(residuals, point_forecast, 1000, [0.1, 0.5, 0.9], 42)]
ts_cfd_autoperiod scalar Estimates the seasonal period using Conditional Frequency Distribution (CFD) autoperiod method. NULL [ts_cfd_autoperiod(LIST(value ORDER BY date))]
ts_check_leakage table_macro Audits a cross-validation dataset for data leakage by checking that test features are not visible during training. NULL [SELECT * FROM ts_check_leakage('cv_splits', product_id, date, fold_id, split)]
ts_classify_seasonality scalar Classifies the seasonality type (timing and modulation) of a time series, returning timing_classification, modulation_type, and seasonal strength. NULL [ts_classify_seasonality(LIST(value ORDER BY date), 7)]
ts_classify_seasonality table_macro Single-series seasonality classification. Classifies seasonality type and returns timing metadata. NULL [SELECT * FROM ts_classify_seasonality('sales', product_id, date, qty)]
ts_classify_seasonality_agg aggregate Aggregate function: classifies the seasonality type (none, additive, multiplicative) for each group. NULL [SELECT product_id, ts_classify_seasonality_agg(date, value, MAP{}) FROM sales GROUP BY product_id]
ts_classify_seasonality_by table_macro Classifies seasonality type (additive/multiplicative/none) for each group. NULL [SELECT * FROM ts_classify_seasonality_by('sales', product_id, date, qty)]
ts_combine_keys table Combines multiple group key columns into a single composite key column for multi-key time series operations. NULL [SELECT * FROM ts_combine_keys(TABLE(SELECT date, value, region, store FROM t), MAP {'separator': '|'})]
ts_conformal_apply scalar Applies a pre-calibrated conformal quantile to new point forecasts to produce prediction intervals. NULL [ts_conformal_apply(point_forecast, conformal_q)]
ts_conformal_apply_by table_macro Applies a pre-calibrated conformal profile to new point forecasts to generate prediction intervals. NULL [SELECT * FROM ts_conformal_apply_by('forecasts', product_id, date, point_forecast, calibration_profile)]
ts_conformal_by table_macro One-step conformal prediction: calibrates on backtest residuals and applies to new forecasts. NULL [SELECT * FROM ts_conformal_by('backtest', product_id, actual, forecast, point_forecast)]
ts_conformal_calibrate table_macro Calibrates a conformal predictor from backtest residuals and returns the calibration profile for reuse. NULL [SELECT * FROM ts_conformal_calibrate('backtest', product_id, actual, forecast)]
ts_conformal_coverage scalar Computes empirical coverage rate of conformal prediction intervals on a test set. NULL [ts_conformal_coverage(actual, lower, upper)]
ts_conformal_evaluate scalar Evaluates conformal interval quality returning coverage, mean width, and efficiency metrics. NULL [ts_conformal_evaluate(actual, lower, upper, 0.1)]
ts_conformal_intervals scalar Computes symmetric conformal prediction intervals by applying a conformal quantile to point forecasts. NULL [ts_conformal_intervals(point_forecast, conformal_q)]
ts_conformal_learn scalar Calibrates a conformal predictor from calibration set actuals and forecasts. Returns conformal quantile for reuse. NULL [ts_conformal_learn(LIST(actual ORDER BY date), LIST(forecast ORDER BY date), 0.1)]
ts_conformal_predict scalar End-to-end symmetric conformal prediction: calibrates on residuals and applies to forecasts in one step. NULL [ts_conformal_predict(calibration_actuals, calibration_forecasts, point_forecast, 0.1)]
ts_conformal_predict_asymmetric scalar End-to-end asymmetric conformal prediction using separate upper and lower quantiles for skewed errors. NULL [ts_conformal_predict_asymmetric(calibration_actuals, calibration_forecasts, point_forecast, 0.1)]
ts_conformal_predict_per_step scalar Per-step conformal prediction that calibrates separate intervals for each forecast horizon step. NULL [ts_conformal_predict_per_step(calibration_actuals, calibration_forecasts, point_forecast, 0.1)]
ts_conformal_quantile scalar Computes the conformal quantile from calibration nonconformity scores at a given miscoverage rate alpha. NULL [ts_conformal_quantile(calibration_scores, 0.1)]
ts_coverage scalar Computes the empirical coverage rate of prediction intervals: fraction of actuals within [lower, upper]. NULL [ts_coverage(LIST(actual ORDER BY date), LIST(lower ORDER BY date), LIST(upper ORDER BY date))]
ts_coverage_by table_macro Computes prediction interval coverage rate per group. NULL [SELECT * FROM ts_coverage_by('results', product_id, date, actual, lower, upper)]
ts_cv_folds_by table_macro Generates cross-validation fold definitions (cutoff dates) without splitting the data. NULL [SELECT * FROM ts_cv_folds_by('sales', product_id, date, qty, 3, 12, '1d')]
ts_cv_forecast_by table_macro Runs forecasts on all cross-validation folds and returns predictions with fold metadata. NULL [SELECT * FROM ts_cv_forecast_by('cv_splits', product_id, date, qty, 'AutoETS')]
ts_cv_hydrate_by table_macro Joins external features to CV splits with proper masking to prevent data leakage. NULL [SELECT * FROM ts_cv_hydrate_by('cv_splits', product_id, date, qty, 'features', unknown_cols)]
ts_cv_split_by table_macro Creates cross-validation train/test splits from explicit fold boundary dates. NULL [SELECT * FROM ts_cv_split_by('sales', product_id, date, qty, 'folds', fold_id, cutoff)]
ts_cv_split_folds_by table_macro Splits time series into cross-validation folds with configurable gap, embargo, and window parameters. NULL [SELECT * FROM ts_cv_split_folds_by('sales', product_id, date, qty, 3, 12, '1d')]
ts_cv_split_index_by table_macro Memory-efficient cross-validation split using row indices instead of full data copies. NULL [SELECT * FROM ts_cv_split_index_by('sales', product_id, date, qty, 3, 12, '1d')]
ts_data_quality table_macro Assesses time series data quality per group, returning null rate, gap rate, duplicate count, and quality score. NULL [SELECT * FROM ts_data_quality('sales', product_id, date, qty)]
ts_data_quality_agg aggregate Aggregate function: assesses time series data quality for each group, reporting null counts, gap counts, duplicates, and quality score. NULL [SELECT product_id, ts_data_quality_agg(date, value) FROM sales GROUP BY product_id]
ts_data_quality_by table_macro Alias for ts_data_quality. Assesses time series data quality per group. NULL [SELECT * FROM ts_data_quality_by('sales', product_id, date, qty)]
ts_data_quality_summary table_macro Summarizes ts_data_quality output across all groups into aggregate quality metrics. NULL [SELECT * FROM ts_data_quality_summary('sales', product_id, date, qty)]
ts_decompose_seasonal scalar Extracts the seasonal component from a time series, returning seasonal indices or adjusted values. NULL [ts_decompose_seasonal(LIST(value ORDER BY date), 7)]
ts_detect_amplitude_modulation scalar Detects amplitude modulation in a seasonal time series, identifying whether peak amplitudes vary significantly over time. Returns STRUCT with modulation type, score, and amplitude trend. NULL [ts_detect_amplitude_modulation(LIST(value ORDER BY date), 7)]
ts_detect_changepoints table_macro Detects structural changepoints in a single time series using Bayesian Online Changepoint Detection. NULL [SELECT * FROM ts_detect_changepoints('sales', product_id, date, qty)]
ts_detect_changepoints_agg aggregate Aggregate function: detects structural changepoints in time series for each group using Bayesian Online Changepoint Detection (BOCPD). NULL [SELECT product_id, ts_detect_changepoints_agg(date, value, MAP{}) FROM sales GROUP BY product_id]
ts_detect_changepoints_by table_macro Detects structural changepoints for each group using Bayesian Online Changepoint Detection. NULL [SELECT * FROM ts_detect_changepoints_by('sales', product_id, date, qty)]
ts_detect_multiple_periods scalar Detects multiple seasonal periods simultaneously, returning a ranked list of period candidates with confidence scores. NULL [ts_detect_multiple_periods(LIST(value ORDER BY date))]
ts_detect_peaks scalar Detects peaks in a time series array using prominence-based peak finding. Returns STRUCT with peak indices and properties. NULL [ts_detect_peaks(LIST(value ORDER BY date)), ts_detect_peaks(LIST(value ORDER BY date), MAP{'min_prominence': '0.5'})]
ts_detect_peaks table_macro Detects peaks in a single time series, returning peak indices, values, and prominence scores. NULL [SELECT * FROM ts_detect_peaks('sales', product_id, date, qty)]
ts_detect_peaks_by table_macro Detects peaks in each group's time series, returning peak indices, values, and prominence scores. NULL [SELECT * FROM ts_detect_peaks_by('sales', product_id, date, qty)]
ts_detect_periods table_macro Detects seasonal periods for a single time series, returning ranked period candidates with confidence scores. NULL [SELECT * FROM ts_detect_periods('sales', product_id, date, qty)]
ts_detect_periods_agg aggregate Aggregate function: detects seasonal periods for each group, returning the primary period, confidence, and a ranked list of candidates. NULL [SELECT product_id, ts_detect_periods_agg(date, value) FROM sales GROUP BY product_id]
ts_detect_periods_agg aggregate Aggregate function: detects seasonal periods for each group, returning the primary period, confidence, and a ranked list of candidates. NULL [SELECT product_id, ts_detect_periods_agg(date, value, MAP{'method': 'auto'}) FROM sales GROUP BY product_id]
ts_detect_periods_by table_macro Detects seasonal periods for each group, returning ranked period candidates with confidence scores. NULL [SELECT * FROM ts_detect_periods_by('sales', product_id, date, qty)]
ts_detect_seasonality scalar Tests whether a time series exhibits statistically significant seasonality. Returns TRUE/FALSE or a confidence score. NULL [ts_detect_seasonality(LIST(value ORDER BY date)), ts_detect_seasonality(LIST(value ORDER BY date), 7)]
ts_detect_seasonality_changes scalar Detects structural changes in seasonal patterns over time, returning periods where seasonality changes significantly. NULL [ts_detect_seasonality_changes(LIST(value ORDER BY date), 7)]
ts_detrend scalar Removes the trend component from a time series using linear or seasonal decomposition, returning detrended values. NULL [ts_detrend(LIST(value ORDER BY date), 7)]
ts_detrend_by table_macro Removes the trend component from each group's time series. NULL [SELECT * FROM ts_detrend_by('sales', product_id, date, qty, 7)]
ts_diff_by table_macro Computes first-order differences for each group's time series (value[t] - value[t-1]). NULL [SELECT * FROM ts_diff_by('sales', product_id, date, qty)]
ts_drop_constant_by table_macro Removes groups whose time series values are all constant (zero variance). NULL [SELECT * FROM ts_drop_constant_by('sales', product_id, date, qty)]
ts_drop_edge_zeros_by table_macro Removes both leading and trailing zeros from each group's time series. NULL [SELECT * FROM ts_drop_edge_zeros_by('sales', product_id, date, qty)]
ts_drop_gappy_by table_macro Removes groups whose time series have a gap rate exceeding a threshold. NULL [SELECT * FROM ts_drop_gappy_by('sales', product_id, date, qty, '1d', 0.1)]
ts_drop_leading_zeros_by table_macro Removes leading zeros from each group's time series, trimming the start of the series. NULL [SELECT * FROM ts_drop_leading_zeros_by('sales', product_id, date, qty)]
ts_drop_short_by table_macro Removes groups with fewer observations than the specified minimum length. NULL [SELECT * FROM ts_drop_short_by('sales', product_id, date, qty, 20)]
ts_drop_trailing_zeros_by table_macro Removes trailing zeros from each group's time series, trimming the end of the series. NULL [SELECT * FROM ts_drop_trailing_zeros_by('sales', product_id, date, qty)]
ts_drop_zeros_by table_macro Removes groups whose time series are predominantly zero values. NULL [SELECT * FROM ts_drop_zeros_by('sales', product_id, date, qty, 0.8)]
ts_estimate_backtest_memory scalar Estimates memory usage in MB for a ts_backtest_auto_by run given series count, length, folds, and horizon. NULL [ts_estimate_backtest_memory(100, 365, 3, 30)]
ts_estimate_period_acf scalar Estimates the seasonal period using the Autocorrelation Function (ACF) by finding the lag of maximum autocorrelation. NULL [ts_estimate_period_acf(LIST(value ORDER BY date))]
ts_estimate_period_fft scalar Estimates the dominant seasonal period using Fast Fourier Transform spectral analysis. NULL [ts_estimate_period_fft(LIST(value ORDER BY date))]
ts_features aggregate Aggregate function: extracts 117 tsfresh-compatible time series features for each group. Returns a STRUCT with all computed features. NULL [SELECT product_id, ts_features(date, value) FROM sales GROUP BY product_id]
ts_features aggregate Aggregate function: extracts 117 tsfresh-compatible time series features for each group. Returns a STRUCT with all computed features. NULL [SELECT product_id, ts_features(date, value, ['mean', 'std_dev']) FROM sales GROUP BY product_id]
ts_features aggregate Aggregate function: extracts 117 tsfresh-compatible time series features for each group. Returns a STRUCT with all computed features. NULL [SELECT product_id, ts_features(date, value, ['mean'], NULL) FROM sales GROUP BY product_id]
ts_features_agg aggregate Aggregate function: extracts 117 tsfresh-compatible time series features for each group. Returns a STRUCT with all computed features. NULL [SELECT product_id, ts_features_agg(date, value) FROM sales GROUP BY product_id]
ts_features_agg aggregate Aggregate function: extracts 117 tsfresh-compatible time series features for each group. Returns a STRUCT with all computed features. NULL [SELECT product_id, ts_features_agg(date, value, ['mean'], NULL) FROM sales GROUP BY product_id]
ts_features_agg aggregate Aggregate function: extracts 117 tsfresh-compatible time series features for each group. Returns a STRUCT with all computed features. NULL [SELECT product_id, ts_features_agg(date, value, config) FROM sales GROUP BY product_id]
ts_features_by table_macro Extracts time series features for each group and returns results as a structured table. NULL [SELECT * FROM ts_features_by('sales', product_id, date, qty)]
ts_features_config_from_csv scalar Parses a CSV string of feature names into a feature configuration for use with ts_features_by(). NULL [ts_features_config_from_csv('mean,std,skewness')]
ts_features_config_from_json scalar Parses a feature configuration JSON string for use with ts_features_by() to select specific features. NULL [ts_features_config_from_json('{"features": ["mean", "std"]}')]
ts_features_config_template table Returns a JSON template for configuring which features to compute with ts_features_by(). NULL [SELECT * FROM ts_features_config_template()]
ts_features_list table Returns a table listing all 117 available tsfresh-compatible feature names and their categories. NULL [SELECT * FROM ts_features_list()]
ts_features_table table_macro Extracts 117 tsfresh-compatible features and returns them as a wide table (one column per feature). NULL [SELECT * FROM ts_features_table('sales', product_id, date, qty)]
ts_fill_forward_by table_macro Forward-fills missing timestamps in each group's time series using the last known value. NULL [SELECT * FROM ts_fill_forward_by('sales', product_id, date, qty, '1d')]
ts_fill_forward_operator table Native table function: forward-fills NULL values in time series within groups. Used internally by ts_fill_forward_by(). NULL [SELECT * FROM ts_fill_forward_operator(source_table, group_col, date_col, value_col, target_date, frequency)]
ts_fill_gaps_by table_macro Fills missing timestamps in each group's time series to create a regular frequency grid. NULL [SELECT * FROM ts_fill_gaps_by('sales', product_id, date, qty, '1d')]
ts_fill_nulls_backward_by table_macro Backward-fills NULL values in each group's time series using the next known value. NULL [SELECT * FROM ts_fill_nulls_backward_by('sales', product_id, date, qty)]
ts_fill_nulls_const_by table_macro Fills NULL values in each group's time series with a constant value. NULL [SELECT * FROM ts_fill_nulls_const_by('sales', product_id, date, qty, 0.0)]
ts_fill_nulls_forward_by table_macro Forward-fills NULL values in each group's time series using the last known value. NULL [SELECT * FROM ts_fill_nulls_forward_by('sales', product_id, date, qty)]
ts_fill_nulls_mean_by table_macro Fills NULL values in each group's time series with the group mean. NULL [SELECT * FROM ts_fill_nulls_mean_by('sales', product_id, date, qty)]
ts_fill_unknown_by table_macro Fills unknown (NULL) feature values using a specified strategy for cross-validation. NULL [SELECT * FROM ts_fill_unknown_by('cv_data', product_id, date, feature_col, 'last_value')]
ts_forecast table_macro Generates a forecast for a single time series. Returns point forecasts with prediction intervals. NULL [SELECT * FROM ts_forecast('sales', product_id, date, qty, 'AutoETS', 12, '1d')]
ts_forecast_agg aggregate Aggregate function: produces a time series forecast for each group. Supports 32 forecasting models. Returns STRUCT(point[], lower[], upper[], fitted[], residuals[], model, aic, bic, mse). NULL [SELECT product_id, ts_forecast_agg(date, value, 'AutoETS', 12, MAP{}) FROM sales GROUP BY product_id]
ts_forecast_by table_macro Generates forecasts for multiple time series grouped by one or more keys. Returns point forecasts with prediction intervals. NULL [SELECT * FROM ts_forecast_by('sales', product_id, date, qty, 'AutoETS', 12, '1d')]
ts_forecast_exog table_macro Generates a forecast for a single time series using exogenous regressors. NULL [SELECT * FROM ts_forecast_exog('sales', product_id, date, qty, 'future_features', 'AutoARIMA', 12, '1d')]
ts_forecast_exog_by table_macro Generates forecasts for multiple time series using exogenous regressors. NULL [SELECT * FROM ts_forecast_exog_by('sales', product_id, date, qty, 'future_features', 'AutoARIMA', 12, '1d')]
ts_instantaneous_period scalar Estimates the instantaneous period of a time series using the Hilbert transform analytic signal method. Returns STRUCT(periods[], frequencies[], amplitudes[]). NULL [ts_instantaneous_period(LIST(value ORDER BY date))]
ts_interval_width_by table_macro Computes the mean width of prediction intervals for each group. NULL [SELECT * FROM ts_interval_width_by('forecasts', product_id, lower, upper)]
ts_lomb_scargle scalar Estimates the dominant period using the Lomb-Scargle periodogram, suitable for unevenly-sampled time series. NULL [ts_lomb_scargle(LIST(value ORDER BY date))]
ts_mae scalar Computes Mean Absolute Error (MAE) between actual and predicted value arrays. NULL [ts_mae(LIST(actual ORDER BY date), LIST(forecast ORDER BY date))]
ts_mae_by table_macro Computes Mean Absolute Error between actual and forecast columns per group. NULL [SELECT * FROM ts_mae_by('results', product_id, date, actual, forecast)]
ts_mape scalar Computes Mean Absolute Percentage Error (MAPE) between actual and predicted value arrays. NULL [ts_mape(LIST(actual ORDER BY date), LIST(forecast ORDER BY date))]
ts_mape_by table_macro Computes Mean Absolute Percentage Error between actual and forecast columns per group. NULL [SELECT * FROM ts_mape_by('results', product_id, date, actual, forecast)]
ts_mark_unknown_by table_macro Marks future values as unknown (NULL) for cross-validation leakage prevention. NULL [SELECT * FROM ts_mark_unknown_by('features', product_id, date, feature_col, cutoff_date)]
ts_mase scalar Computes Mean Absolute Scaled Error (MASE) comparing forecast error to a baseline model. NULL [ts_mase(LIST(actual ORDER BY date), LIST(forecast ORDER BY date), LIST(naive ORDER BY date))]
ts_mase_by table_macro Computes Mean Absolute Scaled Error comparing forecast to a baseline model per group. NULL [SELECT * FROM ts_mase_by('results', product_id, date, actual, forecast, baseline)]
ts_matrix_profile_period scalar Estimates the seasonal period using Matrix Profile motif discovery. NULL [ts_matrix_profile_period(LIST(value ORDER BY date))]
ts_mean_interval_width scalar Computes the mean width of prediction intervals: average of (upper - lower) across all steps. NULL [ts_mean_interval_width(lower, upper)]
ts_mqloss scalar Computes Mean Quantile Loss (MQLoss) across multiple quantile levels. NULL [ts_mqloss(LIST(actual ORDER BY date), LIST([lower, upper] ORDER BY date), [0.1, 0.9])]
ts_mse scalar Computes Mean Squared Error (MSE) between actual and predicted value arrays. NULL [ts_mse(LIST(actual ORDER BY date), LIST(forecast ORDER BY date))]
ts_mse_by table_macro Computes Mean Squared Error between actual and forecast columns per group. NULL [SELECT * FROM ts_mse_by('results', product_id, date, actual, forecast)]
ts_mstl_decomposition_by table_macro Decomposes each group's time series into trend, seasonal, and remainder components using MSTL. NULL [SELECT * FROM ts_mstl_decomposition_by('sales', product_id, date, qty, '[7,365]')]
ts_quality_report table_macro Generates a data quality report with null counts, gap counts, duplicate timestamps, and quality score per group. NULL [SELECT * FROM ts_quality_report('sales', product_id, date, qty)]
ts_quantile_loss scalar Computes the quantile (pinball) loss for a single quantile level. NULL [ts_quantile_loss(LIST(actual ORDER BY date), LIST(forecast ORDER BY date), 0.9)]
ts_quantile_loss_by table_macro Computes quantile (pinball) loss at a specified quantile level per group. NULL [SELECT * FROM ts_quantile_loss_by('results', product_id, date, actual, forecast, 0.9)]
ts_r2 scalar Computes the R-squared (coefficient of determination) between actual and predicted value arrays. NULL [ts_r2(LIST(actual ORDER BY date), LIST(forecast ORDER BY date))]
ts_r2_by table_macro Computes R-squared (coefficient of determination) between actual and forecast columns per group. NULL [SELECT * FROM ts_r2_by('results', product_id, date, actual, forecast)]
ts_rmae scalar Computes Relative MAE: ratio of MAE(actual, pred1) to MAE(actual, pred2). Values < 1 mean pred1 is better. NULL [ts_rmae(LIST(actual ORDER BY date), LIST(model_a ORDER BY date), LIST(model_b ORDER BY date))]
ts_rmae_by table_macro Computes Relative MAE (MAE ratio between two models) per group. NULL [SELECT * FROM ts_rmae_by('results', product_id, date, actual, pred1, pred2)]
ts_rmse scalar Computes Root Mean Squared Error (RMSE) between actual and predicted value arrays. NULL [ts_rmse(LIST(actual ORDER BY date), LIST(forecast ORDER BY date))]
ts_rmse_by table_macro Computes Root Mean Squared Error between actual and forecast columns per group. NULL [SELECT * FROM ts_rmse_by('results', product_id, date, actual, forecast)]
ts_sazed_period scalar Estimates the seasonal period using the SAZED (Self-Adaptive Zero-crossing Estimation of Dominant period) algorithm. NULL [ts_sazed_period(LIST(value ORDER BY date))]
ts_seasonal_strength scalar Computes the seasonal strength metric (0-1) indicating how strongly seasonal patterns dominate the time series. NULL [ts_seasonal_strength(LIST(value ORDER BY date), 7)]
ts_seasonal_strength_windowed scalar Computes rolling seasonal strength over a sliding window, returning strength estimates per window position. NULL [ts_seasonal_strength_windowed(LIST(value ORDER BY date), 7, 52)]
ts_smape scalar Computes Symmetric Mean Absolute Percentage Error (sMAPE) between actual and predicted value arrays. NULL [ts_smape(LIST(actual ORDER BY date), LIST(forecast ORDER BY date))]
ts_smape_by table_macro Computes Symmetric Mean Absolute Percentage Error between actual and forecast columns per group. NULL [SELECT * FROM ts_smape_by('results', product_id, date, actual, forecast)]
ts_split_keys table Splits a composite group key column back into its original multiple key columns. NULL [SELECT * FROM ts_split_keys(TABLE(SELECT unique_id, date, value FROM t), separator='|', columns=['region', 'store', 'item'])]
ts_ssa_period scalar Estimates the seasonal period using Singular Spectrum Analysis (SSA). NULL [ts_ssa_period(LIST(value ORDER BY date))]
ts_stats table_macro Computes 34 time series statistics per group. Returns a wide table with one column per statistic. NULL [SELECT * FROM ts_stats('sales', product_id, date, qty, '1d')]
ts_stats_agg aggregate Aggregate function: computes 34 time series statistics for each group. Returns a STRUCT with mean, std, min, max, trend, seasonality, and many more. NULL [SELECT product_id, ts_stats_agg(date, value) FROM sales GROUP BY product_id]
ts_stats_by table_macro Alias for ts_stats. Computes 34 time series statistics per group. NULL [SELECT * FROM ts_stats_by('sales', product_id, date, qty, '1d')]
ts_stats_summary table_macro Aggregates ts_stats output across all groups into summary statistics (mean, std, min, max per metric). NULL [SELECT * FROM ts_stats_summary('sales', product_id, date, qty, '1d')]
ts_stl_period scalar Estimates the seasonal period using Seasonal and Trend decomposition using Loess (STL). NULL [ts_stl_period(LIST(value ORDER BY date))]
ts_validate_separator table Validates that group key separators in composite keys are consistent and non-ambiguous. NULL [SELECT * FROM ts_validate_separator(TABLE(SELECT region, store FROM t), separator='|')]
ts_validate_timestamps_by table_macro Validates that timestamps are unique, monotonically increasing, and match the expected frequency per group. NULL [SELECT * FROM ts_validate_timestamps_by('sales', product_id, date, qty, '1d')]
ts_validate_timestamps_summary_by table_macro Summarizes ts_validate_timestamps_by results across all groups. NULL [SELECT * FROM ts_validate_timestamps_summary_by('sales', product_id, date, qty, '1d')]

Overloaded Functions

This extension does not add any function overloads.

Added Types

This extension does not add any types.

Added Settings

name description input_type scope aliases
anofox_telemetry_enabled Enable or disable anonymous usage telemetry for anofox_forecast BOOLEAN GLOBAL []