Exercise 5.10 Derive the weighted-average update rule (5.8) from (5.7). Follow the pattern of the derivation of the unweighted rule (2.3)
According to:
V
n
≐
∑
k
=
1
n
−
1
W
k
G
k
∑
k
=
1
n
−
1
W
k
,
n
≥
2
(5.7)
V_{n} \doteq \frac{\sum_{k=1}^{n - 1}W_k G_k}{\sum_{k=1}^{n - 1}W_k} \text{,} \qquad n \geq 2 \qquad \text{(5.7)} \\
Vn≐∑k=1n−1Wk∑k=1n−1WkGk,n≥2(5.7)
and denote
C
n
C_n
Cn as the weights given to the first n returns. So formula (5.7) is transferred to:
V
n
≐
∑
k
=
1
n
−
1
W
k
G
k
C
n
−
1
,
n
≥
2
V_{n} \doteq \frac{\sum_{k=1}^{n - 1}W_k G_k}{C_{n-1}} \text{,} \qquad n \geq 2
Vn≐Cn−1∑k=1n−1WkGk,n≥2
then we have:
V
n
+
1
≐
∑
k
=
1
n
W
k
G
k
C
n
,
n
≥
1
V_{n+1} \doteq \frac{\sum_{k=1}^{n}W_k G_k}{C_n} \text{,} \qquad n \geq 1
Vn+1≐Cn∑k=1nWkGk,n≥1
∴
V
n
+
1
=
∑
k
=
1
n
−
1
W
k
G
k
C
n
+
W
n
G
n
C
n
=
C
n
−
1
C
n
V
n
+
W
n
G
n
C
n
=
(
1
−
W
n
C
n
)
V
n
+
W
n
G
n
C
n
=
V
n
+
W
n
C
n
(
G
n
−
V
n
)
,
n
≥
1
,
(5.8)
\begin{aligned} \therefore V_{n+1} &= \frac{\sum_{k=1}^{n - 1}W_k G_k}{C_n}+\frac{W_nG_n}{C_n}\\ &=\frac{C_{n-1}}{C_{n}} V_n +\frac{W_nG_n}{C_n} \\ &= (1 - \frac{W_n}{C_n})V_n + \frac{W_nG_n}{C_n} \\ &=V_n + \frac{W_n}{C_n}(G_n - V_n), \qquad n \geq 1, \qquad \text{(5.8)} \end{aligned}
∴Vn+1=Cn∑k=1n−1WkGk+CnWnGn=CnCn−1Vn+CnWnGn=(1−CnWn)Vn+CnWnGn=Vn+CnWn(Gn−Vn),n≥1,(5.8)
This derivation is very easy.