<<



Challenges in Financial Computing

y

Martin B. Haugh and Andrew W. Lo

This Draft: March 18, 2001

Abstract

One of the fastest growing areas of scienti c computing is in the nancial industry. Manyof

the most basic problems in nancial analysis are still unsolved, and are surprisingly resilient

to the onslaught of legions of talented researchers from many diverse disciplines. In this

article, we hop e to give readers a sense of these challenges by describing a relatively simple

problem that all investors face|managing a p ortfolio of nancial securities over time to

optimize a particular ob jective function|and showing how complex such a problem can

b ecome as real-world considerations such as taxes, preferences, and p ortfolio constraints are

incorp orated into its formulation.



This researchwas partially supp orted by the MIT Lab oratory for .

y

MIT Sloan Scho ol of Management and Op erations ResearchCenter. Corresp onding author: Andrew W.

Lo, 50 Memorial Drive, E52-432, Cambridge, MA 02142{1347, (617) 253{0920 (voice), (617) 258{5727 (fax), [email protected] (email).

Contents

1 Intro duction 1

2 The Portfolio Optimization Problem 1

3 Taxes 4

4 Preferences 6

5 Portfolio Constraints 7

6 Possible Solution Techniques 8

References 11

1 Intro duction

One of the fastest growing areas of scienti c computing is in the nancial industry. Two

decades ago, terms such as \ nancial engineering", \computational nance", and \ nancial

" did not exist in common usage, yet to day these areas are regarded as distinct

and enormously p opular academic disciplines, with their own journals, conferences, and

professional so cieties.

One explanation for the remarkable growth in this area and the impressive array of

mathematicians, computer scientists, physicists, and economists that have been drawn to

quantitative nance is the formidable intellectual challenges that are intrinsic to nancial

markets. Many of the most basic problems in nancial analysis are still unsolved, and are

surprisingly resilienttothe onslaught of legions of researchers from diverse disciplines.

In this article, wehopetogive readers a sense of these challenges by describing a relatively

simple problem that all investors face|managing a p ortfolio of nancial securities over time

to optimize a particular ob jective function|and showing how complicated such a problem

can b ecome as real-world considerations are incorp orated into its formulation. We presentthe

basic dynamic p ortfolio optimization problem in Section 2, and then consider three asp ects

1

of the problem in Sections 3{5: taxes, investor's preferences, and p ortfolio constraints. We

conclude in Section 6 by reviewing one of the most promising class of metho ds for solving

these typ es of problems.

2 The Portfolio Optimization Problem

Portfolio optimization problems are among the most well-studied problems in mo dern -

2

nance, yet they continue to occupy the attention of nancial academics and industry pro-

fessionals, b oth b ecause of their practical relevance and their computational intractabilities.

The basic dynamic p ortfolio optimization problem consists of an individual investor's deci-

sions for allo cating wealth among various exp enditures and investment opp ortunities over

time so as to maximize some ob jective function|typically the investor's exp ected lifetime

1

These three issues are by no means exhaustive, but are merely illustrative examples of the kinds of

challenges faced by nancial engineers to day. See Haliassos and Michaelides (2000) and Haugh and Lo

(2001) for examples of other computational issues in p ortfolio optimization.

2

See for example Merton (1990). 1

utility|given the prices and price dynamics of go o ds and nancial securities he purchases,

and any constraints such as tax liabilities, loan repaymentprovisions, income payments, and

other cash in ows and out ows that determine the investor's overall budget.

For exp ositional clarity, we start with a simple framework in which there are only two

assets available to the investor: a b ond that yields a riskless rate of return and a sto ck that

yields a random return of either 10% or 10% with probability p and 1 p, resp ectively.

Denote by B and S the prices of the bond and sto ck at date t, resp ectively. Without loss

t t

of generality and for notational simplicity, we assume that S =$1 and the riskless rate of

0

interest is 0% hence B =1 for all t  0. Finally, supp ose that the investor's horizon spans

t

only three dates, t =0; 1; and 2, so that the p ossible paths for the sto ck price pro cess S are

t

given in Figure 1. Of course, in practice, an investor has many assets to cho ose from over

many dates and where the price of each asset can take on many values. But for illustrative

purp oses, this simpler sp eci cation is ideal because it contains all the essential features of

the dynamic p ortfolio optimization problem in a very basic setting. Nevertheless, even in

this simple framework, it will b ecome apparent that practical considerations such as taxes,

investor preferences, and p ortfolio constraints can create surprisingly dicult computational

challenges.

$1:21













$1:1





a



a



a



a

 a

a



a



a

$1



$:99



H

H

!

$:99

H

!

! H

!

H

!

H

!

$:9

H

!

! H

H

H

H

H

H

H

H

H

$:81

t =0 t =1 t =2

Figure 1: Sto ck Price Evolution 2

Let C denote the consumption exp enditures of the investor at date t and let W denote

t t

the investor's wealth just prior to date-t consumption. We assume that the investor has

a lifetime utility function U (C ;C ;C ) de ned over each consumption path fC ;C ;C g

0 1 2 0 1 2

that summarizes how much he values the entire path of consumption exp enditures. Then,

absent market frictions and assuming that the investor's utility function is time-additive and

time-homogeneous, i.e.,

U (C ;C ;C ) = u(C ) + u(C ) + u(C ) (1)

0 1 2 0 1 2

the investor's dynamic p ortfolio optimization problem at t =0 is given by:

V (W ) = Max E [u(C )+u(C )+u(C )] (2)

0 0 0 0 1 2

C ;C ;C

0 1 2

sub ject to

W C = x S + y B ; t =0; 1; 2 (3a)

t t t t t t

W = x S + y B ; t =0; 1 (3b)

t+1 t t+1 t t+1

C  0 ; t =0; 1; 2 (3c)

t

+

x ; y 2 Z ; t =0; 1; 2 (3d)

t t

x = y = 0 (3e)

2 2

+

where Z denotes the non-negative integers, and x and y are the number of shares of

t t

sto cks and b onds, resp ectively, that the investor holds in his p ortfolio immediately after

3

date t. The requirement that x and y are non-negative means that b orrowing and short

t t

sales are not allowed, a constraint that manyinvestors face. That x and y are required to b e

t t

non-negative integers simply re ects the fact that it is not p ossible to purchase a fractional

number of sto cks or b onds. The constraint (3b) states that W is equal to W multiplied

t+1 t

by the gross return on the p ortfolio b etween dates t and t +1.

This problem is easily solved numerically using the standard technique of sto chastic

3

Of course x and y may dep end only on the information available at time t, a restriction that we imp ose

t t

throughout this article. 3

4

dynamic programming. In particular, since V (W )=u(W ), we can then compute V (W )

2 2 2 1 1

using the Bellman equation so that

 

V (W ) = Max u(C )+E [V (W )] (4)

1 1 1 1 2 2

C

1

sub ject to the constraints in (3). An asp ect of (4) that makes it particularly easy to solveis

the fact that the value function V () dep ends on only one state variable, W . This enables

1 1

us to solve (4) numerically without to o many computations. Supp ose, for example, that

+

W = $1;000. Then, since x ; y 2 Z , there are only 1;100 p ossible values that W can

0 t t 1

take, so the right side of (4) must b e evaluated for only these 1;100 values. In contrast, when

there are market frictions or when the investor has a more complex utility function, we will

see how the computational requirements increase dramatically, re ecting Bellman's \curse

of dimensionality".

3 Taxes

Most seasoned investors are painfully aware of the substantial impact that taxes can have

on the p erformance of their investment p ortfolio, hence taxes play a ma jor role in most

5

dynamic p ortfolio optimization problems. To see how taxes can increase the computational

complexity of such problems, let trading pro ts in the sto ck b e sub ject to a capital gains tax

in the simple mo del of Section 2. Because this mo del has only two future p erio ds, we do not

distinguish between short-term and long-term capital gains, and for exp ositional simplicity

we also assume that capital losses from one p erio d cannot be used to o set gains from

a later period. Even though these simplifying assumptions do make the problem easier to

solve, nevertheless, it will b e apparent that the computations are considerably more involved

than in the no-tax case.

To solve the dynamic p ortfolio optimization problem with taxes, we use dynamic pro-

gramming as b efore. However, the value function is now no longer only a function of wealth,

but also dep ends on past sto ck prices and the numb er of shares of sto ck purchased at eachof

4

See, for example, Bertsekas (1995).

5

See, for example, Bertsimas, Lo and Mourtzinou (1998), Dybvig and Ko o (1996), and Constantinides

(1983). 4

those prices. In other words, the value function is now path-dep endent. If weuseN to de-

s;t

note the numb er of shares of sto ck that was purchased at date s  t and still in the investor's

p ortfolio immediately after trading at date t, then the p ortfolio optimization problem may

be expressed as:

V (W ) = Max E [ u(C )+u(C )+u(C )] (5)

0 0 0 0 1 2

C ;C ;C

0 1 2

sub ject to

 

t1

X

W C Max 0 ;  (S S )(N N ) =

t t t s s;t1 s;t

s=0

x S + y B ; t =0; 1; 2 (6a)

t t t t

W = x S + y B ; t =0; 1 (6b)

t+1 t t+1 t t+1

t

X

x = N ; t =0; 1; 2 (6c)

t s;t

s=0

C  0 ; t =0; 1; 2 (6d)

t

N  N  N  0 (6e)

0;0 0;1 0;2

N  N  0 (6f )

1;1 1;2

+

x ; y 2 Z ; t =0; 1; 2 (6g)

t t

x = y = 0 : (6h)

2 2

where  is the capital gains tax rate. When t = 2, the value function dep ends on (W ;S ;S ;N ;N )

2 1 2 0;1 1;1

and we obtain the relation:

!

1

X

V (W ;S ;S ;N ;N ) = u W Max f0;  (S S )N g (7)

2 2 1 2 0;1 1;1 2 2 s s;1

s=0

so that date-2 consumption is simply W less any capital gains taxes that must b e paid. At

2

t =1, the value function dep ends on (W ;S ;N ) and we can write the Bellman equation

1 1 0;0

as

 

V (W ;S ;N ) = Max u(C ) + E [V (W ;S ;S ;N ;N )] : (8)

1 1 1 0;0 1 1 2 2 1 2 0;1 1;1

C

1 5

If we compare (8) with (4), it is apparent that the presence of taxes has made the dynamic

p ortfolio optimization problem considerably more dicult. Sp eci cally, in solving (4) nu-

merically, V () is computed for only 1;100 p ossible values of W . In contrast, solving (8)

1 1

numerically requires the evaluation of V () for all p ossible combinations of fW ;S ;N g,of

1 1 1 0;0

6

which there are 1;001;000! Even in a simple two-p erio d two-asset mo del, the p ortfolio opti-

mization problem with taxes b ecomes considerably more complex. Indeed, in the T -p erio d

N -asset case, it is easy to see that by date T , there are O(NT ) state variables, and if each

NT

state variable can take on m distinct values, then there will be O(m ) p ossible states at

date T . For an investor with a 20-year horizon, an annual trading interval, and a choice of

25 assets at the start, and assuming that the state variables take on only 4 distinct values at

7 301

the end of the horizon, the number of p ossible states at the end will b e of the order 10 .

4 Preferences

Another imp ortant asp ect of p ortfolio optimization problems is the ob jective function that

represents the investor's preferences. Traditionally, these preferences have been represented

by time-additive time-homogeneous utility functions, which yields imp ortant computational

advantages b ecause it implies that the value function at date t do es not dep end on the

investor's consumption choices prior to date t.

Unfortunately, the assumptions of time-additivityand time-homogeneity seem to be in-

consistent with the empirical evidence on the consumption and p ortfolio choices of investors.

For example, it is well known that individuals tend to grow accustomed to their level of con-

sumption over a p erio d of time, implying that preferences dep end not only on to day's con-

6

This can b e veri ed by noting the one-to-one corresp ondence b etween fW ;S ;N g and fC ;S ;N g,

1 1 0;0 0 1 0;0

and counting the p ossible combinations of fC ;S ;N g. Assuming, as b efore, that W =$1;000, we see

0 1 0;0 0

that there are 1;001 p ossible choices for C . If C = i, then there are 1;000 i p ossible values for N . For

0 0 0;0

eachcombinationof(C ;N ), there are 2 p ossible values of S . This means that in total, there are

0 0;0 1

1;000

X

2 (1;000 i) = 1;001;000

i=0

combinations of fW ;S ;N g.

1 1 0;0

7

The numberofdistinctvalues that a state variable can take on dep ends, of course, on the precise nature

of the state variable. For example, for a binomial state variable that is not \recombining", the number of

T

distinct values it can takeonis2 ; ifitisrecombining, this is reduced to T +1. We use 4 only for illustrative

purp oses; in most practical applications, the numb er is considerably larger. 6

8

sumption level but also on levels of past consumption. Commonly known as \habit forma-

tion", such preferences imply that the value function V () is a function of (C ;C ;:::;C )

t 0 1 t1

in addition to any other relevant state variables. As in the case with taxes, these problems

quickly b ecome intractable as the number of time periods increases. Of course, there do

exist a few highly parametrized mo dels of habit formation in which closed-form solutions

9

are available, but in general these mo dels must b e solved numerically as in Heaton (1995).

There are many other empirical regularities of investors' preferences that can induce path

dep endence in the value function, and for each of these cases, the computational demands

quickly b ecome intractable.

5 Portfolio Constraints

When constraints are imp osed on a p ortfolio optimization problem, their impact on the com-

putational complexity of the problem is not obvious. On the one hand, some unconstrained

problems that admit closed-form solutions fail to do so once constraints are added. In prac-

tice, however, closed-form solutions are rarely available for realistic p ortfolio optimization

problems, with or without p ortfolio constraints. Such problems must b e solved numerically,

in which case, imp osing constraints can sometimes reduce the numb er of computations since

they limit the feasible region over which the value function must be evaluated. An example

of this is the impact of the constraints in (3) on the basic p ortfolio optimization problem de-

scrib ed in Section 2. In that case, we imp osed the constraintthat x and y are non-negative

t t

integers, eliminating the p ossibility of b orrowing or shortselling. This implies that only a

nite number of values for W are p ossible, and as a result, the number of computations

1

needed to evaluate V (W ) is greatly reduced.

1 1

On the other hand, in some cases constraints can greatly increase the number of com-

putations, despite the fact that they limit the feasible set. This typically occurs when the

constraints increase the dimensionality of the problem. For example, in the basic p ortfolio

optimization problem of Section 2, consider imp osing the additional constraint that the cu-

mulative number of shares transacted|b oth purchased and sold|up to date t is bounded

8

See Kahneman, Slovic, and Tversky (1982) for other examples of preferences that account for the foibles

of individual b ehavior.

9

For example, see Constantinides (1990). 7

10

by some function, f (t). In practice, these typ es of constraints are often imp osed on in-

vestment funds so as to reduce transactions costs and the risk of \churning". When such a

constraint is imp osed, the value function is no longer a function of only W , but also of the

t

cumulative number of shares transacted up to date t. By creating path dep endence in the

value function, constraints can substantially increase the computational complexity of even

the simplest p ortfolio optimization problems.

6 Possible Solution Techniques

As discussed in Section 2, the most natural technique for solving dynamic p ortfolio optimiza-

tion problems is sto chastic dynamic programming. However, this approach is often compro-

mised by several factors such as the curse of dimensionalitywhen to o many state variables

are involved, as in Sections 3{5. In general, practical considerations such as taxes, transac-

tions costs, indivisibilities and integer constraints, non-time-additive utility functions, and

other institutional features of nancial markets tend to create path dep endencies in p ortfolio

optimization problems, which increases the number of state variables in the value function.

Such problems are very dicult to solve in all but the simplest cases, with computational

demands that b ecome prohibitiveas the number of time p erio ds and assets increase.

In this section, we brie y outline an alternative that may pro duce go o d approximate

solutions to otherwise intractable p ortfolio optimization problems. This approach, called

\approximate dynamic programming", \neuro-dynamic programming", or \reinforcement

learning", has had much success recently in solving challenging dynamic optimization prob-

lems in several contexts, and is describ ed in more detail in Bertsekas and Tsitsiklis (1996).

The metho d has already been applied successfully in one nancial context by Longsta

and Schwartz (2001), who use the technique to price high-dimensional American options.

Although there are many di erent that may b e categorized as \approximate dy-

namic programming", we con ne our attention in this section to just one such :

approximate value iteration.

Supp ose the optimal value function at date t of a T -p erio d dynamic optimization problem

1 n 1 n

is given by V (X ;:::;X ) where (X ;:::;X ) are state variables. We assume that b ecause

t

t t t t

10

If 500 shares were purchased at t = 0 and 200 shares were sold at t = 1, the cumulativenumb er of shares

transacted as of date t = 1 is 700. 8

of the computational intractabilities, it is imp ossible to determine V () exactly. Therefore,

t

we de ne a parametrized class of functions

 

1 n p

e

V (X ;:::;X ; ) : 2R (9)

t t t

t t

1 n

e

^

whichwe call the approximation architecture. We then select our estimate V (X ;:::;X ; )

t t

t t

^

of V from this class of functions by selecting .

t t

Now supp ose that we have applied the backward recursion of the Bellman equation

e e

to obtain estimators V ;:::;V . Then we can use an approximate Bellman equation to

t+1 T

compute an estimator of the value function at time t so that

1 n 1 n

b e

^

V (X ;:::;X ) = Max E [V (X ;:::;X ; )] (10)

t t t+1 t+1

t t t+1 t+1

where the maximization is with resp ect to the decision variables, whichhave b een suppressed

b

for notational simplicity. Computing V () will often entail extensiveMonte Carlo simulations

t

since it is generally not p ossible to compute exp ectations over a high-dimensional space. In

b

these cases, we estimate V () at a xed number of \training p oints" (P ;:::;P ), where

t 1 m

n

each P 2 R represents a p ossible realization of the state vector at date t. Once we have

i

b e

estimated V (P ) for i =1;:::;m,we obtain V by solving the following least squares problem:

t i t

m

 

X

2

t t

b

b e

= arg Min V (P ) V (P ; ) : (11)

t t t t

i i

t

i=1

e e

With V now determined, we then pro ceed to compute V in a similar fashion, and continue

t t1

e

in this manner of approximate value iteration until we have found V .

0

Once an approximate dynamic programming algorithm has been implemented, an esti-

e

mator fV g of the value function is obtained. The natural question that follows is whether or

t

not this estimator is \go o d". While there are some theoretical results that provide a partial

11

answer to this question, it is often very dicult in practice to determine the accuracy of

an approximate solution to a particular problem. One p ossibility is to attempt to derive

lower and upp er b ounds on the true value function, V . Deriving a lower b ound is typically

t

11

See, for example, Bertsekas and Tsitsiklis (1996). 9

e

straightforward|the sequence fV : t = 1;:::;Tg de nes a feasible trading strategy and

t

therefore the value of this strategy,which can b e estimated via simulation, is a lower b ound

for V . However, deriving an upp er bound for V is generally not so straightforward, but

0 0

one p ossibility is to apply sto chastic duality theory, which has already been studied exten-

12

sively in the context of p ortfolio optimization. In addition, Haugh and Kogan (2001) have

successfully employed duality theory in conjunction with approximate dynamic program-

ming to construct lower and upp er bounds on the prices of American options. It is p ossible

that a similar approach might also work for p ortfolio optimization problems, which we are

investigating in ongoing research.

There are many other approximate dynamic programming solutions, including algorithms

13

based on approximate p olicy iteration and on Q-learning. These approaches generally share

the common feature of resorting to function approximation and simulation techniques to deal

with computational intractabilities. As computing power continues its remarkable growth,

we b elieve that these techniques will b ecome increasingly imp ortant in addressing many of

the challenges of nancial computing over the next few decades.

12

See, in particular, Karatzas and Shreve (1998).

13

See Bertsekas and Tsitsiklis (1996). 10

References

Bertsekas, D., 1995, Dynamic Programming and Optimal Control, Vol. I. Belmont, MA:

Athena Scienti c.

Bertsekas, D. and J. Tsitsiklis, 1996, Neuro-Dynamic Programming, Belmont, Massachusetts:

Athena Scienti c.

Bertsimas, D., A. W. Lo and G. Mourtzinou, 1998, \Tax-Aware Multip erio d Portfolio

Optimization", unpublished working pap er, MIT Sloan Scho ol of Management.

Constantinides, G. M., 1983, \Capital Market Equilibrium with Personal Tax", Economet-

rica 51, 611{636.

Constantinides, G. M., 1990, \Habit Formation: A Resolution of the Equity Premium

Puzzle", Journal of Political Economy 98, 519{543.

Dybvig, P. H. and H. K. Ko o, 1996, \Investment with Taxes", unpublished working pap er,

Olin Scho ol, Washington University in St Louis.

Haliassos, M. and A. Michaelides, 2000, \Calibration and Computation of Household Port-

folio Mo dels", forthcoming in L. Guiso, M. Haliassos and T. Jap elli, eds., Household

Portfolios. Cambridge, MA: MIT Press.

Haugh, M. and L. Kogan, 2001, \Pricing American Options: A Duality Approach", unpub-

lished working pap er, the Wharton Scho ol, University of Pennsylvania.

Haugh, M. and A. Lo, 2001, \Asset Allo cation and Derivatives", Quantitative 1,

42{75.

Heaton, J., 1995, \An Empirical Investigation of Asset Pricing with Temp orally Dep endent

Preference Sp eci cations", Econometrica 63, 681{717.

Kahneman, D., Slovic, P. and A. Tversky, 1982, Judgment Under Uncertainty: Heuristics

and Biases. Cambridge, UK: Cambridge University Press.

Karatzas, I. and S. Shreve, 1998, Methods of . New York: Springer

Verlag.

Longsta , F. and E. Schwartz, \Valuing American Options By Simulation: A Simple Least

Squares Approach", forthcoming in Review of Financial Studies.

Merton, R., 1990, Continuous-Time Finance. Oxford, UK:Basil Blackwell. 11