Analytics

Trajectory Analysis

One domain-invariant engine. The same trajectory, anomaly, forecasting, change-point, and clustering pipeline runs over any entity type — and compares behaviors across domains. A drone's flight path, a stock's price curve, and a network link's load are all just trajectories in one behavioral space. All as native database queries.

Trajectory Similarity Matching

Compare two behavioral trajectories even when they occur at different speeds, with gaps, or across different time periods — and even when they come from different domains. Elastic temporal alignment finds the optimal mapping between any two sequences, whether both are vehicles or one is a vehicle and the other a market instrument.

Approach
Optimized elastic alignment
Exact trajectory alignment becomes impractical for long sequences. VectorScaleDB's optimized elastic-alignment engine provides near-linear-time matching with automatic accuracy/performance balancing based on trajectory length and variance.
  • Near-linear-time alignment that scales to long trajectories
  • Handles trajectories of different lengths and speeds
  • Behavioral distance as the per-step metric (matches compression)
  • Alignment path returned for visualization
Use Cases
When to use trajectory similarity
Trajectory similarity answers the question: "Did entity A behave like entity B?" This is distinct from point-in-time KNN (which finds similar states at a moment) or anomaly scoring (which measures deviation from baseline).
  • Route comparison: Do two vehicles follow the same path?
  • Cross-domain matching: Does a stock's curve trace the same shape as a sensor's load?
  • Reference matching: Compare against a "golden" trajectory template
  • Correlation detection: Identify synchronized behavioral trajectories across entity types

Statistical Anomaly Scoring

Detect when an entity is behaving unusually compared to its own historical baseline or its peer group — the same scoring runs over every entity type. Anomaly scores are computed in real time as new data arrives, and an entity normal within its own domain but anomalous in the cross-domain context still gets flagged.

Baseline Construction
Statistical baselines from compressed segments
The anomaly engine builds baselines from an entity's historical compressed segments. Because segments already capture regime statistics (centroid, drift, variance), baseline construction is fast and memory-efficient — no need to re-read raw vectors.
  • Configurable baseline window (1h, 1d, 7d, 30d, custom)
  • Weighted by recency: recent regimes matter more
  • Peer-group baselines: compare against similar entity types
  • Seasonal adjustment for periodic behavioral patterns
Scoring
Multi-factor anomaly scores
The anomaly score is a 0-1 normalized value computed from multiple contributing factors. Each factor measures a different dimension of behavioral deviation, and the overall score is a weighted combination.
  • Drift deviation: Current drift vs. historical drift distribution
  • Regime novelty: Is the current regime unlike any seen before?
  • Temporal pattern: Is this behavior unusual for this time of day/week?
  • Peer divergence: Is this entity deviating from its peer group?

Behavioral Forecasting Engine

Predict where an entity's behavioral trajectory is heading, using its historical pattern as the forecasting basis. The same forecast pipeline applies to any entity type — a vehicle, a market instrument, or a network link.

Approach
Regime-based extrapolation
Rather than forecasting individual raw points (which would require massive models), VectorScaleDB forecasts at the behavioral level. It projects the next behavioral state either by extrapolating the most recent step or by matching the closest prior pattern in the trajectory and applying its continuation — the same approach for every entity type.
Methods
Linear and pattern-matched
Two forecasting methods share one interface. Linear extrapolation projects from the most recent behavioral step for fast, low-latency prediction. Pattern-matched forecasting finds the most similar historical segment and applies its continuation, capturing recurring behavioral motifs. It falls back to linear when no close historical match exists.
Horizons
Minutes to days ahead
The forecast engine supports horizons from minutes (for real-time decision-making) to days (for planning). Accuracy degrades gracefully with horizon length, and the confidence intervals widen accordingly. Typical useful horizons depend on entity type and regime stability.

Change-Point Detection

Identify the exact moments when an entity's behavior fundamentally changes — the regime transitions that matter most for operational decision-making.

Detection
Multi-scale regime transition identification
Change-point detection operates at multiple temporal scales simultaneously, from sub-second spikes to long-term behavioral evolution. All scales run in parallel on the compressed segment stream.
  • Short-term: sudden behavioral spikes or drops
  • Medium-term: regime transitions (the primary use case)
  • Long-term: gradual behavioral evolution
  • Configurable sensitivity per scale
