Harry Markowitz's Modern Portfolio Theory (MPT) shows that diversification reduces risk without sacrificing returns. The efficient frontier represents optimal portfolios—those offering the highest expected return for a given level of risk. Any portfolio below this curve is suboptimal. Markowitz won the Nobel Prize (1990) for this work.
// Asset parameters
const assets = [
{ return: 0.10, risk: 0.18 }, // Stocks
{ return: 0.04, risk: 0.06 }, // Bonds
{ return: 0.02, risk: 0.01 } // Cash
];
// Correlation matrix
const corr = [
[1.0, 0.2, 0.0],
[0.2, 1.0, 0.0],
[0.0, 0.0, 1.0]
];
// Calculate portfolio metrics
function portfolioStats(weights) {
// Expected return
const ret = weights[0]*assets[0].return +
weights[1]*assets[1].return +
weights[2]*assets[2].return;
// Variance (includes correlation)
let variance = 0;
for (let i = 0; i < 3; i++) {
for (let j = 0; j < 3; j++) {
variance += weights[i] * weights[j]
* assets[i].risk * assets[j].risk * corr[i][j];
}
}
return {
return: ret,
risk: Math.sqrt(variance)
};
}