def exp_cov(prices, span=<NUM_LIT>, frequency=<NUM_LIT>):
if not isinstance(prices, pd.DataFrame):<EOL><INDENT>warnings.warn("<STR_LIT>", RuntimeWarning)<EOL>prices = pd.DataFrame(prices)<EOL><DEDENT>assets = prices.columns<EOL>daily_returns = daily_price_returns(prices)<EOL>N = len(assets)<EOL>S = np.zeros((N, N))<EOL>for i in range(N):<EOL><INDENT>for j in range(i, N):<EOL><INDENT>S[i, j] = S[j, i] = _pair_exp_cov(<EOL>daily_returns.iloc[:, i], daily_returns.iloc[:, j], span<EOL>)<EOL><DEDENT><DEDENT>return pd.DataFrame(S * frequency, columns=assets, index=assets)<EOL>
Estimate the exponentially-weighted covariance matrix, which gives
greater weight to more recent data.

:param prices: adjusted closing prices of the asset, each row is a date
               and each column is a ticker/id.
:type prices: pd.DataFrame
:param span: the span of the exponential weighting function, defaults to 180
:type span: int, optional
:param frequency: number of time periods in a year, defaults to 252 (the number
                  of trading days in a year)
:type frequency: int, optional
:return: annualised estimate of exponential covariance matrix
:rtype: pd.DataFrame