qis.InitType

class qis.InitType(*values)[source]

Bases: Enum

how an EWM recursion is seeded when no explicit init_value is given.

The seed is the state before a column’s first finite observation; that observation then updates it, s_{t0} = λ seed + (1-λ) x_{t0}. The seed keeps weight λ^(t-t0+1) at row t, below 5% after about 1.5 N rows for span N, so a full-sample seed leaks later information into the early estimates.

Variables:
  • ZERO – seed zero. Point in time; the early estimates are shrunk towards zero by the factor 1 - λ^(t-t0+1)

  • X0 – seed with the column’s first finite observation (its square, or cross product, in a second-moment recursion), so s_{t0} = x_{t0}. Point in time and the qis default; it is pandas adjust=False

  • MEAN – seed with the full-sample mean of the series the recursion runs on (for a variance, the mean of x^2). Uses the whole sample: look-ahead

  • VAR – seed a second-moment recursion with the full-sample variance of the observations (a covariance for a cross moment). Look-ahead. A mean recursion cannot take it: compute_ewm and compute_rolling_mean_adj raise ValueError, and where the same init_type also seeds a mean adjustment that mean is seeded with MEAN

__init__(*args, **kwds)

Attributes

ZERO = 1
X0 = 2
MEAN = 3
VAR = 4