Visualize Portfolio Risk

This application is interactive. Be patient as it loads.

Example: Unconstrained Maximum Sharpe Ratio portfolio
Notice the Contributions to Risk are proportionate to the Contributions to Returnmax-sharpe-portfolio

Example: Unconstrained Minimum Variance portfolio
Notice the Weights and Contributions to Risk are Equal
min-var-portfolio

Example: Risk Parity portfolio
Contributions to Risk are equal
risk-parity-portfolio

Assumptions

Asset ClassVolatilityExpected_Return
US Stocks20%8%
Int’l Stocks25%8%
Bonds5%2%
REITs25%7%
Commodities25%5%

Correlation matrix
US StocksInt’l StocksBondsREITsCommodities
US Stocks1.000.950.150.850.60
Int’l Stocks0.951.000.300.800.70
Bonds0.150.301.000.250.05
REITs0.850.800.251.000.45
Commodities0.600.700.050.451.00

Definitions
Weight: Asset Value divided by the greater of 1 and the sum of all Asset Values
Valuei / max(1, \Sigma Valuei )

Risk Contribution: Product of Asset’s Weight and its covariance with the Portfolio, scaled by the Portfolio’s variance
weighti\sigmai,Portfolio / \sigma2Portfolio

Return Contribution: Product of Asset’s Weight and its Expected Return
weighti\mui

Sharpe Ratio: Ratio of Expected Return to Volatility
\mui / \sigmai

Note this is simply a “Return/Risk ratio,” which is not exactly the true definition of a Sharpe Ratio. However in the investment world vernacular the terms are interchangeable and for the purpose of this application their meanings are similar enough.

If you would like to know the precise definition of “Sharpe Ratio,” consult the source.

I created a slightly more elaborate version of this app in the Coursera course, Developing Data Products, the ninth of ten courses I took as part of the Johns Hopkins University Data Science certification.