next up previous contents index
Next: Short sales constraints Up: Mean Variance Analysis. Previous: Introduction.   Contents   Index

Mean variance portfolios.

In the case where there are no short sales constraints, the minimum variance portfolio for any given expected return has an analytical solution and is therefore easy to generate.

The portfolio given the expected return $E[r_p]$ is found as

\begin{displaymath}\mathbf{\omega}_p = \mathbf{g} + \mathbf{h} E[r_p] \end{displaymath}

For the mathematics of generating the unconstrained MV frontier, see chapter 3 of Huang and Litzenberger (1988).



// file mv_calc_port_unconstrained.cc
// author: Bernt A Oedegaard

#include "newmat.h"

ReturnMatrix mv_calculate_portfolio_given_mean_unconstrained(const Matrix& e, 
							     const Matrix& V, 
							     double r){
    int no_assets=e.Nrows();
    Matrix ones = Matrix(no_assets,1); for (int i=0;i<no_assets;++i){ ones.element(i,0) = 1; };
    Matrix Vinv = V.i();  // inverse of V
    Matrix A = (ones.t()*Vinv*e);  double a = A.element(0,0);
    Matrix B = e.t()*Vinv*e;       double b = B.element(0,0);
    Matrix C = ones.t()*Vinv*ones; double c = C.element(0,0);
    Matrix D = B*C - A*A;          double d = D.element(0,0);
    Matrix Vinv1=Vinv*ones; 
    Matrix Vinve=Vinv*e;
    Matrix g = (Vinv1*b - Vinve*a)*(1.0/d);
    Matrix h = (Vinve*c - Vinv1*a)*(1.0/d);
    Matrix w = g + h*r;
    w.Release();
    return w;
};



next up previous contents index
Next: Short sales constraints Up: Mean Variance Analysis. Previous: Introduction.   Contents   Index
Bernt Arne Odegaard
1999-09-09