an online portfolio selection algorithm with regret ... · online convex optimization. in the...

24
An Online Portfolio Selection Algorithm with Regret Logarithmic in Price Variation Elad Hazan Technion - Israel Inst. of Tech. Haifa, 32000 Israel [email protected] Satyen Kale IBM T.J. Watson Research Center P.O. Box 218, Yorktown Heights, NY 10598 [email protected] Abstract We present a novel efficient algorithm for portfolio selection which theoreti- cally attains two desirable properties: 1. Worst-case guarantee: the algorithm is universal in the sense that it asymp- totically performs almost as well as the best constant rebalanced portfolio determined in hindsight from the realized market prices. Furthermore, it at- tains the tightest known bounds on the regret, or the log-wealth difference relative to the best constant rebalanced portfolio. We prove that the regret of algorithm is bounded by O(log Q), where Q is the quadratic variation of the stock prices. This is the first improvement upon Cover’s [Cov91] semi- nal work that attains a regret bound of O(log T ), where T is the number of trading iterations. 2. Average-case guarantee: in the Geometric Brownian Motion (GBM) model of stock prices, our algorithm attains tighter regret bounds, which are prov- ably impossible in the worst-case. Hence, when the GBM model is a good approximation of the behavior of market, the new algorithm has an advan- tage over previous ones, albeit retaining worst-case guarantees. We derive this algorithm as a special case of a novel and more general method for online convex optimization with exp-concave loss functions. 1 1 Introduction A widely used model in mathematical finance for stock prices is the Geometric Brow- nian Motion (GBM). This model has been successfully applied to study and price fi- nancial instruments, and is the basis of much investing in practice. However, while it 1 An extended abstract of this work appeared in [HK09] 1

Upload: others

Post on 09-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

An Online Portfolio Selection Algorithm withRegret Logarithmic in Price Variation

Elad HazanTechnion - Israel Inst. of Tech.

Haifa, 32000 [email protected]

Satyen KaleIBM T.J. Watson Research Center

P.O. Box 218, Yorktown Heights, NY [email protected]

AbstractWe present a novel efficient algorithm for portfolio selection which theoreti-

cally attains two desirable properties:

1. Worst-case guarantee: the algorithm is universal in the sense that it asymp-totically performs almost as well as the best constant rebalanced portfoliodetermined in hindsight from the realized market prices. Furthermore, it at-tains the tightest known bounds on the regret, or the log-wealth differencerelative to the best constant rebalanced portfolio. We prove that the regretof algorithm is bounded by O(logQ), where Q is the quadratic variation ofthe stock prices. This is the first improvement upon Cover’s [Cov91] semi-nal work that attains a regret bound of O(log T ), where T is the number oftrading iterations.

2. Average-case guarantee: in the Geometric Brownian Motion (GBM) modelof stock prices, our algorithm attains tighter regret bounds, which are prov-ably impossible in the worst-case. Hence, when the GBM model is a goodapproximation of the behavior of market, the new algorithm has an advan-tage over previous ones, albeit retaining worst-case guarantees.

We derive this algorithm as a special case of a novel and more general method foronline convex optimization with exp-concave loss functions.1

1 IntroductionA widely used model in mathematical finance for stock prices is the Geometric Brow-nian Motion (GBM). This model has been successfully applied to study and price fi-nancial instruments, and is the basis of much investing in practice. However, while it

1An extended abstract of this work appeared in [HK09]

1

Page 2: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

is often an acceptable approximation, the GBM model is not always valid empirically.This motivates a worst-case approach to investing, called universal portfolio manage-ment, where the objective is to maximize wealth relative to the wealth earned by thebest fixed portfolio in hindsight. In this paper we tie the two approaches, and designan investment strategy which is universal in the worst-case, and yet capable of signif-icantly improved performance when the market is closely approximated by the GBMmodel.“Average-case” Investing: Much of mathematical finance theory is devoted to themodeling of stock prices and devising investment strategies that maximize wealth gain(while controlling risk). Typically, such investment strategies involve estimating fit-ting a parametric model of stock prices to observed data. Such strategies are geared tothe average-case market (in the formal computer science sense), and are naturally sus-ceptible to drastic deviations from the model, as witnessed in the recent stock marketcrash.

Even so, empirically the Geometric Brownian Motion (GBM) ([Osb59, Bac00])has enjoyed great predictive success and every year significant investments are madeassuming this model. One illustration of its wide acceptability is that Black and Sc-holes [BS73] used this same model in their Nobel prize winning work on pricing op-tions on stocks.“Worst-case” Investing: The fragility of average-case models in the face of rare butdramatic deviations led Cover [Cov91] to take a worst-case approach to investing instocks. The performance of an online investment algorithm for arbitrary sequences ofstock price returns is measured with respect to the best CRP (constant rebalanced port-folio, see [Cov91]) in hindsight. A universal portfolio selection algorithm is one thatobtains sublinear (in the number of trading periods T ) regret, which is the differencein the logarithms of the final wealths obtained by the two.

Cover [Cov91] gave the first universal portfolio selection algorithm with regretbounded by O(log T ). There has been much follow-up work after Cover’s seminalwork, such as [HSSW96, MF93, KV03, BK99, HAK07], which focused on either ob-taining alternate universal algorithms or improving the efficiency of Cover’s algorithm.However, the best regret bound is still O(log T ).

This dependence of the regret on the number of trading periods is not entirely sat-isfactory for two main reasons. First, a priori it is not clear why the online algorithmshould have high regret (growing with the number of iterations) in an unchanging en-vironment. As an extreme example, consider a setting with two stocks where one hasan “upward drift” of 1% daily, whereas the second stock remains at the same price.One would expect to “figure out” this pattern quickly and focus on the first stock, thusattaining a constant fraction of the wealth of the best CRP in the long run, i.e. constantregret, unlike the worst-case bound of O(log T ).

The second problem arises from trading frequency. Suppose we need to investover a fixed period of time, say a year. Trading more frequently potentially leads tohigher wealth gain, by capitalizing on short term stock movements. However, increas-ing trading frequency increases T , and thus one may expect more regret. The problemis actually even worse: since we measure regret as a difference of logarithms of the fi-nal wealths, a regret bound of O(log T ) implies a polynomial in T factor ratio betweenthe final wealths. In reality, however, experiments [AHKS06] show that some known

2

Page 3: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

online algorithms actually improve with increasing trading frequency.Bridging Worst-case and Average-case Investing: Both these issues are resolved ifone can show that the regret of a “good” online algorithm depends on total variationin the sequence of stock returns, rather than purely on the number of iterations. If thestock return sequence has low variation, we expect our algorithm to be able to performbetter. If we trade more frequently, then the per iteration variation should go downcorrespondingly, so the total variation stays the same.

We analyze a portfolio selection algorithm and prove that its regret is bounded byO(logQ), where Q (formally defined in Section 1.2) is the sum of squared deviationsof the returns from their mean. Since Q ≤ T (after appropriate normalization), weimprove over previous regret bounds and retain the worst-case robustness. Further-more, in an average-case model such as GBM, the variation can be tied very nicely tothe volatility parameter, which explains the experimental observation the regret doesn’tincrease with increasing trading frequency. Our algorithm is efficient, and its imple-mentation requires constant time per iteration (independent of the number of gameiterations).

