RollingMedian / Computation Layer

Calculate the rolling (moving) median over a sliding window. Similar to pandas.rolling().median() or R's rollmedian(). More robust to outliers than mean.

Mathematical form: For each window, find value where:

Common applications:

  • Robust trend detection
  • Outlier-resistant smoothing
  • Image processing (median filtering)
  • Economic indicators (house prices)
  • Noise reduction in sensors
  • Clinical data analysis
  • Financial risk assessment

Note: More computationally intensive than mean but better handles outliers.

Table
0
0
Table

Select

column

The numeric column to compute rolling medians for. Ideal for:

  • Price data with outliers
  • Sensor data with noise
  • Economic indicators
  • Population statistics
  • Quality measurements

Especially useful when mean is skewed by extreme values.

Number of observations in each sliding window. Common choices:

  • 5: Weekly median (business days)
  • 7: Weekly median (calendar days)
  • 30: Monthly median
  • 90: Quarterly median Odd window sizes provide single middle value; even sizes average two middle values.

Weights

[f64, ...]

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

  • Weights affect value selection process
  • Changes interpretation of median
  • Less common than weighted means

Consider carefully whether weighted median meets analytical needs.

AsWindow

Require complete windows for median calculation. Ensures statistical validity by only computing when all values in window are available. Critical for accurate central tendency measurement in presence of outliers.

1

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

  • 1: Calculate with any valid data point
  • window_size/2: Require majority of window
  • window_size: Require complete window

More observations generally provide more reliable central tendency.

Center

bool
false

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

  • true: Better for historical analysis and pattern identification
  • false: Better for real-time monitoring and immediate decision making

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.