Python: calculate the weighted average correlation coefficient

I am calculating the volatility (standard deviation) of returns of a portfolio of assets using the variance-covariance approach. Correlation coefficients and asset volatilities have been estimated from historical returns.

Now what I'd like to do is compute the average correlation coefficient, that is the common correlation coefficient between all asset pairs that gives me the same overall portfolio volatility.

I could of course take an iterative approach, but was wondering if there was something simpler / out of the box approach in numpy or pandas?

I've tried googling, but can't find anything.

Thanks

Topic numpy pearsons-correlation-coefficient correlation pandas python

Category Data Science


About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.