First we define the Lloyd Iteration: ### Lloyd Iteration 1. Given Cm={y1(m),…,yN(m)}, use the NN condition to form the optimal partition Ri(m)={x:d(x,yi(m))≤d(x,yjm), j=1,…,N} i=1,…,N(*) 2. Determine Cm+1={y1(m+1),…,yN(m+1)} using the centroid condition yi(m+1)=y∈Rargmin E[d(X,y)∣X∈Ri(m)], i=1,…,N Now we have enough to state the Lloyd-Max algorithm # Algorithm 1. Inputs: pdf f(x), initial codebook C1={y1(1),…,yN(1)}, threshold ϵ>0. Set m=1 and D1=E[d(X,Q(1)(X))]. 2. Given Cm, perform the Lloyd Iteration to get Cm+1 3. Compute Dm+1=E[d(X,Q(m+1)(X))] If DmDm−Dm+1<ϵthen output Cm+1 and stop. Otherwise m:=m+1 and go step 2.
- Lloyd iteration either reduces distortion or leaves it unchanged, i.e. it is non-increasing, and Dm converges to a limit as m→∞. Hence m→∞limDmDm−Dm+1=0
- It is not guaranteed Cm converges.
- If Cm converges it is not guaranteed that our “limit quantizer” will be optimal.