1.1 New Techniques and Comparison to Related WorkCesa-Bianchi, Mansour and Stoltz [CBMS07] initiated work on relating worst caseregret to the variation in the data for the related learning problem of prediction fromexpert advice, and conjectured that the optimal regret bounds should depend on the ob-served variation of the cost sequence. Recently, this conjectured was proved and regretbounds of O(

√Q) were obtained in the full information and bandit linear optimization

settings [HK10, HK11], where Q is the variation in the cost sequence. In this paperwe give an exponential improvement in regret, viz. O(logQ), for the case of onlineexp-concave optimization, which includes portfolio selection as a special case.

Another approach to connecting worst-case to average-case investing was takenby Jamshidian [Jam92] and Cross and Barron [CB03]. They considered a model of“continuous trading”, where there are T “trading intervals”, and in each the onlineinvestor chooses a fixed portfolio which is rebalanced k times with k →∞. They provefamiliar regret bounds ofO(log T ) (independent of k) in this model w.r.t. the best fixedportfolio which is rebalanced T×k times. In this model our algorithm attains the tighterregret bounds of O(logQ), although our algorithm has more flexibility. Furthermoretheir algorithms, being extensions of Cover’s algorithm, may require exponential timein general2.

Our bounds of O(logQ) regret require completely different techniques comparedto the O(

√Q) regret bounds of [HK10, HK11]. These previous bounds are based on

first-order gradient descent methods which are too weak to obtain O(logQ) regret.Instead we have to use the second-order Newton step ideas based on [HAK07] (inparticular, the Hessian of the cost functions).

2Cross and Barron give an efficient implementation for some interesting special cases, under assumptionson the variation in returns and bounds on the magnitude of the returns, and assuming k → ∞. A trulyefficient implementation of their algorithm can probably be obtained using the techniques of Kalai andVempala.

3

Page 4: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

The second-order techniques of [HAK07] are, however, not sensitive enough to ob-tain O(logQ) bounds. This is because progress was measured in terms of the distancebetween successive portfolios in the usual Euclidean norm, which is insensitive to vari-ation in the cost sequence. In this paper, we introduce a different analysis technique,based on analyzing the distance between successive predictions using norms that keepchanging from iteration to iteration and are actually sensitive to the variation.

A key technical step in the analysis is a lemma (Lemma 5) which bounds the sumof differences of successive Cesaro means of a sequence of vectors by the logarithmof its variation. This lemma, which may be useful in other contexts when variationbounds on the regret are desired, is proved using the Kahn-Karush-Tucker conditions,and also improves the regret bounds in previous papers.

1.2 The model and statement of resultsPortfolio management. In the universal portfolio management model [Cov91], anonline investor iteratively distributes her wealth over n assets before observing thechange in asset price. In each iteration t = 1, 2, . . . the investor commits to an n-dimensional distribution of her wealth, xt ∈ ∆n =

∑i xi = 1 , x ≥ 0. She then

observes a price relatives vector rt ∈ Rn+, where rt(i) is the ratio between the closingprice of the ith asset on trading period t and the opening price. In the tth trading period,the wealth of the investor changes by a factor of (rt · xt). The overall change in wealthis thus

∏t(rt · xt). Since in a typical market wealth grows at an exponential rate,

we measure performance by the exponential growth rate, which is log∏t(rt · xt) =∑

t log(rt ·xt). A constant rebalanced portfolio (CRP) is an investment strategy whichrebalances the wealth in every iteration to keep a fixed distribution. Thus, for a CRPx ∈ ∆n, the change in wealth is

∏t(rt · x).

The regret of the investor is defined to be the difference between the exponentialgrowth rate of her investment strategy and that of the best CRP strategy in hindsight,i.e.

Regret := maxx∗∈∆n

∑t

log(rt · x∗)−∑t

log(rt · xt)

Note that the regret doesn’t change if we scale all the returns in any particular periodby the same amount. So we assume w.l.o.g. that in all periods t, maxi rt(i) = 1. Weassume that there is known parameter r > 0, such that for all periods t, mint,i rt(i) ≥r. We call r the market variability parameter. This is the only restriction we put onthe stock price returns; they could be chosen adversarially as long as they respect themarket variability bound.Online convex optimization. In the online convex optimization problem [Zin03],which generalizes universal portfolio management, the decision space is a closed,bounded, convex set K ∈ Rn, and we are sequentially given a series of convex cost3

functions ft : K → R for t = 1, 2, . . .. The algorithm iteratively produces a pointxt ∈ K in every round t, without knowledge of ft (but using the past sequence of cost

3Note the difference from the portfolio selection problem: here we have convex cost functions, rather thanconcave payoff functions. The portfolio selection problem is obtained by using − log as the cost function.

4

Page 5: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

functions), and incurs the cost ft(xt). The regret at time T is defined to be

Regret :=

T∑t=1

ft(xt)−minx∈K

T∑t=1

ft(x).

In this paper, we restrict our attention to convex cost functions which can be written asft(x) = g(vt ·x) for some univariate convex function g and a parameter vector vt ∈ Rn(for example, in the portfolio management problem, K = ∆n, ft(x) = − log(rt · x),g = − log, and vt = rt).

Thus, the cost functions are parametrized by the vectors v1, v2, . . . , vT . Our boundswill be expressed as a function of the quadratic variability of the parameter vectorsv1, v2, . . . , vT , defined as

Q(v1, ..., vT ) := minµ

T∑t=1

‖vt − µ‖2.

This expression is minimized at µ = 1T

∑Tt=1 vt, and thus the quadratic variation is just

T − 1 times the sample variance of the sequence of vectors v1, ..., vt. Note howeverthat the sequence can be generated adversarially rather than by some stochastic process.We shall refer to this as simply Q if the vectors are clear from the context.Main theorem. In the setup of the online convex optimization problem above, we havethe following algorithmic result:

Theorem 1. Let the cost functions be of the form ft(x) = g(vt · x). Assume that thereare parameters R,D, a, b > 0 such that the following conditions hold:

1. for all t, ‖vt‖ ≤ R,2. for all x ∈ K, we have ‖x‖ ≤ D,3. for all x ∈ K, and for all t, either g′(vt · x) ∈ [0, a] or g′(vt · x) ∈ [−a, 0], and4. for all x ∈ K, and for all t, g′′(vt · x) ≥ b.

Then there is an algorithm that guarantees the following regret bound:

Regret = O((a2n/b) log(1 + bQ+ bR2) + aRD log(1 +Q/R2) +D2).

Now we apply Theorem 1 to the portfolio selection problem. First, we estimate therelevant parameters. We have ‖rt‖ ≤

√n since all rt(i) ≤ 1, thus R =

√n. For any

x ∈ ∆n, ‖x‖ ≤ 1, so D = 1. g′(vt · x) = − 1(vt·x) , and thus g′(vt · x) ∈ [− 1

r , 0], soa = 1

r . Finally, g′′(vt · x) = 1(vt·x)2 ≥ 1, so b = 1. Applying Theorem 1 we get the

following corollary:

Corollary 2. For the portfolio selection problem over n assets, there is an algorithmthat attains the following regret bound:

Regret = O( nr2

log(Q+ n)).

5