Integration
Change points power downstream queries
Detected change points are indexed and queryable. They serve as inputs to anomaly scoring (sudden regime changes elevate anomaly scores), forecasting (regime transitions update prediction models), and cross-domain cascade detection (correlated regime changes across entities signal systemic events).
  • Change points stored as queryable events
  • Feed into anomaly scoring pipeline
  • Trigger alerting rules when thresholds are exceeded
  • Power cross-domain cascade detection

Density-Based Semantic Clustering

Discover behavioral patterns across entire fleets, populations, or mixed-domain entity sets. Density-based behavioral clustering groups entities by behavioral similarity — regardless of entity type — revealing emergent patterns invisible in individual analysis.

Algorithm
Density-based clustering on segment centroids
The clustering algorithm operates on compressed segment centroids in embedding space. Because segments already represent behavioral regimes, clustering operates on meaningful behavioral representations rather than noisy raw data. The density-based approach naturally handles outliers and discovers arbitrarily-shaped clusters.
  • No need to specify cluster count in advance
  • Automatically identifies outlier entities
  • Behavioral distance for similarity scoring
  • Configurable density parameters
Applications
Fleet-scale pattern discovery
Semantic clustering answers questions that no single-entity analysis can:
  • How many distinct behavioral patterns exist in this fleet?
  • Which entities are behaving unlike any cluster (outliers)?
  • Are behavioral clusters shifting over time?
  • Which entities changed clusters this week?
  • What is the "normal" behavior distribution for this entity type?
Technical Detail
Trajectory similarity query with divergence analysis
Compare two entities' behavioral trajectories over a time window using trajectory similarity matching, then inspect the divergence points where their behaviors separated.
# Python: Trajectory similarity with divergence analysis
import vectorscaledb

client = vectorscaledb.Client("https://api.vectorscaledb.com")

# Compare two delivery vehicles' morning routes
result = client.query.trajectory_similarity(
    entity_a="vehicle-0042",
    entity_b="vehicle-0099",
    time_range={
        "start": "2026-03-09T06:00:00Z",
        "end": "2026-03-09T12:00:00Z"
    },
    algorithm="elastic",
    radius=50,  # Constraint radius for matching window
    return_alignment=True,
    return_divergence_points=True
)

print(f"Similarity score: {result.similarity_score:.4f}")
print(f"Alignment distance: {result.alignment_distance:.2f}")
print(f"Aligned length:   {result.aligned_length}")
print(f"Latency:          {result.latency_ms}ms")

# Inspect where the two vehicles diverged
print(f"\nDivergence points ({len(result.divergence_points)}):")
for dp in result.divergence_points:
    print(f"  {dp.timestamp}: gap={dp.gap:.3f} ({dp.description})")

# Now find all vehicles with similar morning behavior
fleet_matches = client.query.trajectory_search(
    reference_entity="vehicle-0042",
    time_range={
        "start": "2026-03-09T06:00:00Z",
        "end": "2026-03-09T12:00:00Z"
    },
    entity_type="TRACKED_OBJECT",
    min_similarity=0.8,
    limit=20
)

print(f"\nFleet matches (similarity >= 0.8): {len(fleet_matches.results)}")
for match in fleet_matches.results[:5]:
    print(f"  {match.entity_id}: {match.similarity:.4f}")

# Example output:
# Similarity score: 0.8472
# Alignment distance: 12.34
# Aligned length:   421
# Latency:          18.4ms
#
# Divergence points (3):
#   2026-03-09T08:14:22Z: gap=0.42 (route_split)
#   2026-03-09T09:31:05Z: gap=0.38 (speed_change)
#   2026-03-09T11:02:41Z: gap=0.29 (stop_duration)
#
# Fleet matches (similarity >= 0.8): 7
#   vehicle-0017: 0.9234
#   vehicle-0088: 0.9012
#   vehicle-0055: 0.8841
#   vehicle-0103: 0.8567
#   vehicle-0071: 0.8229

Related API Endpoints

Explore the full API reference for trajectory analysis and behavioral intelligence.

Related Capabilities

Unlock behavioral intelligence for your fleet

Schedule a technical demo to run trajectory analysis, anomaly detection, and forecasting on your data.