apaExponentialWeights(nObs, HalfLife)
Excel
=apaExponentialWeights(nObs, HalfLife)Result
Generates a vector of exponential weights of a certain length with a certain half-life.
Syntax
nObs: number of observations
HalfLife: half-life in number of observations, i.e. the observation whose weight is exactly half the weight of the most recent observation
Algorithm
wi = 2^((i − nObs) / HalfLife) / Σj 2^((j − nObs) / HalfLife), i = 1, …, nObs. The last (most recent) observation has the largest weight; the weights sum to one.
