# Td Acf

> Auto-correlation analysis for time series dependency and pattern detection

- Skill: `teradata-labs/td-acf` (Agent Skill, multi-file: 11 files)
- Install (CLI): `npx skillmds@latest add teradata-labs/td-acf`
- Raw SKILL.md: https://api.skillmd.com/api/skills/teradata-labs/td-acf/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- Author: teradata-labs (https://skillmd.com/u/teradata-labs)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/teradata-labs/td-acf

---


# Teradata Auto-Correlation Function

| **Skill Name** | Teradata Auto-Correlation Function |
|----------------|--------------|
| **Description** | Auto-correlation analysis for time series dependency and pattern detection |
| **Category** | UAF Time Series |
| **Function** | TD_ACF |
| **Framework** | Teradata Unbounded Array Framework (UAF) |

## Core Capabilities

- **Advanced UAF implementation** with EXECUTE FUNCTION INTO ART syntax
- **Scalable time series analysis** for millions of products or billions of IoT sensors
- **SERIES_SPEC-based input** with TABLE_NAME, ROW_AXIS, SERIES_ID, PAYLOAD
- **Production-ready SQL generation** with proper UAF syntax
- **Comprehensive error handling** and data validation
- **Business-focused interpretation** of analytical results
- **Integration with UAF pipeline** workflows

## UAF Function Syntax

TD_ACF uses the `EXECUTE FUNCTION INTO VOLATILE ART(result_table)` pattern:

```sql
EXECUTE FUNCTION COLUMNS(OUT_{value_col} AS {value_col}) INTO VOLATILE ART(acf_results)
TD_ACF(
    SERIES_SPEC(
        TABLE_NAME({input_table}),
        SERIES_ID({series_id_col}),
        ROW_AXIS(TIMECODE({time_column})),
        PAYLOAD(FIELDS({value_col}), CONTENT(REAL))
    ),
    FUNC_PARAMS(MAXLAGS({max_lags}), FUNC_TYPE(0), QSTAT(1), DEMEAN(1), ALPHA(0.05))
);
SELECT * FROM acf_results;
```

## Key Parameters for TD_ACF

- **MAXLAGS**: Maximum number of lags to compute (integer)
- **FUNC_TYPE**: 0 for standard ACF
- **QSTAT**: 1 to compute Ljung-Box Q-statistics
- **DEMEAN**: 1 to subtract mean before computing ACF
- **ALPHA**: Significance level for confidence intervals (e.g., 0.05)

## How to Use This Skill

1. **Provide Your Time Series Data**:
   ```
   "Analyze time series table: database.sensor_data with timestamp column and value columns"
   ```

2. **The Skill Will**:
   - Analyze temporal structure and sampling frequency
   - Identify optimal UAF function parameters
   - Generate complete TD_ACF workflow using EXECUTE FUNCTION INTO ART syntax
   - Provide performance optimization recommendations

## Input Requirements

### Data Requirements
- **Time series table**: Teradata table with temporal data
- **Timestamp column**: Time/date column for temporal indexing (used in ROW_AXIS TIMECODE)
- **Value columns**: Numeric columns for analysis (used in PAYLOAD FIELDS)
- **Series ID column**: Column identifying distinct series (used in SERIES_ID)
- **Regular sampling**: Consistent time intervals (recommended)

### Technical Requirements
- **Teradata Vantage** with UAF (Unbounded Array Framework) enabled
- **UAF License**: Access to time series and signal processing functions
- **Database permissions**: EXECUTE FUNCTION, SELECT on working database
- **Function access**: TD_ACF

## Output

TD_ACF results are stored in a volatile ART table. Use `SELECT * FROM result_table` to read them.

### Result Columns
- Lag number
- Auto-correlation coefficient at each lag
- Q-statistic (if QSTAT=1)
- P-value for Q-statistic
- Confidence interval bounds (based on ALPHA)

## Scripts Included

### Core UAF Scripts
- **`uaf_data_preparation.sql`**: UAF-specific data preparation
- **`td_acf_workflow.sql`**: Complete TD_ACF implementation with EXECUTE FUNCTION syntax
- **`td_acf_workflow_template.sql`**: Parameterized template
- **`uaf_table_analysis.sql`**: Time series structure analysis
- **`parameter_optimization.sql`**: Function parameter tuning

### Integration Scripts
- **`uaf_pipeline_template.sql`**: Multi-function UAF workflows using ART chaining
- **`performance_monitoring.sql`**: UAF execution monitoring
- **`result_interpretation.sql`**: Output analysis and visualization

## UAF Best Practices

- Use `EXECUTE FUNCTION INTO VOLATILE ART(...)` for all UAF function calls
- Chain UAF functions by referencing ART result tables in subsequent SERIES_SPEC TABLE_NAME
- Always specify SERIES_ID even for single-series data
- Use ROW_AXIS(TIMECODE(...)) for time-indexed series
- Specify PAYLOAD with FIELDS and CONTENT(REAL) for numeric data

---

*This skill provides production-ready UAF time series analytics using Teradata's Unbounded Array Framework TD_ACF with correct EXECUTE FUNCTION INTO ART syntax.*

