RollingQuantile / Computation Layer

Calculate rolling quantiles (percentiles) over a sliding window. Similar to pandas.rolling().quantile() or R's roll_quantile().

Mathematical form: Find value where: where is the desired quantile.

Common applications:

  • Risk metrics (Value at Risk)
  • Performance analytics (percentile ranking)
  • Statistical quality control
  • Environmental threshold monitoring
  • Load balancing metrics
  • Population distribution analysis
  • Anomaly detection

Note: Supports different interpolation methods for precise quantile calculation.

Table
0
0
Table

Select

column

The numeric column to compute rolling quantiles for. Common uses:

  • Financial returns (risk metrics)
  • Response times (performance analysis)
  • Quality measurements (process control)
  • Population metrics (distribution analysis)
  • Environmental data (threshold monitoring)
0.25

Target quantile between 0 and 1. Common values:

  • 0.25: First quartile (25th percentile)
  • 0.50: Median (50th percentile)
  • 0.75: Third quartile (75th percentile)
  • 0.95: 95th percentile (common in risk metrics)
  • 0.99: 99th percentile (extreme values analysis)

Number of observations in sliding window. Common choices:

  • 100: Percentile over recent 100 observations
  • 250: Trading year for financial analysis
  • 1440: Daily analysis of minute data

Larger windows provide more stable quantile estimates.

Nearest

Method to calculate quantile when exact value doesn't exist. Choose based on:

  • Data type (discrete vs continuous)
  • Precision requirements
  • Performance needs
  • Conservative vs liberal estimates
Nearest ~

Select nearest value to theoretical quantile. Fastest method, but can be jumpy. Best for discrete data or when exact values must come from input.

Higher ~

Select next value above theoretical quantile. Conservative approach, useful for upper bound estimates and risk analysis.

Lower ~

Select next value below theoretical quantile. Less conservative approach, useful for lower bound estimates and minimum thresholds.

Midpoint ~

Average of higher and lower values. Balanced approach, smooths discrete jumps while maintaining relationship to actual data points.

Linear ~

Linear interpolation between nearest values. Most precise for continuous data, provides smooth transitions between quantile values.

Weights

[f64, ...]

Optional weights for window values. Must match window size if provided. Uses:

  • Time-weighted percentiles
  • Importance-weighted distributions
  • Custom probability weightings

Affects distribution and resulting quantile calculation.

AsWindow

Require complete windows for quantile calculation. Ensures statistical reliability by only computing when full distribution is available. Important for accurate percentile calculations.

1

Minimum number of valid observations (Value) required for quantile calculation. Examples:

  • 1: Calculate with any valid data
  • window_size/2: Require half window
  • window_size: Require full window More observations provide more reliable quantile estimates.

Center

bool
false

Window label position. When true, aligns to window center; when false, to end. Effects:

  • true: Better for historical distribution analysis
  • false: Better for real-time percentile monitoring

Name for the new column. If not provided, the system generates a unique name. If AsColumn matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.