0
$\begingroup$

I've stumbled upon this problem looking for something else and now it's bugging me. Suppose you have a weighted average of the form

$y = w_1 * x_1 + w_2 * x_2$

and derive the total derivative, which in my opinion should be

$dy = \frac{\partial y}{\partial w_1} dw_1 + \frac{\partial y}{\partial x_1} dx_1 + \frac{\partial y}{\partial w_2} dw_2 + \frac{\partial y}{x_2} dx_2$

which is equivalent to

$dy = x_1dw_1 + w_1dx_1 + x_2dw_2 + w_2dx_2$.

However, this does not seem to hold when I try it with numeric examples. Where's my mistake?

Thanks!

Edit: Example from comments:

In time period 1 let $x_1 = 2$, $x_2 = 3$, $w_1 = 0.3$, $w_2 = 0.7$, thus $y = 2.7$. In time period two let $x_1 = 3$, $x_2 = 1$, $w_1 = 0.4$ and $w_2 = 0.6$, thus $y = 1.8$. It follows that $-0.9 = x_1 * 0.1 + w_1 * 1 - x_2 * 0.1 - w_2 * 2$. Using the values from time period 2 the rhs gives $0.6$, using the values from time period 1 it gives $-1.2$. That's what's puzzling me.

$\endgroup$
  • $\begingroup$ Your opinion is wrong. The right form is $dy = x_1dw_1 + w_1dx_1 + x_2dw_2 + w_2dx_2$ and it will hold all numerical examples. $\endgroup$ – Satish Ramanathan Dec 16 '17 at 14:20
  • $\begingroup$ I cannot really see a difference in the form you proposed vs. the form I proposed. Consider the following example: In time period 1 let $x_1 = 2$, $x_2 = 3$, $w_1 = 0.3$, $w_2 = 0.7$, thus $y = 2.7$. In time period two let $x_1 = 3$, $x_2 = 1$, $w_1 = 0.4$ and $w_2 = 0.6$, thus $y = 1.8$. It follows that $-0.9 = x_1 * 0.1 + w_1 * 1 - x_2 * 0.1 - w_2 * 2$. Using the values from time period 2 the rhs gives $0.6$, using the values from time period 1 it gives $-1.2$. That's what's puzzling me. $\endgroup$ – Mr. Zen Dec 16 '17 at 14:37
0
$\begingroup$

The formula that you calculate using derivatives gives you the instantaneous change at a certain time. When you calculate with difference of $y$, you get the average change. Also note that $x_1,x_2,w_1,w_2$ might not change linearly, so $d_x1=x_1(t_2)-x_1(t_1)$ is just an approximation. Same for the other variables. You need to get more information about how your variables behave. Are you trying to solve a differential equation?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.