Page 6: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

2 Bounding the Regret by the Observed Variation inReturns

2.1 PreliminariesAll matrices are assumed be real symmetric matrices in Rn×n, where n is the numberof stocks. We use the notation A B to say that A − B is positive semidefinite. Werequire the notion of a norm of a vector x induced by a positive definite matrix M ,defined as ‖x‖M =

√x>Mx. The following simple generalization of the Cauchy-

Schwartz inequality is used in the analysis:

∀x, y ∈ Rn : x · y ≤ ‖x‖M‖y‖M−1 .

We denote by |A| the determinant of a matrix A, and by A • B = Tr(AB) =∑ij AijBij . As we are concerned with logarithmic regret bounds, potential functions

which behave like harmonic series come into play. A generalization of harmonic seriesto high dimensions is the vector-harmonic series, which is a series of quadratic formsthat can be expressed as (here A 0 is a positive definite matrix, and v1, v2, . . . arevectors in Rn):

v>1 (A+ v1v>1 )−1v1, v

>2 (A+ v1v

>1 + v2v

>2 )−1v2, . . . , v

>t (A+

∑tτ=1vτv

>τ )−1vt, . . .

The following lemma is from [HAK07] (and proven in appendix A for completeness):

Lemma 3. For a vector harmonic series given by an initial matrix A and vectorsv1, v2, . . . , vT , we have

T∑t=1

v>t (A+∑tτ=1vτv

>τ )−1vt ≤ log

[|A+

∑Tτ=1 vτv

>τ |

|A|

].

The reader can note that in one dimension, if all vectors vt = 1 and A = 1, thenthe series above reduces exactly to the regular harmonic series whose sum is bounded,of course, by log(T + 1).

Henceforth we will denote by∑t the summation

∑Tt=1.

2.2 Algorithm and analysisWe analyze the following algorithm and prove that it attains logarithmic regret withrespect to the observed variation (rather than number of iterations). The algorithmfollows the generic algorithmic scheme of “Follow-The-Regularized-Leader” (FTRL)with squared Euclidean regularization.

Algorithm Exp-Concave-FTL. In iteration t, use the point xt defined as:

xt , arg minx∈∆n

(t−1∑τ=1

fτ (x) +1

2‖x‖2

)(1)

Note the mathematical program which the algorithm solves is convex, and can besolved in time polynomial in the dimension and number of iterations. The running

6

Page 7: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

time, however, for solving this convex program can be quite high. In section 4, forthe specific problem of portfolio selection, where ft(x) = − log(rt · x), we give afaster implementation whose per iteration running time is independent of the numberof iterations.

We now proceed to prove the Theorem 1.

Proof. [Theorem 1] First, we note that the algorithm is running a “Follow-the-leader”procedure on the cost functions f0, f1, f2, . . . where f0(x) = 1

2‖x‖2 is a fictitious

period 0 cost function. In other words, in each iteration, it chooses the point that wouldhave minimized the total cost under all the observed functions so far (and, additionally,a fictitious initial cost function f0). This point is referred to as the leader in that round.

The first step in analyzing such an algorithm is to use a stability lemma from[KV05], which bounds the regret of any Follow-the-leader algorithm by the differ-ence in costs (under ft) of the current prediction xt and the next one xt+1, plus anadditional error term which comes from the regularization. Thus, we have (recall thenotation

∑t ≡

∑Tt=1)

Regret ≤∑t

ft(xt)− ft(xt+1) +1

2(‖x∗‖2 − ‖x0‖2)

≤∑t

∇ft(xt) · (xt − xt+1) +1

2D2

=∑t

g′(vt · xt)[vt · (xt − xt+1)] +1

2D2 (2)

The second inequality is because ft is convex. The last equality follows because∇ft(xt) = g′(xt · vt)vt. Now, we need a handle on xt − xt+1. For this, defineFt =

∑t−1τ=0 fτ , and note that xt minimizes Ft over K. Consider the difference in the

gradients of Ft+1 evaluated at xt+1 and xt:

∇Ft+1(xt+1)−∇Ft+1(xt) =

t∑τ=0

∇fτ (xt+1)−∇fτ (xt)

=

t∑τ=1

[g′(vτ · xt+1)− g′(vτ · xt)]vτ + (xt+1 − xt)

=

t∑τ=1

[∇g′(vτ · ζtτ ) · (xt+1 − xt)]vτ + (xt+1 − xt)

(3)

=

t∑τ=1

g′′(vτ · ζtτ )vτv>τ (xt+1 − xt) + (xt+1 − xt).

(4)

Equation 3 follows by applying the Taylor expansion of the (multi-variate) functiong′(vτ · x) at point xt, for some point ζtτ on the line segment joining xt and xt+1. Theequation (4) follows from the observation that∇g′(vτ · x) = g′′(vτ · x)vτ .

7

Page 8: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

DefineAt =∑tτ=1 g

′′(vτ ·ζtτ )vτv>τ +I , where I is the identity matrix, and ∆xt =

xt+1 − xt. Then equation (4) can be re-written as:

∇Ft+1(xt+1)−∇Ft(xt)− g′(vt · xt)vt = At∆xt. (5)

Now, since xt minimizes the convex function Ft over the convex set K, a standardinequality of convex optimization (see [BV04]) states that for any point y ∈ K, wehave∇Ft(xt)·(y−xt) ≥ 0. Thus, for y = xt+1, we get that∇Ft(xt)·(xt+1−xt) ≥ 0.Similarly, we get that ∇Ft+1(xt+1) · (xt − xt+1) ≥ 0. Putting these two inequalitiestogether, we get that

(∇Ft+1(xt+1)−∇Ft(xt)) ·∆xt ≤ 0. (6)

Thus, using the expression for At∆xt from (5) we have

‖∆xt‖2At = At∆xt ·∆xt= (∇Ft+1(xt+1)−∇Ft(xt)− g′(vt · xt)vt) ·∆xt≤ g′(vt · xt)[vt · (xt − xt+1)] (from (6)) (7)

Assume that g′(vt · x) ∈ [−a, 0] for all x ∈ K and all t. The other case is handledsimilarly. Inequality (7) implies that g′(vt ·xt) and vt · (xt−xt+1) have the same sign.Thus, we can upper bound

g′(vt · xt)[vt · (xt − xt+1)] ≤ a(vt ·∆xt). (8)

Define vt = vt − µt, µt = 1t+1

∑tτ=1 vτ . Then, we have

∑t

vt ·∆xt =∑t

vt ·∆xt +

T∑t=2

xt(µt−1 − µt)− x1µ1 + xT+1µT , (9)

Now, define ρ = ρ(v1, . . . , vT ) =∑T−1t=1 ‖µt+1 − µt‖. Then we bound

T∑t=2

xt(µt−1 − µt)− x1µ1 + xT+1µT

≤T∑t=2

‖xt‖‖µt−1 − µt‖+ ‖x1‖‖µ1‖+ ‖xT+1‖‖µT ‖

≤ Dρ+ 2DR. (10)

We will bound ρ momentarily. For now, we turn to bounding the first term of (9) usingthe Cauchy-Schwartz generalization as follows:

vt ·∆xt ≤ ‖vt‖A−1t‖∆xt‖At . (11)

