Expected return and covariance from return time series
Compute Estimated Expected Returns and Estimated Covariance Matrix
This example shows how to compute the estimated expected returns and the estimated covariance matrix.
RetSeries = [ 0.24 0.08 0.15 0.13 0.27 0.06 0.14 0.13 ]; DecayFactor = 0.98; [ExpReturn, ExpCovariance] = ewstats(RetSeries, DecayFactor)
ExpReturn = 1×2 0.1995 0.1002
ExpCovariance = 2×2 0.0032 -0.0017 -0.0017 0.0010
RetSeries — Return series
Return series, specified the number of observations
NUMOBS) by number of assets
NASSETS) matrix of equally spaced incremental
return observations. The first row is the oldest observation, and the
last row is the most recent.
DecayFactor — Controls how much less each observation is weighted than its successor
1 (default) | numeric
(Optional) Controls how much less each observation is weighted than
its successor, specified as a numeric value. The kth
observation back in time has weight
DecayFactor must lie in the range:
< DecayFactor <= 1.
The default value of
1 is the equally weighted
linear moving average model (BIS).
WindowLength — Number of recent observations in computation
NUMOBS (default) | numeric
(Optional) Number of recent observations in the computation, specified as a numeric value.
ExpReturn — Estimated expected returns
Estimated expected returns, returned as a
ExpCovariance — Estimated covariance matrix
Estimated covariance matrix, returned as a
The standard deviations of the asset return processes are defined as
STDVec = sqrt(diag(ExpCovariance))
The correlation matrix is
CorrMat = ExpCovariance./( STDVec*STDVec' )
NumEffObs — Number of effective observations
NumEffObs is the number of effective observations
WindowLength emphasizes recent data more strongly
but uses less of the available data set.
For a return series
(n) is the most recent observation, and w
is the decay factor, the expected returns (
where the number of effective observations
E(r) is the weighed average of
The unnormalized weights are w,
w(n-1). The unnormalized weights do
not sum up to
NumEffObs rescales the
unnormalized weights. After rescaling, the normalized weights (which sum up to
1) are used for averaging. When w =
NumEffObs = n,
which is the number of observations. When w <
NumEffObs is still interpreted as the sample
size, but it is less than n due to the down-weight on the
observations of the remote past.
There is no relationship between
ewstats function and the
RiskMetrics® approach for determining the expected return and covariance from a
return time series.
Introduced before R2006a