next up previous contents index
Next: Mean variance portfolios. Up: Mean Variance Analysis. Previous: Mean Variance Analysis.   Contents   Index

Introduction.

The mean variance choice is one of the oldest finance areas, dating back to work of Markowitz. The basic assumption is that risk is measured by variance, and that the decision criterion should be to minimize variance given expected return, or to maximize expected return for a given variance.

Mean variance analysis is very simple when expressed in vector format.

Let


\begin{displaymath}\mathbf{e} = E \left[
\begin{array}{c}
r_1 \\
\vdots\\
r_n\\
\end{array}\right]
\end{displaymath}

be the expected return for the $n$ assets, and


\begin{displaymath}\mathbf{V} =
\left[
\begin{array}{cccc}
\sigma_{11} & \ldot...
...& \\
\sigma_{n1} & \ldots &\sigma_{nn} \\
\end{array}\right]
\end{displaymath}

be the covariance matrix.

\begin{displaymath}\sigma_{ij}= \textrm{cov}(r_i, r_j) \end{displaymath}

A portfolio of assets is expressed as

\begin{displaymath}\mathbf{\omega} = \left[
\begin{array}[c]{c}
\omega_1\\ \vdots \\ \omega_n
\end{array}\right]
\end{displaymath}

To find the expected return of a portfolio:

\begin{displaymath}E[r_p] = \mathbf{\omega}^\prime \mathbf{e} \end{displaymath}

and the variance of a portfolio:

\begin{displaymath}\sigma_p = \mathbf{\omega}^\prime \mathbf{V} \mathbf{\omega}
\end{displaymath}



// file mv_calc.cc
// author: Bernt A Oedegaard
// basic calculations for mean variance analysis

#include "newmat.h"
#include <cmath>

double mv_calculate_mean(const Matrix& e, const Matrix& w){ 
    Matrix tmp = e.t()*w;
    return tmp.element(0,0);
};

double mv_calculate_variance(const Matrix& V, const Matrix& w){ 
    Matrix tmp = w.t()*V*w;
    return tmp.element(0,0);
};

double mv_calculate_st_dev(const Matrix& V, const Matrix& w){ 
    double var = mv_calculate_variance(V,w);
    return sqrt(var);
};



next up previous contents index
Next: Mean variance portfolios. Up: Mean Variance Analysis. Previous: Mean Variance Analysis.   Contents   Index
Bernt Arne Odegaard
1999-09-09