By the usual Cauchy-Schwartz inequality,∑t

‖vt‖A−1t‖∆xt‖At ≤

√∑t

‖vt‖2A−1t

·√∑

t

‖∆xt‖2At

≤√∑

t

‖vt‖2A−1t

·√∑

t

a(vt ·∆xt).

8

Page 9: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

from (7) and (8). We conclude, using (9), (10) and (11), that

∑t

a(vt ·∆xt) ≤ a

√∑t

‖vt‖2A−1t

·√∑

t

a(vt ·∆xt) + aDρ+ 2aDR.

This implies (using the AM-GM inequality applied to the first term on the RHS) that∑t

a(vt ·∆xt) ≤ a2∑t

‖vt‖2A−1t

+ 2aDρ+ 4aDR.

Plugging this into the regret bound (2) we obtain, via (8),

Regret ≤ a2∑t

‖vt‖2A−1t

+ 2aDρ+ 4aDR+1

2D2.

The proof is completed by the following two lemmas (Lemmas 4 and 5) whichbound the RHS. The first term is a vector harmonic series, and the second term can bebounded by a (regular) harmonic series.

Lemma 4.∑t ‖vt‖2A−1

t

≤ 5nb log

[1 + bQ+ bR2

].

Proof. We have At =∑tτ=1 g

′′(vτ · ζtτ )vτv>τ + I . Since g′′(vt · ζtτ ) ≥ b, we have

At I + b∑tτ=1 vτv

>τ . Using the fact that vt = vt − µt and µt = 1

t+1

∑τ≤t vτ we

get that

t∑τ=1

vτ v>τ =

t∑s=1

(vs −1

s+ 1

∑τ≤s

vτ )(vs −1

s+ 1

∑τ≤s

vτ )>

=

t∑s=1

(1 +

t∑τ=s

1

(τ + 1)2− 2

s+ 1

)vsv>s +

t∑s=1

∑r<s

(− 1

s+ 1+

t∑τ=s

1

(τ + 1)2

)[vrv

>s + vsv

>r ].

Since

1

s+ 1− 1

t+ 2=

∫ t+2

s+1

1

x2dx ≤

t∑τ=s

1

(τ + 1)2≤∫ t+1

s

1

x2dx =

1

s− 1

t+ 1, (12)

we get that ∣∣∣∣∣− 1

s+ 1+

t∑τ=s

1

(τ + 1)2

∣∣∣∣∣ ≤ 1

s2+

1

t. (13)

Since (vr ± vs)(vr ± vs)> 0, we have (vrv>r + vsv

>s ) ±(vrv

>s + vsv

>r ), and so(

− 1

s+ 1+

t∑τ=s

1

(τ + 1)2

)[vrv

>s + vsv

>r ]

∣∣∣∣∣− 1

s+ 1+

t∑τ=s

1

(τ + 1)2

∣∣∣∣∣ [vrv>r + vsv>s ]

(

1

s2+

1

t

)[vrv

>r + vsv

>s ],

9

Page 10: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

by (13). Also by (12), we have (1 +∑tτ=s

1(τ+1)2 −

2s+1 ) ≤ 1 + 1

s −1t+1 −

2s+1 ≤ 1,

so we have

t∑τ=1

vτ v>τ

t∑s=1

vsv>s +

t∑s=1

∑r<s

(1

s2+

1

t

)[vrv

>r + vsv

>s ]

3

t∑s=1

vsv>s +

t∑s=1

(1

s2+

1

t

)∑r<s

vrv>r

3

t∑s=1

vsv>s +

t∑s=1

vsv>s

t∑r=s+1

(1

r2+

1

t

)

3

t∑s=1

vsv>s +

t∑s=1

(1 +

1

s

)vsv>s

5

t∑s=1

vsv>s .

Let At = I + b∑τ vτ v

>τ . Note that the inequality above shows that At 5At. Thus,

using Lemma 3, we get

∑t

‖vt‖2A−1t

=∑t

vtA−1t vt ≤

5

b

∑t

[√bvt]>A−1

t [√bvt] ≤

5

blog

[|AT ||A0|

]. (14)

To bound the latter quantity note that |A0| = |I| = 1, and that

|AT | = |I + b∑t

vtv>t | ≤ (1 + b

∑t

‖vt‖22)n = (1 + bQ)n

where Q =∑t ‖vt‖2 =

∑t ‖vt − µt‖2. Lemma 6, shows that Q ≤ Q + R2. This

implies that |AT | ≤ (1 + bQ + bR2)n and the proof is completed by substituting thisbound into (14).

Lemma 5. ρ(v1, . . . , vT ) ≤ 4R[log(1 +Q/R2) + 2].

Proof. Define, for τ = 0, 1, 2, . . . , T , the vector uτ = vτ − µ, where µ = 1T

∑Tt=1 vt.

Let v0 = 0 and u0 = −µ. We have

T∑t=1

‖ut‖2 =

T∑t=1

‖vt − µ‖2 = Q.

10

Page 11: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

We have

‖µt+1 − µt‖ =

∥∥∥∥∥ 1

t+ 2

t+1∑τ=0

vτ −1

t+ 1

t∑τ=0

∥∥∥∥∥=

∥∥∥∥∥ 1

t+ 2

t+1∑τ=0

uτ −1

t+ 1

t∑τ=0

∥∥∥∥∥≤ 1

(t+ 1)2

t∑τ=0

‖uτ‖+1

t+ 1‖ut+1‖.

Summing up over all iterations,

ρ =

T−1∑t=1

‖µt+1 − µt‖ ≤T−1∑t=1

(1

(t+ 1)2

t∑τ=0

‖uτ‖+1

t+ 1‖ut+1‖

)

≤ ‖u0‖ ·T−1∑t=1

1

(t+ 1)2+

T∑t=1

‖ut‖ ·

(1

t+

T−1∑τ=t

1

(τ + 1)2

)

≤ ‖u0‖+

T∑t=1

2

t‖ut‖

≤ 4R[log(1 +Q/R2) + 2].

The second inequality follows because∑∞τ=t

1(τ+1)2 ≤

∫∞x=t

1x2 dx = 1

t . The lastinequality uses the following facts:

1. Since v0 = 0, u0 = −µ, and hence ‖u0‖ = ‖µ‖ ≤ R since for all t, ‖vt‖ ≤ R.

2. Note ‖ut‖ = ‖vt − µ‖ ≤ ‖vt‖ + ‖µ‖ ≤ 2R. Applying Lemma 7 belowwith xt = ‖ut‖/2R for t = 1, 2, . . . , T , and using the fact that

∑Tt=1 x

2t =∑T

t=1 ‖ut‖2/4R2 ≤ Q/R2, we get that

T∑t=1

2

t‖ut‖ ≤ 4R(log(1 +Q/R2) + 1).

Lemma 6. Q ≤ Q+R2.

Proof. Consider the Be-The-Leader (BTL) algorithm played on the sequence of costfunctions ct(x) = ‖vt − x‖2, for t = 0, 1, 2, . . . , T , with v0 = 0, when the convexdomain is the ball of radius R. The BTL algorithm is as follows. On round t, thisalgorithm chooses the point that minimizes

∑tτ=0 ct(x) over the domain. It is easy

to see that this point is exactly 1t+1

