Skip to content
All library documents

Integer Dtype Bug in VeighNa’s Linear Decay Factor Calculation

Article vn.py community

Summary

This technical report describes a dtype-sensitive error in VeighNa’s linear-decay time-series calculation using Polars rolling_map. In the reported example, a sparse binary series with one nonzero value produces zeros when stored as Int64, while the Float64 version matches the stated weighted-mean values. The suspected mechanism is integer arithmetic when integer observations are multiplied by integer decay weights, causing the rolling result to collapse to zero.

The issue can arise when conditional expressions emit integer literals and their output is passed to time-series rolling operators. The report identifies several affected alpha factors and says their correlations were in a lower range, while distinguishing rank, mean, and standard-deviation functions that use SciPy or NumPy and are reported unaffected. This is a focused bug report with a small synthetic example; it does not provide a full reproduction package, broader version analysis, or a fix validation.

Key ideas

  • The reported linear-decay calculation returns zero for integer input where a nonzero weighted average is expected.
  • The same test series stored as Float64 produces the report’s expected decay values.
  • Integer-valued conditional outputs can pass this dtype into rolling time-series functions.
  • The report lists several affected alpha factors and says some other rolling statistics are unaffected.
  • The evidence is a synthetic example and does not establish the full scope across library versions.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.