# Can I build an efficient frontier using matrix algebra?

If i have a vector of expected returns $$A$$, a covariance matrix $$C$$ and a vector of the corresponding weights $$W$$ for each investment, is it possible to generate the efficient frontier with vector algebra? I am sure I have seen the efficient frontier in matrix form somewhere but I cant remember it, something like $$W^TACW$$. I want to generate an efficient frontier in R by randomly selecting portfolio weights So I just need the matrix notation.

• the formulas were derived by R. C. Merton in a famous paper "An Analytic Derivation of the Efficient Portfolio Frontier" which is available online. It is also in many books for ex Chi-Fu Huang: foundations for financial economics pages 64 and 67. – noob2 Aug 10 at 0:23
• adding to previous answer, only the unconstrained efficient frontier, where short selling is allowed, can be solved analytically with matrix algebra. The constrained efficient frontier cannot be solved analytically – develarist Aug 10 at 3:26