∑tτ=0 vt = µt. Thus, the cost of the algorithm is∑t

τ=0 ‖vt−µt‖2 = Q, since µ0 = v0 = 0, and the first period cost is thus 0. The bestfixed point in hindsight is µT . Thus, the cost of the best fixed point in hindsight, µT ,is∑tτ=0 ‖vt − µT ‖2 = Q+ ‖µT ‖2. Kalai and Vempala [KV05] prove that the BTL

algorithm incurs 0 regret, i.e. Q ≤ Q+ ‖µT ‖2 ≤ Q+R2.

11

Page 12: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

Lemma 7. Suppose that 0 ≤ xt ≤ 1 and∑t x

2t ≤ Q. Then

T∑t=1

xtt≤ log(1 +Q) + 1.

Proof. By the Lemma 8 below, the values of xt that maximize∑Tt=1 xt/t must have

the following structure: there is a k such that for all t ≤ k, we have xt = 1, and for anyindex t > k, we have xk+1/xt ≥ (1/k)/(1/t), which implies that xt ≤ k/t. We firstnote that k ≤ Q, since Q ≥

∑kt=1 x

2t = k. Now, we can bound the value as follows:

T∑t=1

xtt≤

k∑t=1

1

t+

T∑t=k+1

k

t2

≤ log(k + 1) + k · 1

k= log(1 +Q) + 1.

Lemma 8. Let a1 ≥ a2 ≥ . . . an > 0. Then the optimal solution of

max

∑i

aixi : 0 ≤ xi ≤ 1 and∑i

x2i ≤ Q

has the following properties: x1 ≥ x2 ≥ . . . xn, and for any pair of indices i, j, withi < j, either xi = 1, xi = 0 or xi/xj ≥ ai/aj .

Proof. The fact that in the optimal solution x1 ≥ x2 ≥ . . . xn is obvious, since other-wise we could permute the xi’s to be in decreasing order and increase the value.

The second fact follows by the Karush-Kuhn-Tucker (KKT) optimality conditions,which imply the existence of constants µ, λ1, ..., λn, ρ1, ..., ρn for which the optimalvector x satisfies (here ei is the ith standard basis vector, and a = (a1, a2, . . . , an)):

−a+ 2µx+∑i

(λi + ρi)ei = 0

By KKT theory, complementary slackness implies that the constants λi, ρi are equal tozero for all indices of the solution which satisfy xi /∈ 0, 1. For these coordinates, theKKT equation is

ai − 2µxi = 0,

which implies the lemma.

3 Implications in the Geometric Brownian Motion ModelWe begin with a brief description of the model. The model assumes that stocks canbe traded continuously, and that at any time, the fractional change in the stock price

12

Page 13: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

within an infinitesimal time interval is normally distributed, with mean and varianceproportional to the length of the interval. The randomness is due to many infinitesimaltrades that jar the price, much like particles in a physical medium are jarred about byother particles, leading to the classical Brownian motion.

Formally, the model is parameterized by two quantities, the drift µ, which is thelong term trend of the stock prices, and volatility σ, which characterizes deviationsfrom the long term trend. The parameter σ is typically specified as annualized volatil-ity, i.e. the standard deviation of the stock’s logarithmic returns in one year. Thus, atrading interval of [0, 1] specifies 1 year. The model postulates that the stock price attime t, St, follows a geometric Brownian motion with drift µ and volatility σ:

dSt = µStdt+ σStdWt,

where Wt is a continuous-time stochastic process known as the Wiener process orsimply Brownian motion. The Wiener process is characterized by three facts:

1. W0 = 0,2. Wt is almost surely continuous, and3. for any two disjoint time intervals [s1, t1] and [s2, t2], the random variablesWt1 −Ws1 and Wt2 −Ws2 are independent zero mean Gaussian random vari-ables with variance t1 − s1 and t2 − s2 respectively.

Using Ito’s lemma (see, for example, [KS04]), it can be shown that the stock price attime t is given by

St = S0 exp((µ− σ2/2)t+ σWt). (15)

Now, we consider a situation where we have n stocks in the GBM model. Letµ = (µ1, µ2, . . . , µn) be the vector of drifts, and σ = (σ1, σ2, . . . , σn) be the vectorof (annualized) volatilities. Suppose we trade for one year. We now study the effect oftrading frequency on the quadratic variation of the stock price returns. For this, assumethat the year-long trading interval is sub-divided into T equally sized intervals of length1/T , and we trade at the end of each such interval. Let rt = (rt(1), rt(2), . . . , rt(n))be the vector of stock returns in the tth trading period. We assume that T is “largeenough”, which is taken to mean that it is larger than µ(i), σ(i), (µ(i)

σ(i) )2 for any i.Then using the facts of the Wiener process stated above, we can prove the following

lemma, which shows that the expected quadratic variation is the essentially the sameregardless of trading frequency, while its variance decreases with trading frequency.

Lemma 9. In the setup of trading n stocks in the GBM model over one year with Ttrading periods, where T µ(i), σ(i) , ∀i, there is a vector v such that

E[∑T

t=1 ‖rt − v‖2]≤ ‖σ‖2(1 +O( 1

T ))

and

VAR[∑T

t=1 ‖rt − v‖2]≤ 3‖σ‖4

T(1 +O( 1

T )),

regardless of how the stocks are correlated.

13

Page 14: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

Proof. For every stock i, it follows from the GBM equation for the stock prices (St =S0 exp((µ− σ2/2)t+ σWt) ) that its return rt(i) in period t is given by

rt(i) = exp

((µ(i)− σ(i)2

2

)1

T+ σ(i)Xt(i)

),

whereXt(i) ∼ N (0, 1T ). Thus, for any given stock i, the returns r1(i), r2(i), . . . , rT (i)

are i.i.d. log-normal random variables, with parameters:

rt(i) ∼ lnN(µ(i)

T− σ(i)2

2T,σ(i)2

T

)Recall that for a log-normal random variable X ∼ lnN (µ, σ2) the mean and varianceare given by E[X] = eµ+σ2/2 and VAR[X] = (eσ

2 − 1)e2µ+σ2

.Define the vector v as v(i) = E[rt(i)] = eµ(i)/T . Then, assuming that T > µ(i), σ(i),we have using the exponential approximation ex ≤ 1 + x+ x2 for −1 ≤ x ≤ 1:

E[(rt(i)− v(i))

2]

= VAR(rt(i)) = (eσ(i)2/T − 1)e2µ(i)/T

≤ (σ(i)2

T+O(

1

T 2)) · e2µ(i)/T

≤ σ(i)2

T

(1 +O

(1T

))Where the last equality uses the Taylor approximation of the exponential and the factthat 2µ(i)

T 1.Summing up over all stocks i and all periods t, and using linearity of expectation,

we get the first part of the Lemma:

E[∑T

t=1 ‖rt − v‖2]

=

T∑t=1

n∑i=1

E[(rt(i)− v(i))2] ≤ ‖σ‖2(1 +O( 1T ))

As for the bound on the variance, we first bound the quantity E[(rt(i) − v(i))4] ,using the fact that if X ∼ lnN (µ, σ2), then Xa ∼ lnN (aµ, a2σ2). We denote µ =µ(i)T −

σ(i)2

2T , σ2 = σ(i)2

