Prelude
My topic is related to existing posts found here and here; although, my questions are different.
My post explains my objective and what has and has not worked for me.
I have met my objective and provided my solution.
My questions pertain to why the solution works in the hopes that I may apply my one-off solution here more readily to other instances.
Background
I am comparing two numbers that are products of multiple variables. My objective is to determine how much of the total change is attributable to each variable's change.
As a simple example, consider:
x1 = a1 * b1 = 10 * 10 = 100
x2 = a2 * b2 = 11 * 10 = 110
How much of the total difference (110 - 100 = 10) is attributable to the change in a and b?
My first approach was to use a binary (on/off) approach to determine what happens if each variables' change were the only change to occur. $$\Delta = \Delta a * b_1 + \Delta b * a_1$$ $$\Delta = (11 - 10) * 10 + (10 - 10) * 10$$ $$10 = 10 + 0$$
As shown, the change in "a" is responsible for 10 (100%) of the total change.
However, as additional variables are added and/or change, this appears to stop working.
Consider a more complicated example.
| Year | A | B | C | D | Total (A * B * C * D) |
|---|---|---|---|---|---|
| Y1 | 32 | 200 | 25 | 365 | 58,400,000 |
| Y2 | 33 | 215 | 28 | 360 | 71,517,600 |
| $\Delta$ | 1 | 15 | 3 | -5 | 13,117,600 |
If I use the previously described approach ($\Delta = \Delta A * B_1 * C_1 * D_1 + ...$), the sum of the individual effects does not equal the total change.
| A | B | C | D | Total Change (A+B+C+D) |
|---|---|---|---|---|
| 1,825,000 | 4,380,000 | 7,008,000 | -800,000 | 12,413,000 |
As shown, if A were the only variable to change, it would increase the value by 1.8 million, and so on. The sum total of isolated challenges in this method is approximately 12.4 million, which is less than the observed total of 13.1 million.
My next attempt tried the reverse. What would happen if each individual variable were the only variable not to change ($\Delta = \Delta A * B_2 * C_2 * D_2 + ...$)?
| A | B | C | D | Total Change (A+B+C+D) |
|---|---|---|---|---|
| 2,167,200 | 4,989,600 | 7,662,600 | -993,300 | 13,826,100 |
The sum total for this approach (approximately 13.8 million) is too great.
The true answer exists somewhere between these two methods. And through trial and error, I found a solution.
Solution
Let T be the total product for a given year, and $\Delta$ T be the total difference between Tyear 1 and Tyear 2.
Objective:
Total change is equal to the change caused by each variable.
$\Delta T = \Delta_A(T) + \Delta_B(T) + \Delta_C(T) + \Delta_D(T)$
Solution:
$\Delta_A(T) = (A_2 - A_1) * B_1 * C_2 * D_1$
$\Delta_B(T) = (B_2 - B_1) * A_2 * C_2 * D_1$
$\Delta_C(T) = (C_2 - C_1) * A_1 * B_1 * D_1$
$\Delta_D(T) = (D_2 - D_1) * A_2 * B_2 * C_2$
Check:
| A | B | C | D | Total Change (A+B+C+D) |
|---|---|---|---|---|
| 2,044,000 | 5,058,900 | 7,008,000 | -993,300 | 13,117,600 |
As shown, the sum total of effects for the variables is equal to $\Delta$ T. Objective [presumably] met.
The Questions
Notice in the solution that function differs for each variable.
The effect of $\Delta$ A is $\Delta$ A * the year 1 value for B and D, but year 2 value for C.
The effect of $\Delta$ B is $\Delta$ B * the year 1 value for D, but year 2 value for A and C.
The effect of $\Delta$ C is $\Delta$ C * the year 1 value for A, B and D.
The effect of $\Delta$ D is $\Delta$ D * the year 2 value for A, B and C.
The functions are specific to the variable. Year 1 variables are applied to $\Delta$ C, and year 2 variables are applied to $\Delta$ D, these are not interchangeable functions. If year 2 variables are applied to $\Delta$ C, and year 1 variables are applied to $\Delta$ D, the sum total no longer equals the observed change ($\Delta$ T).
Q1: Why does this work? Why do we reference different years for different variables?
Q2: Is there a way (other than trial and error) to determine the appropriate function (i.e., what would the function be for an added variable "E"?)
Q3: Does this solution actually isolate variables if they do not use a consistent approach? Is this really an accurate depiction of variables' effect on total change or just a coincidental / convenient distribution?
Thanks,
Andrew