IMLInvestment
Model Library

Statistical estimation

EWMA Variance Needs a Seed and an Information Clock

The decay parameter alone does not define an EWMA variance series. Initialization, mean treatment, normalization and observation timing determine its early and subsequent values.

Define the state and the return it can use

For a zero-conditional-mean return model, a simple EWMA variance update is v_t = lambda times v_(t-1) plus (1-lambda) times r_t squared. Here v_t is the state after observing return t and is used as a forecast for the next interval. The previous state was available before return t finished. This indexing convention prevents the same observation from being used both to set its own exposure and to measure that exposure's outcome. RiskMetrics uses explicit forecast-conditioning notation for this reason. An array position or date label alone is insufficient unless it states whether the value precedes or follows the corresponding return.

Initialization is part of the estimator

A recursive update needs an initial variance v_0. Possibilities include a presample estimate, a supplied prior variance or a first squared observation used as a seed. These choices consume information at different times and produce different early forecasts. A first-return seed cannot exist before that return is observed. A full-sample variance seed similarly cannot be treated as historically known at the beginning of the same sample. The table compares two explicitly supplied presample states, 0.0001 and 0.0004, using the same subsequent returns. Neither seed is declared correct; the purpose is to expose the persistence of a choice that might otherwise be hidden.

Track the seed's remaining influence

After t updates with a fixed lambda, the initial state's coefficient is lambda raised to t. Two recursions using identical returns but different seeds therefore differ by lambda raised to t times their initial difference. With lambda equal to 0.8, the coefficient remains 0.512 after three observations. Starting states that differ by 0.0003 still differ by 0.0001536. This is an exact identity, not an estimate of forecast uncertainty. A warmup can reduce seed sensitivity, but its length should be linked to an explicit residual-weight tolerance. Discarding a fixed number of observations without considering lambda does not establish that initialization has become negligible.

Read the update through squared returns

The hypothetical observed returns are +2%, -1% and 0%, expressed internally as 0.02, -0.01 and 0. Their squares are 0.0004, 0.0001 and zero. With the lower seed, the first update is 0.8 times 0.0001 plus 0.2 times 0.0004, giving 0.00016. The second gives 0.000148, and the third gives 0.0001184. A positive and negative return of the same magnitude have the same effect in this model. A zero return multiplies the old state by lambda. It is therefore a substantive observation, not a harmless placeholder for a missing price or a market holiday.

Recursive and normalized windows differ

A finite normalized exponential average divides weighted observations by the sum of their included weights. A seeded recursion instead retains an explicit contribution from its initial state. For the first two squared returns here, a normalized average with relative weights 0.8 and 1 equals (0.8 times 0.0004 plus 0.0001)/1.8, or approximately 0.0002333333. That is not the lower-seed recursion's 0.000148. The pandas exponentially weighted documentation distinguishes adjusted finite weighting from recursive weighting and also describes missing-value behavior. A function name containing EWMA is therefore not enough to establish equivalence; the initial state, adjustment choice and treatment of absent observations must match.

A second moment is not every variance estimator

Squaring raw returns estimates a second moment around zero. It represents variance under the stated zero-mean assumption, not a general identity for a process with an arbitrary mean. Subtracting an estimated mean introduces another state or window and another timing convention. An exponentially weighted centered variance with a bias adjustment need not equal an exponentially weighted average of squared returns. Likewise, updating standard deviation directly is a different operation because the square root is nonlinear. The ewma-variance reference should be interpreted through its exact recurrence and input contract, without assuming that a statistical library's default variance function reproduces it.

Decay belongs to an observation clock

A fixed lambda per observation does not imply the same calendar memory for daily, weekly and irregular observations. The seed half-life in observation steps is log(0.5)/log(lambda); changing frequency without changing the decay changes its temporal meaning. Missing days require an explicit decision about whether the clock advances, whether the state is carried forward or whether observations are resampled. At lambda equal to one the state never updates; at zero the newest squared return replaces it entirely. These endpoint behaviors help explain the recurrence, but supported parameter bounds remain an implementation contract. Reproducing an update verifies state accounting, not the model's ability to forecast volatility.

Synthetic daily decimal returns and daily squared-return variance states, with lambda = 0.8 and a zero-mean model. Each post-return state forecasts the next interval, not the interval just observed. Initial states are supplied before the displayed sequence; this is a comparison of seeds, not fitted evidence or a declared engine default.
Information availableNew squared returnState from seed 0.0001State from seed 0.0004Remaining seed coefficient
Before return 1; presample states onlyNot yet observed0.00010000.00040001.000
After return 1: +2%0.00040000.00016000.00040000.800
After return 2: -1%0.00010000.00014800.00034000.640
After return 3: 0%0.00000000.00011840.00027200.512

Primary references

These sources support methods and conventions. The example values are original constructions, not observations extracted from these documents.

Related investigations

Statistical estimation

Covariance Shrinkage Is a Choice of Target, Not Just Intensity

The same shrinkage intensity can preserve individual variances, pull them together or impose factor structure. Those choices produce different risk estimates and allocations.

Risk measurement

Volatility Targeting Has Lags, Caps and Forecast Error

Scaling exposure by a volatility forecast targets a modeled risk level. Timing, leverage limits and changes in subsequent volatility prevent it from guaranteeing realized risk.

Risk measurement

Covariance Units and Frequency Must Travel With the Matrix

Decimal versus percentage returns and daily versus annual horizons change covariance scales. Correct matrix multiplication cannot repair mismatched units or unsupported time aggregation.