T .

E[(rt(i)− v(i))4] = E[rt(i)4 − 4rt(i)

3v(i) + 6rt(i)2v(i)2 − 4rt(i)v(i)3 + v(i)4]

= e4µ+8σ2

− 4e3µ+ 92 σ

2

eµ+σ2/2 + 6e2µ+2σ2

e2µ+σ2

− 4eµ+σ2/2e3µ+ 32 σ

2

+ e4µ+2σ2

= e4µ+8σ2

− 4e4µ+5σ2

+ 6e4µ+3σ2

− 4e4µ+2σ2

+ e4µ+2σ2

= e4µ(e8σ2

− 4e5σ2

+ 6e3σ2

− 3e2σ2

)

= (eσ2

− 1)2e4µ(e6σ2

+ 2e5σ2

+ 3e4σ2

− 3e2σ2

)

≤ (σ(i)4

T 2+O(

1

T 3)) · e4µ(e6σ2

+ 2e5σ2

+ 3e4σ2

− 3e2σ2

)

=σ(i)4

T 2(3 +O( 1

T )) =3σ(i)4

T 2(1 +O( 1

T ))

14

Page 15: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

Above the fifth equality follows from the polynomial factorization:

x8 − 4x5 + 6x3 − 3x2 = (x− 1)2(x6 + 2x5 + 3x4 − 3x2)

Thus for all stocks i and time periods t, we have:

VAR[(rt(i)− v(i))2

]≤ E[(rt(i)− v(i))4] ≤ 3σ(i)4

T 2(1 +O( 1

T )) (16)

Now, we use the following inequality which follows from the Cauchy-Schwarzinequality: for any random variables X1, X2, . . . , Xn:

VAR[∑ni=1Xi] ≤ (

∑ni=1

√VAR[Xi])

2.

Hence, using inequality (16), we get:

VAR[‖rt − v‖2] ≤ (∑ni=1

√VAR[(rt(i)− v(i))2])2 ≤ 3‖σ‖4

T 2(1 +O( 1

T ))

Finally, using the fact that in the GBM model, the returns are independent betweenperiods we get

VAR

[T∑t=1

‖rt − v‖2]≤ 3‖σ‖4

T(1 +O( 1

T )).

Applying this bound in our algorithm, we obtain the following regret bound fromCorollary 2.

Theorem 10. In the setup of Lemma 9, for any δ > 0, with probability at least 1 − δ,we have

Regret = O(n log((1 + 3√δT

)‖σ‖2 + n)).

Proof. First, we show that the market variability parameter, r, is Ω(1) with high prob-ability. Fix any stock i. The return rt(i) for stock i at time period t is a log-normalrandom variable: rt(i) = exp(Nt(i)) where Nt(i) ∼ N ((µ(i) − σ(i)2

2 ) 1T ,

σ(i)2

T ).Using standard tail bounds for normal variables (which is given in Lemma 14 in theAppendix for completeness), we have

Pr

[∣∣∣∣Nt(i)− (µ(i)− σ(i)2

2)

1

T

∣∣∣∣ > σ(i)√T

√2 log(2nT/δ)

]< e− log(2nT/δ) =

δ

2nT.

Thus, assuming T µ(i), σ(i), with probability at least 1− δ2nT , we have

|Nt(i)| = O(σ(i)√T

√log(nT/δ)).

Since rt(i) = exp(Nt(i)), we conclude that with probability at least 1− δ2nT , we have

|rt(i)− 1| = O(σ(i)√T

√log(nT/δ)).

15

Page 16: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

Applying a union bound over all stocks and all periods, we conclude that with probabil-ity at least 1− δ2 , the market variability parameter r is at least 1−O( σ√

T

√log(nT/δ)) >

0.5, if T > Ω(σ2 log(nT/δ)).Now we bound the total variation. Applying Chebyshev’s inequality to the random

variable∑Tt=1 ‖rt − v‖

2 and using Lemma 9, we have

Pr[∑T

t=1 ‖rt − v‖2> (1 + 3√

δT)‖σ‖2

]<

3‖σ‖4T (1 +O( 1

T ))9‖σ‖4δT

2.

The result now follows by a union bound applied to our regret bound of Corollary 2.

Theorem 10 shows that one expects to achieve constant regret independent of thetrading frequency, as long as the total trading period is fixed. This result is only usefulif increasing trading frequency improves the performance of the best constant rebal-anced portfolio. Indeed, this has been observed empirically (see e.g. [AHKS06] andSection 5).

To obtain a theoretical justification for increasing trading frequency, we consider anexample where we have two stocks that follow independent Black-Scholes models withthe same drifts, but different volatilities σ1, σ2. The same drift assumption is necessarybecause in the long run, the best CRP is the one that puts all its wealth on the stockwith the greater drift. We normalize the drifts to be equal to 0, this doesn’t change theperformance in any qualitative manner.

Since the drift is 0, the expected return of either stock in any trading period is 1; andsince the returns in each period are independent, the expected final change in wealth,which is the product of the returns, is also 1. Thus, in expectation, any CRP (indeed,any portfolio selection strategy) has overall return 1. We therefore turn to a differentcriterion for selecting a CRP. The risk of an investment strategy is measured by thevariance of its payoff; thus, if different investment strategies have the same expectedpayoff, then the one to choose is the one with minimum variance. We therefore choosethe CRP with the least variance.

Lemma 11. In the setup where we trade two stocks with zero drift and volatilitiesσ1, σ2, the variance of the minimum variance CRP decreases as the trading frequencyincreases.

Proof. To compute the minimum variance CRP, we first compute the variance of theCRP (p, 1− p):

VAR

[∏t

(prt(1) + (1− p)rt(2))

]= E

[∏t

(prt(1) + (1− p)rt(2))2

]− 1

=∏t

E[(prt(1) + (1− p)rt(2))2]− 1.

The second equality above follows from the independence of the randomness in eachperiod. Thus, the minimum variance CRP is obtained by minimizing E[(prt(1) + (1−

16

Page 17: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

p)rt(2))2] over the range p ∈ [0, 1]. We now note that in the Black-Scholes model,rt(1) = eX1 where X1 ∼ N (− σ2

1

2T ,σ21

T ), and rt(2) = eX2 where X2 ∼ N (− σ22

2T ,σ22

T ),and thus

E[(prt(1) + (1− p)rt(2))2]

= E[p2e2X1 + 2p(1− p)eX1+X2 + (1− p)2e2X2 ]

= p2eσ21T + 2p(1− p) + (1− p)2e

σ22T .

This is minimized at p =exp(

σ22T )−1

exp(σ21T )+exp(

σ22T )−2

, and at this point, its value is exp(σ21+σ22T )−1

exp(σ21T )+exp(

σ22T )−2

.

Thus, the variance of the final payoff becomes[exp(

σ21+σ2

2

T )− 1

exp(σ21

T ) + exp(σ22

T )− 2

]T− 1.

This is a decreasing function of T . To prove this, by direct computation we have

d

dT

[ exp(σ21+σ2

2

T )− 1

exp(σ21

T ) + exp(σ22

T )− 2

]T− 1

=

[exp(

σ21+σ2

2

T )− 1

exp(σ21

T ) + exp(σ22

T )− 2

]T· log

