Lecture 11: Perceptron and Universal Portfolio...

4
Lecture : Perceptron and Universal Portfolio Selection EECS: Prediction and Learning: It’s Only a Game Fall Lecture : Perceptron and Universal Portfolio Selection Prof. Jacob Abernethy Scribe: Monica Eboli Announcements • Class on / in DOW :-: Perceptron Sequence of (x 1 ,y 1 ), ..., (x T ,t T ) R d .{-1, 1} Assume unknown w * R d such that t we have the margin assumption: w * · x t y t 1 (.) ||w * || ≤ 1 γ (.) Perceptron Algorithm: w 1 = - 0 R d (.) for t=,...,T ( if w t · x t y t > 0 w t+1 = w t o.w. w t+1 = w t + y t x t Then: number of mistakes of perceptron 1 γ 2 assuming ||x t || 2 1 Proof: Use potential function: Φ t = -||w t - w * || 2 (.) ( If no mistake at t, Φ t+1 = Φ t Otherwise, Φ t+1 - Φ t = ||w t - w * || 2 - ||w t+1 - w * || 2 =2y t w * · x t - 2y t w t · x t - ||y t x t || 2 1 T X t=1 Φ t+1 - Φ t = Φ T +1 - Φ 1 number of mistakes perceptron (.) Φ ( T +1 - Φ 1 ≤-Φ 1 = ||w * || 2 (.) Observations: ) Perceptron Gradient Descendant lossFunc l (w ;(x,y )) := max(0, -yw · x ) (.) l (w)= ( y, if (w · x)y 0 -yx , otherwise (.)

Transcript of Lecture 11: Perceptron and Universal Portfolio...

Page 1: Lecture 11: Perceptron and Universal Portfolio Selectionweb.eecs.umich.edu/.../fall2013/web/notes/lec11_100913.pdf · 2015. 8. 25. · Algorithm chooses portfolio wt2 non day t. Wt

Lecture : Perceptron and Universal Portfolio Selection

EECS: Prediction and Learning: It’s Only a Game Fall

Lecture : Perceptron and Universal Portfolio SelectionProf. Jacob Abernethy Scribe: Monica Eboli

Announcements

• Class on / in DOW :-:

Perceptron

Sequence of (x1, y1), ..., (xT , tT ) ∈ Rd .{−1,1} Assume ∃ unknown w∗ ∈ Rd such that ∀t we have themargin assumption:

w∗ · xt yt ≥ 1 (.)

||w∗|| ≤ 1γ

(.)

Perceptron Algorithm:w1 =

−→0 ∈Rd (.)

for t=,...,T {if wt · xt yt > 0→ wt+1 = wt

o.w. wt+1 = wt + ytxt

Then: number of mistakes of perceptron ≤ 1γ2 assuming ||xt ||2 ≤ 1

Proof: Use potential function:Φt = −||wt −w∗||2 (.){

If nomistake at t, Φt+1 = ΦtOtherwise, Φt+1 −Φt = ||wt −w∗||2 − ||wt+1 −w∗||2 = 2ytw∗ · xt − 2ytwt · xt − ||ytxt ||2 ≥ 1

T∑t=1

Φt+1 −Φt = ΦT+1 −Φ1 ≥ number of mistakes perceptron (.)

Φ(T + 1−Φ1 ≤ −Φ1 = ||w∗||2 (.)

Observations:

) Perceptron↔ Gradient Descendant

lossFunc l(w; (x,y)) :=max(0,−yw · x) (.)

∇l(w) ={y, if (w · x)y ≥ 0−yx, otherwise

(.)

Page 2: Lecture 11: Perceptron and Universal Portfolio Selectionweb.eecs.umich.edu/.../fall2013/web/notes/lec11_100913.pdf · 2015. 8. 25. · Algorithm chooses portfolio wt2 non day t. Wt

Lecture : Perceptron and Universal Portfolio Selection

) After T rounds, wT+1 correctly classifies all (xt , yt)? NO!

) Use perceptron to solve LPs (homework)

Universal Portfolio Selection

. Online Learning Scenarios

)Prediction with Experts )Online action / Game playing )Online Classification ) Universalportfolio selection↔ Online Convex Optimization

. Betting: Horses

Given odds r1, ...rm, if I invest q dollars in horse i and he wins I earn qri . Expect:∑ 1

