# How do I calculate the skewness of a portfolio of assets?

I need to calculate the skewness of a portfolio consisting of 6 assets. I know that for that I would need the co-skewness matrix between the assets. Does anybody know the formula for co-skewness or any simple software to calculate a co-skewness matrix?

Any useful information would be highly appreciated.

• please, anyone, can anyone tell me where can I find derivation of formula for portfolio skewness and kurtosis? I can find formulas everywhere, but how did they get like that? – user2571 Jun 17 '12 at 18:06
• @mary you should really add a new question if you think it is on topic. – Bob Jansen Jun 18 '12 at 8:10
• For an Excel and VBA implementation with open source code see here – purbani Mar 2 '14 at 23:03

## 3 Answers

Actually, co-skewness is represented by a rank 3 tensor, rather than a matrix.

I'm going to reproduce the formulation from Bhandari and Das, Options on portfolios with higher-order moments, but I'll add and omit some details.

The co-skewness tensor is $$S_{ijk} = E \left[ r_i \times r_j \times r_k \right] = \frac{1}{T} \sum_{t=1}^T r_i(t) \times r_j(t) \times r_k(t)$$ where $r$ are asset returns over $T$ time periods.

Then, given portfolio weights $w$, mean asset returns $\mu$, covariance matrix $\Sigma$, and portfolio variance $\sigma_p^2(w) = w\prime \Sigma w$, we calculate moments: $$\begin{eqnarray*} m_1 & = & w\prime \mu \\ m_2 & = & \sigma_p^2 + m_1^2 \\ m_3 & = & \sum_{i=1}^N \sum_{j=1}^N \sum_{k=1}^N w_i w_j w_k S_{ijk} \end{eqnarray*}$$

The portfolio skewness is then $$S_p = \frac{1}{\sigma_p^3} \left[ m_3 - 3m_2 m_1 + 2m_1^3 \right]$$

In the case of a 6-asset portfolio, the co-skewness tensor will contain 216 components; however, due to symmetry, it only contains 56 independent components.

Therefore, it can be helpful to reformulate the portfolio skewness equation for computational efficiency. To do this, we can start with the definition of skewness for portfolio returns, $$S_p = \frac{1}{\sigma_p^3} E [ \left( \sum_{i=1}^N w_i r_i \right)^3 ] \quad ,$$

and then apply the multinomial theorem to obtain the portfolio skewness in terms of only the independent components.

Update

• Especially for longer time series, the return moments should be centered on the means, i.e., $r_i = R_i - \bar{R}_i$
• In the case of daily returns, $R_i(t) = \frac{P(t) - P(t-1)}{P(t-1)}$, where $P(t)$ is the closing price at time $t$.
• Be sure the prices for returns are comparable from period to period. For example, stock prices may need adjustments to account for dividend payments. See this Q & A on return measurement for more discussion.

note: I edited the equation for the co-skewness tensor above.

• Thank you it is really useful.. One difference in return calculation I calculated returns as R(t)= Ln(P(t)-ln(P(t-1)).. hope this will not affect overall result.. Thank you for your detailed explanation.. – Pasha Aug 8 '11 at 15:30
• One more thing what about correlations between assets? should they be considered in skewness of portfolio?? – Pasha Aug 9 '11 at 13:47
• Correlations aren't needed explicitly, but come into play in calculating the m_2 moment. A covariance matrix is used to calculate the portfolio variance, sigma_p^2. Covariance_ij = Correlation_ij * sigma_i * sigma_j – Derek Ploor Aug 9 '11 at 14:58
• Thank you for your quick reply in this paper "improved estimates of higher-order comoments and implications for portfolio selection" by Lionel Martellini, Volker Ziemann as I understand they use correlations and calculate them differently...( if you just search the name of the paper in google it is second one offered by the google, sorry I don't now hot to cite paper in the comment. Regards, Pasha – Pasha Aug 9 '11 at 17:46
• I've just taken a quick look. The differences in the correlations (co-moments) in that paper are that it presents an estimator that uses constant co-moments, which greatly reduces the dimensionality of the problem for large portfolios. – Derek Ploor Aug 9 '11 at 23:53

Have a look at PortfolioAnalytics in R.

> library(PerformanceAnalytics)
> data(managers)
> CoSkewness(managers, managers)


Maybe you like working with coskewness. But it is not needed if you just want to estimate the skewness of the portfolio. If you have retunr times serise $(r^i_t)_{t=1}^T$ for each asset $i$ and the weights $w_i$ that these assets have in your portfolio then you can form $$r_t = \sum_{i=1}^6 w_i r^i_t \quad \text{for each } t,$$ and you simple estimate all moments on $(r_t)_{t_1}^T$. The solution will be the same as any matrix operation. Eg the variance is either $$VAR(r_t)$$ or equivalently (!) $$w^T \Sigma w$$ where $\Sigma$ is the covariance matrix of those 6 assets. The numbers will be the same. If you need comoments then you do so by using expressions of the form $$E[r_t^k*(r_t^i)^m],$$ for some integer $k$ and $m$.