[exp(

σ21+σ2

2

T )− 1

exp(σ21

T ) + exp(σ22

T )− 2

]

×−(exp(

σ21

T )− 1)2 exp(σ22

T )σ22

T 2 − (exp(σ22

T )− 1)2 exp(σ21

T )σ21

T 2

(exp(σ21

T ) + exp(σ22

T )− 2)2

< 0.

The inequality above uses the fact that exp(σ21+σ2

2

T ) − 1 > exp(σ21

T ) + exp(σ22

T ) − 2which can be verified by using the power series expansion of exp(x).

Thus, increasing the trading frequency decreases the variance of the minimum vari-ance CRP, which implies that it gets less risky to trade more frequently; in other words,the more frequently we trade, the more likely the payoff will be close to the expectedvalue. On the other hand, as we show in Theorem 10, the regret does not change even ifwe trade more often; thus, one expects to see improving performance of our algorithmas the trading frequency increases.

4 Faster ImplementationIn this section we describe a more efficient algorithm compared to the one from themain body of the paper. The regret bound deteriorates slightly, though it is still loga-rithmic in the total quadratic variation. The algorithm is based on the online Newton

17

Page 18: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

method, introduced in [HAK07], and is described in the following figure. For simplic-ity, we focus on the portfolio management problem, although it is likely that similarideas can work for general loss functions of the type we consider in this paper.

Algorithm 1 Faster quadratic-variation universal algorithmfor t = 1 to T do

Use xt , arg minx∈∆n

(∑t−1τ=1 fτ (x) + 1

2‖x‖2)

.Receive return vector rt.Let ft(x) = − log(rt · xt)− rt·(x−xt)

(rt·xt) + r(rt·(x−xt))28(rt·xt)2 .

end for

The basic idea is to bound the cost functions by a paraboloid approximation in theFTRL algorithm. The paraboloid approximation only increases the regret, but since itis a simple quadratic function, the running time of the the FTRL algorithm is improvedgreatly. All we need to do is optimize the sum of quadratic cost functions, which hasa compact representation (unlike the sum of log functions), over the n-dimensionalsimplex. This optimization can be carried out in time O(n3.5) using interior pointmethods (assuming real number operations can be carried out in O(1) time). Usingobservations made in [HAK07] it is possible to further speed up the algorithm andattain a running time proportional to O(n3).

We have the following regret bound for the algorithm:

Theorem 12. For the portfolio selection problem, the regret of algorithm 1 is boundedby

Regret = O( nr3

log(Q+ n)).

Proof. We first describe the paraboloid approximation to the cost functions that weuse in the algorithm instead of actual cost functions. This approximation, based on amore general lemma from [HAK07], has the following property, for all x and y in thesimplex and any return vector v with coordinates in [r, 1]:

− log(v · x) ≥ − log(v · y)− v · (x− y)

(v · y)+r(v · (x− y))2

8(v · y)2.

Thus for any t, ft(xt) = − log(rt ·xt), and for any x ∈ ∆n, ft(x) ≤ − log(rt ·x).Thus, if x∗ is the best CRP in hindsight, we have the following bound on the regret ofalgorithm 1:

Regret =∑t

− log(rt · xt)−∑t

− log(rt · x∗)

≤∑t

ft(xt)−∑t

ft(x∗).

The RHS above is bounded by the regret of the algorithm 1 assuming that the costfunctions are ft. We therefore proceed to bound this regret. of the algorithm with costfunctions ft.

18

Page 19: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

The cost functions ft can be written in terms of the univariate functions

gt(y) =r

8(rt · xt)2· y2 − 1

rt · xt

(1 +

r

4

)· y +

r

8+ 1− log(rt · xt)

as ft(x) = gt(rt·xt). Now we note that even though the statement of the main Theoremassumes that the cost functions can be written in terms of a single univariate function gfor all t, the proof of the theorem is flexible enough to handle different functions gt fordifferent t, as long as conditions 3. and 4. in the main Theorem on the first and secondderivatives of g hold uniformly with the same constants a and b for all functions gt.

Furthermore, the proof only requires the bound a on the magnitude of the firstderivatives at the points xt which the algorithm produces. Thus, we can now estimatethe a and b parameters for the gt functions as follows: g′t(rt ·xt) = − 1

(rt·xt) ∈ [− 1r , 0],

so we choose a = 1r . For any portfolio x ∈ ∆n, and g′′t (rt · x) = r

4(rt·x)2 ≥r4 ,

thus we choose b = r4 . The regret bound is now obtained via the bound of the main

theorem.

5 ExperimentsWe tested the performance of the best CRP and Algorithm Exp-Concave-FTL as wellas its regret on stock market data. The following graph in Figure 1 was generated usingreal NYSE quotes for the 1000 trading days from 2001 and 2005 obtained form Yahoo!finance. We randomly chose twenty S&P500 stocks, and computed the performance ofthe best CRP and Algorithm Exp-Concave-FTL on the relevant trading period, varyingthe trading frequency from daily to every 50 trading days (only integer periods whichdivide 1000 were tested). The regret, i.e difference between the log wealth of bothmethods is also depicted.

For various choices of stocks, the fact that the regret remains pretty much constantwas consistent, as predicted by the theoretical arguments in the paper.

The change in performance of the best CRP with respect to trading frequency wasnot conclusive, at times agreeing with theory and at times not. In one sense, how-ever, this change does agree with theory: in the previous work of [AHKS06], Figure6 depicts the performance of several online portfolio management as varies with thetrading period. These more comprehensive experiments, which measure the averageAPY (annual percentage yield) in an experiment of sampling a set of stocks from theS&P 500 (the average is taken over the different samples of random stocks from S&P500). These experiments clearly show that on an average, the performance of manyonline algorithms, as well as that of the best CRP, improves with trading frequency.

6 ConclusionsWe have presented an efficient algorithm for regret minimization with exp-concave lossfunctions whose regret strictly improves upon the state of the art. For the problem ofportfolio selection, the regret is bounded in terms of the observed variation in stockreturns rather than the number of iterations. This is the first theoretical improvement

19

Page 20: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

5 10 15 20 25 30 35 40 45 500

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

BCRPAlgorithm 1regret

Figure 1: Best CRP and Algorithm Exp-Concave-FTL vs. Trading Period. The x-axisdenotes the trading period in days, and the y-axis is the log-wealth factor (i.e. a realnumber).

in regret bounds for universal portfolio selection algorithms since the work of Cover[Cov91].

We show how this fact implies that in the standard Geometric Brownian Motionmodel for stock prices the regret does not increase with trading frequency, hence givingthe first universal portfolio selection algorithm whose performance improves when theunderlying assets are close to GBM. This serves as a bridge between universal portfoliotheory and stochastic portfolio theory.

Open questions: It remains an intriguing open question to improve the dependenceof the regret in portfolio selection in terms of other important parameters aside fromthe quadratic variability: our dependence on the number of stocks in the portfolio (pre-viously denoted n) is linear. In contrast [HSSW96] obtain a logarithmic dependencein this parameter. Our regret bounds also depend on the market variability parameter(denoted r), whereas Cover’s original algorithm does not have this dependence at all.Is it possible to obtain aO(logQ) regert bound, via an efficient algorithm, that behavesbetter with respect to n, r?

