Analysis & DNA

Understand your data before you forecast it. Vectrix’s analysis system extracts 65+ statistical features to build a DNA profile — revealing trend direction, seasonal patterns, volatility regime, structural breaks, and forecasting difficulty. This profile drives automatic model selection.

Quick Analysis

The analyze() function accepts the same input formats as forecast() — lists, arrays, DataFrames, Series, or CSV paths

from vectrix import analyze

report = analyze(df, date="date", value="sales")

Full Parameters

report = analyze(
    df,
    date="date",
    value="sales",
    period=None,             # auto-detected if None
    features=True,           # extract statistical features
    changepoints=True,       # detect structural breaks
    anomalies=True,          # detect anomalies
    anomalyThreshold=3.0     # z-score threshold
)

DNA Profile

Every time series has a unique statistical fingerprint — its “DNA.” Vectrix extracts 65+ features (autocorrelation structure, Hurst exponent, entropy, volatility clustering, seasonal strength, and more) to create a deterministic profile that drives model selection and difficulty estimation

dna = report.dna
print(f"Fingerprint: {dna.fingerprint}")
print(f"Difficulty: {dna.difficulty} ({dna.difficultyScore:.0f}/100)")
print(f"Category: {dna.category}")
print(f"Recommended: {dna.recommendedModels[:3]}")
AttributeDescription
fingerprintDeterministic hash — identical data always produces the same value
difficultyeasy / medium / hard / very_hard
difficultyScore0-100 numeric score
categoryseasonal, trending, volatile, intermittent, etc.
recommendedModelsOrdered list of optimal models
featuresDict of 65+ statistical features
summaryNatural language summary

!!! warning “Feature values are inside the features dict”

# CORRECT
dna.features['trendStrength']
dna.features['seasonalStrength']
dna.features['hurstExponent']
dna.features['seasonalPeakPeriod']

# WRONG — AttributeError
dna.trendStrength
dna.seasonalStrength
```

## Data Characteristics

The `characteristics` object provides a comprehensive statistical profile — trend direction and strength, seasonal patterns, volatility level, and predictability score

```python
c = report.characteristics
print(f"Length: {c.length}")
print(f"Period: {c.period}")
print(f"Trend: {c.hasTrend} ({c.trendDirection}, strength {c.trendStrength:.2f})")
print(f"Seasonality: {c.hasSeasonality} (strength {c.seasonalStrength:.2f})")
print(f"Volatility: {c.volatilityLevel} ({c.volatility:.4f})")
print(f"Predictability: {c.predictabilityScore}/100")
print(f"Outliers: {c.outlierCount} ({c.outlierRatio:.1%})")

Changepoints & Anomalies

Changepoints are locations where the time series undergoes a structural shift (sudden change in mean, variance, or trend). Anomalies are isolated observations that deviate from the expected pattern

print(f"Changepoints: {report.changepoints}")
print(f"Anomalies: {report.anomalies}")

!!! note “These are int index arrays” Both changepoints and anomalies are np.ndarray of integer indices, not dicts.

Quick Report

Run analysis and forecasting in a single call. DNA profiling, feature extraction, model selection, and forecasting — all at once

from vectrix import quickReport

report = quickReport(df, steps=14)
print(report['summary'])
forecastResult = report['forecast']
analysisResult = report['analysis']

quick_report is available as a snake_case alias for backward compatibility.

Direct ForecastDNA Access

For lower-level control — such as building custom model selection logic or caching DNA profiles — use the ForecastDNA class directly

from vectrix import ForecastDNA

dna = ForecastDNA()
profile = dna.analyze(data, period=7)
print(profile.fingerprint)
print(profile.recommendedModels)