ri≥ 1. If∑ 1

ri< 1 there is arbitrage, then, invest 1

riin horse i. For any outcome i, 1

riri = 1. Assume you now

the true probability of winner P ∈ ∆n.

argmaxq∈∆n

Ei∼P [qiri] = argmaxq

∑piriqi (.)

→ Put all money on one horse: i∗ = argmaxi

piri (.)

argmaxq∈∆n

Ei P [qiri] = argmaxq

∑pi log(riqi) (.)

argmaxq∈∆n

∑pi log(qi) + f (ri ,pi) (.)

argmaxq∈∆n

∑pi log(pi) +

∑pi log(

piqi

) (.)

argmaxq∈∆n

−H(p)−KL(p||q) (.)

= P (.)

. Portfolios and Stocks

N stocks, prices fluctuate, xt ∈ (0,∞)n

xti =P ricet+1(stock i)P ricet(stock i)

(.)

Algorithm chooses portfolio wt ∈ δn on day t. W ti = fraction of wealth in stock i. Multi growth

in weath on day t is wt · xt After T days, we define WealthT+1(w) = c∏Tt=1(w · xt) CRT=Constant

rebalanced portfolio: on each day, buy and sell stocks so that fraction of wealth of stock i is wi .

Page 3: Lecture 11: Perceptron and Universal Portfolio Selectionweb.eecs.umich.edu/.../fall2013/web/notes/lec11_100913.pdf · 2015. 8. 25. · Algorithm chooses portfolio wt2 non day t. Wt

Lecture : Perceptron and Universal Portfolio Selection

Table :Stock t= ... nMSFT / / ... AAPL / ... /

Question: Is best CRP single stock? NO In the end, AAPL and MSFT so the wealth (12 ,

12 ) =

(1.25)T

WealthT+1(w1,w2, ...,wT ) =T∏t=1

(w · xt) (.)

Want: Low regret to best CRP

maxw∗T∑t=1

log(w∗ · xt)−T∑t=1

log(wt · xt) (.)

I want this to be SMALL.

Algorithm: Universal

• For every w ∈ ∆n invest CRD infenitesinal amount of money in w.

• Rebalance money earned in CRD(w) within this portfolio.

• No sharing accross portfolios.

Wealtht+1(Universal) =∫w∈∆u

∏ts=1(wxs)V ol(∆n)

dµ (.)

V ol(∆n) =

√n+ 1

n!√

2n(.)

W ti,univ =

∫w∈∆n

wi∏ts=1(w · xS )dµ∫

Wealtht(w)dµ(.)

Analysis: Define Ballε(w):

Ballε(w) = {w′ ∈ ∆n : w′ = (1− ε)w+ εV f or any V ∈ ∆n} (.)

Claim : V ol(Ballε(w)) = V ol(∆n)εn−1 Claim :

w′ ∈ Ballε(w) (.)

wealthT+1(w′) = wealthT+1(w(1− ε) + εV ) ≥ (1− ε)Twealth(w) (.)

Observe:

wealth(universal) =1

V ol(∆n)

∫w∈∆n

wealthT+1(w)dµ (.)

≥ 1V ol(∆n)

∫w∈Ballε(w∗)

wealthT+1(w)dµ =1

V ol(∆n)

∫w∈Ballε(w∗)

(1− ε)TwealthT+1(w∗)dµ (.)

Page 4: Lecture 11: Perceptron and Universal Portfolio Selectionweb.eecs.umich.edu/.../fall2013/web/notes/lec11_100913.pdf · 2015. 8. 25. · Algorithm chooses portfolio wt2 non day t. Wt

Lecture : Perceptron and Universal Portfolio Selection

Figure : claim

=1

V ol(∆n)(1− ε)TwealthT+1(w∗)

∫w∈Ballε(w∗)

dµ (.)∫w∈Ballε(w∗)

dµ = V ol(Ballε(w∗)) (.)

1V ol(∆n)

(1− ε)TwealthT+1(w∗)∫w∈Ballε(w∗)

dµ = (1− ε)T εnwealthT+1(w∗) (.)

For ε = 1/T , = (1− 1T

)T1T

N

wealthT+1(w∗) (.)

log(wealth(w)) ≥ log(wealth(w∗))−NlogT +O(1) (.)