References[AHKS06] Amit Agarwal, Elad Hazan, Satyen Kale, and Robert E. Schapire. Algo-

rithms for portfolio management based on the newton method. In Pro-ceedings of the 23rd international conference on Machine learning, ICML’06, pages 9–16, New York, NY, USA, 2006. ACM.

[Bac00] Louis Bachelier. Theorie de la speculation. Annales Scientifiques del’Ecole Normale Superieure, 3(17):21–86, 1900.

20

Page 21: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

[BK99] Avrim Blum and Adam Kalai. Universal portfolios with and without trans-action costs. Machine Learning, 35(3):193–205, 1999.

[BS73] Fischer Black and Myron Scholes. The pricing of options and corporateliabilities. Journal of Political Economy, 81(3):637–654, 1973.

[BV04] Stephen Boyd and Lieven Vandenberghe. Convex Optimization. Cam-bridge University Press, New York, NY, USA, 2004.

[CB03] Jason E Cross and Andrew R Barron. Efficient universal portfolios for pastdependent target classes. Mathematical Finance, 13(2):245–276, 2003.

[CBMS07] Nicolo Cesa-Bianchi, Yishay Mansour, and Gilles Stoltz. Improvedsecond-order bounds for prediction with expert advice. Machine Learn-ing, 66(2-3):321–352, 2007.

[Cov91] Thomas Cover. Universal portfolios. Mathematical Finance, 1:1–19,1991.

[HAK07] Elad Hazan, Amit Agarwal, and Satyen Kale. Logarithmic regret algo-rithms for online convex optimization. Mach. Learn., 69(2-3):169–192,December 2007.

[HK09] Elad Hazan and Satyen Kale. On stochastic and worst-case models forinvesting. In Y. Bengio, D. Schuurmans, J. Lafferty, C. K. I. Williams, andA. Culotta, editors, Advances in Neural Information Processing Systems22, pages 709–717. 2009.

[HK10] Elad Hazan and Satyen Kale. Extracting certainty from uncertainty: regretbounded by variation in costs. Machine Learning, 80:165–188, 2010.

[HK11] Elad Hazan and Satyen Kale. Better algorithms for benign bandits. Journalof Machine Learning Research, 12:1287–1311, 2011.

[HSSW96] David P. Helmbold, Robert E. Schapire, Yoram Singer, and Manfred K.Warmuth. On-line portfolio selection using multiplicative updates. InICML, pages 243–251, 1996.

[Jam92] Farshid Jamshidian. Asymptotically optimal portfolios. Mathematical Fi-nance, 2:131–150, 1992.

[KS04] Ioannis Karatzas and Steven E. Shreve. Brownian Motion and StochasticCalculus. Springer Verlag, New York, NY, USA, 2004.

[KV03] Adam Kalai and Santosh Vempala. Efficient algorithms for universal port-folios. Journal of Machine Learning Research, 3:423–440, 2003.

[KV05] Adam Kalai and Santosh Vempala. Efficient algorithms for online deci-sion problems. Journal of Computer and System Sciences, 71(3):291–307,2005.

21

Page 22: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

[MF93] Neri Merhav and Meir Feder. Universal schemes for sequential decisionfrom individual data sequences. IEEE Transactions on Information The-ory, 39:1280–1292, 1993.

[Osb59] M. F. M. Osborne. Brownian motion in the stock market. OperationsResearch, 2:145–173, 1959.

[Zin03] Martin Zinkevich. Online convex programming and generalized infinites-imal gradient ascent. In Tom Fawcett and Nina Mishra, editors, ICML,pages 928–936. AAAI Press, 2003.

A Proof of the Vector Harmonic Series LemmaThe proof is based on the following fact, whose one-dimensional analogue is an easyconsequence of the Taylor expansion of the logarithm.

Lemma 13. Let A B 0 be positive definite matrices. Then

A−1 • (A−B) ≤ log|A||B|

where |A| denotes the determinant of matrix A.

Proof. For any positive definite matrix C, denote by λ1(C), λ2(C), . . . , λn(C) its(positive) eigenvalues. Denote by Tr(C) the trace of the matrix, which is equal tothe sum of the diagonal entries of C, and also to the sum of its eigenvalues.

Note that for the matrix product A • B =∑ni,j=1AijBij defined earlier, we have

A •B = Tr(AB) (where AB is the standard matrix multiplication), since the trace is

22

Page 23: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

equal to the sum of the diagonal entries. Therefore,

A−1 • (A−B) = Tr(A−1(A−B))

= Tr(A−1/2(A−B)A−1/2)

= Tr(I −A−1/2BA−1/2)

=

n∑i=1

[1− λi(A−1/2BA−1/2)

](∵ Tr(C) =

n∑i=1

λi(C))

≤ −n∑i=1

log[λi(A

−1/2BA−1/2)]

(∵ 1− x ≤ − log(x))

= − log

[n∏i=1

λi(A−1/2BA−1/2)

]= − log |A−1/2BA−1/2|

= log

[|A||B|

].

In the last equality we use the following facts about the determinant of matrices: |A| =∏ni=1 λi(A), |AB| = |A||B| and |A−1| = 1

|A| .

We can now prove the vector harmonic series Lemma 3 :Lemma 3.

T∑t=1

v>t (A+∑tτ=1vτv

>τ )−1vt ≤ log

[|A+

∑Tτ=1 vτv

>τ |

|A|

].

Proof. Let At := A+∑tτ=1 vτv

>τ and denote A0 = A. Now by the lemma above

T∑t=1

vtA−1t vt =

∑t

A−1t • vtv>t

=∑t

A−1t • (At −At−1)

≤∑i

log|At||At−1|

= log

[|AT ||A0|

].

23

Page 24: An Online Portfolio Selection Algorithm with Regret ... · Online convex optimization. In the online convex optimization problem [Zin03], which generalizes universal portfolio management,

B Tail bounds for Normal random variablesThe following standard bound on the tail of the Normal distribution is given here forcompleteness.

Lemma 14. Let X ∼ N(µ, σ2), then

Pr[|X − µ| > x] ≤ σ

xexp

(− x2

2σ2

).

Proof. First, consider the case µ = 0, σ = 1. Then by definition

Pr[X > x] =

∫ ∞x

1√2π

exp(−t2/2) dt

Since the exponent is a convex function, we can upper bound it by the first derivativeat the point t = x and obtain:∫ ∞

x

1√2π

exp(−t2/2) dt ≤∫ ∞x

1√2π

exp(−x2/2− x(t− x)) dt

here the new exponent is the linearization of −t2/2 at t = x. Then pull out factorswhich don’t depend on t to get

exp(x2/2)√2π

∫ ∞x

exp(−xt) dt

and doing that last integral gives the bound:

Pr[X > x] ≤ 1√2πx

exp(−x2/2)

Hence, by symmetry of the distribution, we get for X ∼ N(0, 1):

Pr[|X| > x] ≤√

2√πx

exp(−x2/2) ≤ 1

xexp(−x2/2)

Next, consider Y ∼ N(µ, σ2) = µ+ σN(0, 1). Hence,

Pr[|Y − µ| > x] = Pr[|X| > x

σ

]≤ σ

xexp

(− x2

2σ2

).

24