# How to calculate this partial derivative? given the function: v h </msub> =

How to calculate this partial derivative?
given the function:
${v}_{h}={\left[\sum _{i=1}^{N}{r}_{h,i}\cdot {w}_{h,i}-\frac{1}{T}\sum _{t=1}^{T}\sum _{i=1}^{N}{r}_{t,i}{w}_{t,i}\right]}^{2}$
I would like to compute the following:
$\frac{\mathrm{\partial }{v}_{h}}{\mathrm{\partial }{w}_{h}}=\phantom{\rule{thickmathspace}{0ex}}?$
$\frac{\mathrm{\partial }{v}_{h}}{\mathrm{\partial }{r}_{h}}=\phantom{\rule{thickmathspace}{0ex}}?$
$\frac{\mathrm{\partial }{v}_{h}}{\mathrm{\partial }{w}_{h}\mathrm{\partial }{r}_{h}}=\phantom{\rule{thickmathspace}{0ex}}?$
The problem for me is the double sum in the second term. Example of the function with $N=2$ and $T=2$ for $t=1$:
${v}_{1}={\left[\left({r}_{1,1}\cdot {w}_{1,1}+{r}_{1,2}\cdot {w}_{1,2}\right)-\frac{1}{2}\left({r}_{1,1}\cdot {w}_{1,1}+{r}_{1,2}\cdot {w}_{1,2}+{r}_{2,1}\cdot {w}_{2,1}+{r}_{2,2}\cdot {w}_{2,2}\right)\right]}^{2}$
You can still ask an expert for help

## Want to know more about Discrete math?

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

Zane Barry
Step 1
Let denote your function as ${v}_{t}={y}_{t}^{2}$ where
${y}_{t}={\mathbf{r}}_{t}:{\mathbf{w}}_{t}-\frac{1}{T}{\mathbf{r}}_{t}:{\mathbf{w}}_{t}+C$
Step 2
The colon operator denotes the inner product between vectors and C is a constant that does not depend on ${\mathbf{r}}_{t},{\mathbf{w}}_{t}$. It follows using chain rule that $\frac{\mathrm{\partial }{v}_{t}}{\mathrm{\partial }{\mathbf{w}}_{t}}=2{y}_{t}\left(1-\frac{1}{T}\right){\mathbf{r}}_{t}$.