# SAAM Algorithm

### SAAM Algorithm

All algorithms used in this app can use the Lagrange Multiplier Method to solve given problems. And all of these can be reduced to the following format:

\(max\{E(\omega^T r_{n+1}）-\lambda Var(\omega^T r_{n+1})\} \qquad (*)\)

Let \(W=\omega^T r_{n+1}\) and using the knowledge of probability theory, it is easy to know

\(Var(W)=E(Var(W|R_n))+Var(E(W|R_n)) \)

So, when the expected return and covariance matrix are assumed to be known, just as the assumption in Markowitz algorithm, the second part is zero, which is against with the ground truth.

In this way, SAAM algorithm is proposed, using Bayes theory.

### Math Forms

After having another attention to the (*), we know that when \(\mu\) and \(\Sigma\) are unknown and treated as state variables whose uncertainties are specified by their posterior distributions given the observations \(r_1,r_2,\cdots,r_n\) in a Bayesian framework. Note that if the prior distribution puts all its mass at\((\mu_0,\Sigma_0) \), then the minimization problem (*) reduces to Markowitz’s portfolio optimization problem that assumes \(\mu_0\) and \(\Sigma_0\) are given. The Lagrange multiplier \(\lambda\) in (*) can be regarded as the investor’s risk-aversion index when the variance is used to measure risk.

The problem (*) is not a standard stochastic optimization problem because of \([E(\omega^T r_{n+1})]^2\) ,which is included in \(Var(\omega^T r_{n+1})=E[(\omega^T r_{n+1})^2]-[E(\omega^T r_{n+1})]^2\). The method hereof solving (*) is to convert it to a standard stochastic control problem by using an additional parameter. Note that \(E(W)-\lambda Var(W) = h(EW,EW^2)\), where \(h(x,y) = x+\lambda x^2-\lambda y\). Let \(W_B =\omega_B^T r_{n+1}\) and \(\eta =1+2\lambda E(W_B)\), where \(\omega_B\) is the Bayes weight vector. Then

\begin{equation}

0 \geq h(EW,EW^2)-h(EW_B,EW_B^2) \\

=\eta\{E(W)-E(W_B)\} +\lambda \{E(W_B^2)-E(W^2)\} +\lambda \{E(W)-E(W_B)\}^2 \\

\geq \{\lambda E(W_B^2)-\eta E(W_B)\}- \{\lambda E(W^2)-\eta E(W)\}

\end{equation}

Since \(\eta =1+2\lambda E(W_B)\) and the target is \(max\{E(\omega^T r_{n+1}）-\lambda Var(\omega^T r_{n+1})\}\), so we have an equivalence problem as follows:

\(\underset{\eta}{max} \{E[\omega^T(\eta) r_{n+1}]-\lambda Var[\omega^T(\eta) r_{n+1}]\}\)

, \(\omega(\eta)\) is the solution of the stochastic optimization problem

\(\omega(\eta) =\underset{\omega}{argmin} \{\lambda E[(\omega^T r_{n+1})^2]-\eta E(\omega^T r_{n+1})\}\)

### Configuration of parameters

The difficulty of estimating \(\mu\)** **well enough for the plug-in portfolio to have reliable performance was pointed out by Black and Litterman (1990), who proposed the following pragmatic quasi-Bayesian approach to address this difficulty. Black and Litterman’s approach basically amounted to shrinking an investor’s subjective estimate of \(\mu\) to the market’s estimate implied by an “equilibrium portfolio.” The investor’s subjective guess of \(\mu\)

**is described in terms of “views” on linear combinations of asset returns, which can be based on past observations and the investor’s personal/expert opinions. More details can be seen in the article:**

*MEAN–VARIANCE PORTFOLIO OPTIMIZATION WHEN MEANS AND COVARIANCES ARE UNKNOWN.*

And the estimation of the covariance matrix can be gain by resampling.

### Reference

Lai, Tze Leung ; Xing, Haipeng ; Chen, Zehao MEAN–VARIANCE PORTFOLIO OPTIMIZATION WHEN MEANS AND COVARIANCES ARE UNKNOWN Ann. Appl. Stat. 5, no. 2A (2011), 798-823