Main Content

ewstats

Expected return and covariance from return time series

Description

example

[ExpReturn,ExpCovariance,NumEffObs] = ewstats(RetSeries)computes estimated expected returns (ExpReturn), estimated covariance matrix (ExpCovariance), and the number of effective observations (NumEffObs). These outputs are maximum likelihood estimates which are biased.

example

[ExpReturn,ExpCovariance,NumEffObs] = ewstats(___,DecayFactor,WindowLength)adds optional input arguments forDecayFactorandWindowLength.

Examples

collapse all

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×20.1995 0.1002
ExpCovariance =2×20.0032 -0.0017 -0.0017 0.0010

Input Arguments

collapse all

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.

Data Types:double

(Optional) Controls how much less each observation is weighted than its successor, specified as a numeric value. Thekth observation back in time has weightDecayFactork.DecayFactormust lie in the range:0 < DecayFactor <= 1.

The default value of1is the equally weighted linear moving average model (BIS).

Data Types:double

(Optional) Number of recent observations in the computation, specified as a numeric value.

Data Types:double

Output Arguments

collapse all

Estimated expected returns, returned as a1-by-NASSETSvector.

Estimated covariance matrix, returned as aNASSETS-by-NASSETSmatrix.

The standard deviations of the asset return processes are defined as

STDVec = sqrt(diag(ExpCovariance))

The correlation matrix is

CorrMat = ExpCovariance./( STDVec*STDVec' )

NumEffObsis the number of effective observations where

N u m E f f O b s = 1 D e c a y F a c t o r W i n d o w L e n g t h 1 D e c a y F a c t o r

A smallerDecayFactororWindowLengthemphasizes recent data more strongly but uses less of the available data set.

Algorithms

For a return seriesr(1),…,r(n), where (n) is the most recent observation, andwis the decay factor, the expected returns (ExpReturn) are calculated by

E ( r ) = ( r ( n ) + w r ( n 1 ) + w 2 r ( n 2 ) + ... + w n 1 r ( 1 ) ) N u m E f f O b s

where the number of effective observationsNumEffObsis defined as

N u m E f f O b s = 1 + w + w 2 + ... + w n 1 = 1 w n 1 w

E(r) is the weighed average ofr(n),…,r(1). The unnormalized weights arew,w2, …,w(n-1). The unnormalized weights do not sum up to1, soNumEffObsrescales the unnormalized weights. After rescaling, the normalized weights (which sum up to1) are used for averaging. Whenw=1, thenNumEffObs=n, which is the number of observations. Whenw<1,NumEffObsis still interpreted as the sample size, but it is less thanndue to the down-weight on the observations of the remote past.

Note

There is no relationship betweenewstatsfunction and the RiskMetrics® approach for determining the expected return and covariance from a return time series.

Version History

Introduced before R2006a