4.3 Portfolio Properties
5.1.3 A Monte Carlo Based Algorithm
While the functions mN −1 and SN −1 can easily be computed in closed-form, as given by Eqs. 5.4 and 5.5, the remaining terms νk, mk and Sk do not admit analytic solutions. For example, at time tN −2, all of the required expectations involve the term 1 − mTNS−1N mN,
which is equal to (with drift φ = 0):
1 − mTN −1S−1N −1mN −1
= 1 − xTN −1ΠT
Ψ−1− Ψ−1ΠxN −1 1 + xTN −1ΠTΨ−1ΠxN −1−1
xT1ΠTΨ−1
ΠxN −1
= 1 − xTN −1ΠTΨ−1ΠxN −1+ xTN −1ΠTΨ−1ΠxN −12
1 + xTN −1ΠTΨ−1ΠxN −1
= 1
1 + xTN −1ΠTΨ−1ΠxN −1
,
where the first equality follows by applying the matrix inversion lemma to SN −1. The pres-ence of a quadratic function of xN −1 in the denominator makes νN −2, mN −2, SN −2, and all subsequent moments, difficult to compute analytically2.
In lieu of closed-form solutions, the sequence of optimal portfolio policies must, there-fore, be computed numerically. Specifically, the functions νk(xk), mk(xk) and Sk(xk) can be approximated through a two stage Monte-Carlo scheme consisting of a training phase, in which these functions are evaluated over a set of sample paths of the log-price process, and a testing phase, in which the resulting functional approximations are applied to real data. This approach bears resemblance to the Approximate Dynamic Programming (ADP) framework [48], in which the value function is directly approximated over a set of sample paths of the underlying state and control spaces.
In order to implement a Monte Carlo based approximation scheme, sample paths of the asset log-price process are required. One approach is to simulate the log-price process ac-cording to an M-ary tree, as shown in Figure 5-2(a), where each node of the tree contains the p−dimensional vector xk. On the one hand, this scheme suffers from the curse of dimen-sionality, since the size of the tree grows exponentially with the number of stages. However, a tree structure allows for easy computation of each expectation as a sample mean. For each node in the tree, a set of M samples from the conditional distribution f xk+1|xik are available at the next level, indexed by j, and therefore Eqs. 5.17 through 5.19 may be
2In the case where Π = 0, which corresponds to a system of p independent walks, the expressions for mk
and Skdo admit closed-form solutions and the Monte-Carlo algorithm described here is not needed.
5.1. MEAN-VARIANCE OPTIMAL PORTFOLIO CONSTRUCTION 115
(a) Sample paths of log-price process are generated according to a tree. The size of the tree grows exponentially with the number of stages.
(b) In order to avoid the curse of di-mensionality, a fixed number of sample paths of the log-price process are gener-ated.
Figure 5-2. Sample path simulation schemes.
approximated using a backwards recursion algorithm, as follows:
νk xik
While the tree structure enables direct computation of the required moments at each level using the sample mean estimator, a total of MN sample paths must be generated. Hence, this method quickly becomes computationally intractable3.
A second approach, depicted in Figure 5-2(b), addresses the curse of dimensionality by generating a fixed number of sample paths of the log-price process. Here, samples of
3Note that a tree structure is also required for computation of the desired moments using a numerical integration approach, which also suffers from the curse of dimensionality
f ( xk+1| x0), not f xk+1| xik, are available, and therefore importance sampling methods (see Appendix B) must be utilized in order to approximate the functions {νk, mk, Sk} using a sample mean estimator. Specifically, each component in the sample mean summation must be scaled by a weighting factor, wij, defined by:
wij =
Equations 5.17 through 5.19 may now be approximated using the modified backwards re-cursion algorithm:
where M now represents the total number of sample paths generated in the training set and j indices the samples from the conditional distribution f ( xk+1| x0). The full training phase procedure is summarized in Algorithm 1.
Once the training phase is complete, the grid of simulated log-prices and corresponding values of νk, mk and Sk can be used to determine the optimal portfolio weights for a new sequence of test prices. However, with the exception of the initial state, an exact log-price match will not be available in the training set. Thus, one must estimate the values of mk, and Sk by interpolating over the available samples. One possible scheme, based on the idea of a kernel-density estimate [53], is to weight the training values according to their “closeness” to the current test value. The scalar version of this interpolation scheme is illustrated in Fig. 5-3. A multivariate Gaussian kernel is selected, with a mean equal to the current test state, denoted by xtestk , and covariance matrix equal to the one period covariance of the underlying cointegrated VAR process. The corresponding weights are
5.1. MEAN-VARIANCE OPTIMAL PORTFOLIO CONSTRUCTION 117 Algorithm 1 Training Phase: Approximating νk(xk), mk(xk) and Sk(xk).
STEP 1: Generate Sample Paths for k = 1 to N do
STEP 3: Run backwards recursion for k = N − 2 to 0 do
In addition, the weights must be normalized so thatPM
j=1vj = 1. Now, the two functions needed for the optimal portfolio weight vector are approximated as:
mk xtestk
-2 0 2 4 6 8 10 0
0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45
x1
x2
x3
xTEST
Figure 5-3. Illustration of kernel density estimate.
The portfolio weight vector at time tk is computed as follows:
w∗k xtestk , rk
= 1
2λN
(γN− 2λNrk) S−1k xtestk mk xtestk .
The full testing phase procedure is summarized in Algorithm 2.
Thus, it is possible to utilize Monte Carlo and importance sampling methods to derive an algorithm for estimating a set of state-dependent recursive moments required for the computation of the dynamically optimal sequence of mean-variance portfolio policies, given by Eq. 5.16. The resulting procedure consists of a training phase, in which the functions are approximated over a grid of sample paths of the underlying log-price process, and a testing phase, in which the functions are evaluated on new data by interpolating between the training samples using an estimator based on a Gaussian kernel. The last step in de-riving the full dynamic MVO solution is to determine how to initially select the constants γN and λN of Problem P1 so that the variance constraint from Problem P0 is satisfied, as addressed in Section 5.1.4 next.