1. Introduction
This paper considers the finite change formula as an extension of the Lagrange mean value theorem to the multivariate version [
1,
2,
3,
4]. This formula is employed for finding a finite change in a function presented as the total of contributions from the increments of the variables. Such problems appear in various applications where the influences of the independent variables are investigated and their contributions to the increment of the outcome variable are estimated. For example, characteristics of growth and rates in economics can be described with the help of the decomposition of a change in the mean price caused by the varying partial prices and structure of volumes of multiple products. These problems are commonly considered in economics and social sciences via the so-called index analysis [
5,
6,
7,
8,
9], using rather heuristic formulae of Laspeyres, Paasche, Fisher and other indices [
10,
11,
12,
13,
14,
15]. A detail review of various index forms is given in [
16], and a description of the R software packages for index analysis can be found in [
17]. The line integral approach for decomposition of a function’s change due to alternation of its different variables was suggested by F. Divisia [
18] and developed by many authors [
19,
20,
21,
22,
23]. Variational analysis for finding a geodesic curve with integration by this trajectory is considered in [
24], the ideal index formulae are presented in [
25,
26], and application to the incremental analysis in nonlinear regression models is described in [
27].
In contrast to the line integration by continuous trajectories, the Lagrange mean value theorem in its multivariate version can be expressed as an equation of a finite change in the outcome dependent variable. After solving this equation with respect to an interior point, its value is employed for the estimation of the impact of the variables’ modification onto a transformation of their function. Consideration is performed on the example of weighted mean value function, which is one of the main characteristics in any statistical estimation. The solution for this function can be obtained in the closed form, useful in the analysis of the outcome decomposition by changes in the partial values and in the structure of the weighting, which can be particularly helpful in sensibility analysis. Numerical examples also include special cases of the so-called Simpson’s paradox [
28,
29,
30,
31,
32], in which each particular value increases but their mean value decreases, or vice versa—the particular values decline but their mean value grows. The suggested approach helps to interpret such results via data restructuring.
The paper is organized as follows:
Section 2 focuses on the Lagrange theorem for decomposition of finite change in the function due to finite increments of its variables,
Section 3 describes the application to the decomposition of the weighted mean value function (with
Appendix A),
Section 4 presents numerical illustrations, and
Section 5 summarizes the results.
2. Lagrange Mean Value Theorem and Finite Change Equation
Consider a continuous function
F(
x,
y, …,
z) of many real variables
x,
y, …,
z. Suppose all the variables are known in the initial
x0,
y0, …,
z0 and final
x1,
y1, …,
z1 moments in time (or it could be two compared states of a process, two compared objects, etc.), with the two corresponding function values and their difference
defined as follows:
The aim of the problem consists of decomposition of the increment
into a sum of items representing contributions of a change in each particular variable into the total change
in the function:
Such a decomposition (2) shows the relative impact of different variables in the function’s alternation. The changes in variables can be parameterized as follows:
where
. With the parameter
t changing on the closed interval [0, 1], the variable
x transforms from the initial
x0 to the final
x1 state, and similarly with all other variables.
For solving the problem of decomposition (2), the Lagrange mean value theorem can be applied. For one variable, this classic theorem can be formulated as follows: for a continuous differentiable function
F(
x), there exists a point
on the interval (
x0, x1) such that the tangent at this interior point
equals the slope of the segment between the endpoints, which can be written as
The relation (4) can be also rewritten as follows:
which states that the finite change in the function is defined by the derivative of the function in the interior point
multiplied by the finite change in the variable
x at its endpoints.
For multiple variables, the expression (5) can be generalized in the expression
in which
and
are the function’s derivatives by
x or
z, and similarly with the other variables. The variables are defined in the parametric form (3) as
x(
t), …,
z(
t), and the notations
, …,
are used for the derivatives by the parameter
t, so the relation (6) can be simplified to the so-called finite-change Formula (3) (Chapter 5), or the finite-increment Formula (4):
in which
is defined in (3), and similarly with other variables.
Likewise the Lagrange mean value theorem (5), the relation (7) states that for a given finite change of the function, there exists at least one point t = t* such that the total differential at the right-hand side (7) at this point equals this finite change in the left-hand side (7).
Each item in (7) corresponds to a change in the function due to the change in each one variable, which is directly related to the problem (2). For a given , the expression (7) can be considered as an equation of a finite change and solved with respect to the unknown interior point t*, whose value can then be used in the estimation of the contribution of each variable’s change in the transformation of their function (2).
3. Decomposition of Weighted Mean Value
Let us apply the described approach to the problem of decomposition of the mean value by the variables of influence. The arithmetic mean value
m in a general form of the weighted values of the variable
x is presented by the well-known formula
in which
xi are all
i-th observations (
i = 1, 2, …,
k, where
k is the total number of different observations) and
ni are the counts with which the values
xi are observed. If all
ni are equal, the weighted mean reduces to the simple arithmetic mean value.
Depending on a specific problem, the variables
x and
n can have various meanings. For example, in studies on consumer purchases,
xi and
ni could denote the prices and amounts in a set of
k products, and then the cost of each product is
xini, and the total cost divided by total amount in (8) defines the mean price of the product unit. For a clearer exposition of the results, let us use these connotations, but of course, the terms can differ for another problem. Keeping this in mind, let us consider a problem of change in the mean price (8) for the current period of time compared with a basic period of time (denoted by 1 and 0 subindices, respectively), when the mean price change can be presented as the difference:
The problem is similar to that formulated in the expression (2)—how can we decompose the total increment
(9) of the mean price into a sum of contributions from a change in each particular price
xi and amount
ni? For this aim, let us denote each variable change as
and with them, the changes in variables can be parameterized similarly to (3) as follows:
The parameter
t varies within the interval [0, 1], and accordingly, all variables (11) change the values from the initial to the final state. Depending on the problem, the variables
xi(
t) and
ni(
t) can be continuous or discrete numbers, but it is possible for approximate estimation to consider all of them as continuous variables. Then, the expression of finite change (7) for the mean value function (8) can be written as:
In (12), taking derivatives of
m (8) by all 2
k variables (11) yields:
To simplify notations, let us denote the total of amounts as follows:
Using (11) and (14), the relation (13) can be represented in explicit dependence on the parameter
t:
This expression presents the equation of finite change (7) for the function of mean value (8), and it is a rational quadratic form by the parameter t. For a given value of the function change (9), the Equation (15) can be solved for finding the internal point t*, with which the contributions from each variable change and in the total change (12) can be identified. The following result can be proved.
Theorem. The equation of finite change for the mean value function (15) has only one feasible root: With only one solution for the internal point
t* (16), the decomposition (2) for the mean value function (8) by the variables of impact is also unique. This point identifies the values in trajectories (11):
Let us consider the first quotient in (13), which defines the change
occurring due to the changes in the
x-variables. Using the second relation (17) in the first quotient (13) yields:
in which the weights
wi are defined as:
with their total equal to one:
It is useful to mention that both of the relations (A11) could be equal to zero only when by all i, which corresponds to the trivial case when only x-s vary, so the total change in the mean value is defined by the same Formula (18) with weights (19) reduced to the values . Thus, such a special case is also covered by the general solution (18)–(19).
The last two quotients (13) are related to the change in the mean value
because of the variations in the
n-variables, which can be presented as follows:
The last quotient in (21) is the mean value (8) taken in the internal point (16):
With (22), the total change
due to changes
(21) is defined as the weighted sum of the deviations of
from the mean
:
Using both relations (17), and also the equality
we can transform (23) to the expression:
It is the explicit form for the formulae (21) and (23), and it contains deviations of the changes in ni from the total change in N weighted by values wj (19). In a special case of the constant quantities by both periods of time, when by all i, the change in (25) equals zero, so a change in m can occur only due to a change in the x-variables (18). If for some quantities but the total quantity is constant, , then the last item in (25) disappears, and this expression becomes similar to the form (18). The compact expression (23) and the explicit Formula (25) are convenient for the interpretation and calculations as well.
Formulas (18) and (25) for an
i-th item from their totals identify an impact of the change in each particular
xi and
ni variables, which can be presented as
and the second one is
in which the weights
wj are defined in (19). The sum of the contributions (26) and (27) is:
Thus, the total of the
i-th contributions from the variables’ change equals the change in the
i-th component of the mean value (8). Summing the relation (28) by all
i-th contributions, yields the change in the mean value (9):
which proves that the obtained formulae for all inputs are correct. It is also useful to note that if one of contributions is already calculated, then to facilitate the calculations, the complementary one can be found as its difference from the mean’s change by the relation (28). For example, when we know
, then it is possible to estimate another contribution by the
i-th product as:
Summing (30) with respect to i yields a similar relation for the total values, which can be easily obtained from (30) by omitting the i-subindex.
In interpretation of the results, we should take into account the following features of the obtained formulae. Each i-th contribution into the total change (18) depends on the signs of , so a positive change increases the outcome , while a negative change diminishes the outcome. In contrast to it, an i-th contribution into the total change (25) because of the change , is more complicated: a positive contribution to the change in the mean value is given when , if the change is above the weighted total change . Similarly, for the opposite case , the contribution of the change to the change in the mean value is negative. This complicated impact of the quantities ni onto the mean value and its change (8)–(9) leads to the possibility of encountering the so-called Simpson’s paradox when the increased value in each item produces a decrease in their mean outcome, and vice versa, when a decrease in each item yields an unexpected increase in the mean value.
The described approach based on the Lagrange mean value theorem was demonstrated for decomposition of the mean value function. Actually, many functions can be transformed to the structure similar to the mean value. It especially concerns the statistical functions with summing by the data observations. For example, in the pair regression model
y = a + bz, the slope coefficient equals the quotient of the sample covariance to the variance of the predictor, which can be transformed to the following form:
in which
vi denotes the weights of squared deviations
in their total, and
bi denotes the partial slope coefficients in each
i-th observation. The obtained function (31) has a structure of the weighted mean value, and its change can be studied in the described approach. Another example of the functions of mean value structure can be found in the readability indices, in average number of elements per word or words per sentence [
33]. Changes in values of those functions can be investigated via decomposition by the factors of influence as well.
4. Numerical Examples
To illustrate the described approach in numerical estimations, let us consider a set of ten products sold at a market in two consecutive time periods. For example, it can be a car dealership with ten models of trucks. The prices and quantities of the basic period
x0 and
n0, and of the current period
x1 and
n1, are shown in the first columns of
Table 1, together with their total values given there in the last row. The total quantity diminishes from
N0 = 48 to
N1 = 37, so by
, and the internal point (16) value equals
t* = 0.532.
The next columns in
Table 1 contain the corresponding total costs divided by the total quantities,
x0in0i/
N0 and
x1in1i/
N1, which define the
i-th items and their total
m0 and
m1 in the mean prices (8)–(9) of each period. The changes in the
i-th prices and quantities (10) are given in the next two columns, and then the column
wi presents the weights (19)–(20). After this, the next two columns show the change in the mean price due to the changes (18) in the partial prices and due to the changes (25) in the quantities. The sum of these two columns in
Table 1 yields the last column of the total change in the mean price for each
i-th product (28) and by all of them in total (29), which equals:
Thus, the changes in the particular prices led to the increment
in the mean price, but restructuring according to the changes in the amounts
decreased the total mean price
. The change (32) in the mean price equals the difference (9) of the mean prices
m1 and
m0 in
Table 1.
Table 1 also demonstrates that the signs of difference in all
i-th contributions
coincide with the direction of changes in the partial prices
, as follows from the Formula (18). However, the signs of the contributions
and the signs of changes in the amounts
themselves, due to (25), can vary in different directions. For example, for the products with
i = 3, 5, the quantities grow,
, and the contribution to the mean price is positive,
; for the products with
i = 1, 8, 9, there is no change in quantities,
, but their impact onto the mean price is positive,
; for the rest of products with
i = 2, 4, 6, 7, 10, there is a reduction in quantities,
, and the input into the mean price is negative,
for the products
i = 2, 4, 10, but the input is positive,
, for the products
i = 6 and 7. Therefore, a redistribution of the amounts
n can yield various results depending on the structure of the weights and total amounts, as expressed in the Formula (25).
In
Table 1, all ten prices go up and the mean price also grows, which seems natural and is not surprising. However, the complex structure of the amounts
ni and their evolution
can influence the mean price so that it would change in the opposite direction, which produces the famous Simpson’s paradox. Let us consider it in the next example presented in
Table 2 organized similarly to the previous table.
The prices and quantities of the basic and current periods in
Table 2 seem to be very similar to those in
Table 1. The total quantity become
N0 = 62 in the basic and
N1 = 40 in the current periods, so the change is also negative,
, and the internal point (16) is
t* = 0.555. The price of each product increases, so all
, and all contributions to the change in the mean price are positive
as well. However, the total change in the mean price is negative, so it diminishes:
Similarly to the previous data results (32), the change in the mean price has the positive impact of changes in the prices and negative impact of changes in the amounts. However, with respect to the absolute value, there is a relation
in (32), while there is the opposite inequality
in (33). Thus, in spite of the increases in all the prices, the mean price decreases, which occurs because the negative changes in the amounts
overcome the positive impact
. By referring to
Table 2, we can identify which products give a negative impact: those with
i = 2, 3, 4, 8, 10, with contributions
. If to change places for the data of the basic and the current periods, the results in
Table 2 receive the opposite signs. It would correspond to another situation when a decrease in all prices produces the mean price growth. Such an ambiguity could distort an adequate understanding of the results presented in some statistical reports, which should be considered with attention and caution.
Let us also compare the newly developed technique based on the Lagrange mean theorem and one of the common techniques of the logarithmic decomposition of the total increment, described in [
24,
25] and also [
26] (Formula (11)) and [
32] (Formula (10)).
Table 3 at first presents results for dataset-1: Lagrange-based decomposition for the share
, repeated from
Table 1 for the sake of comparison with its logarithmic estimation, and their ratio. The last three columns in
Table 3 show similar results for dataset-2 from
Table 2. We can see that within each dataset, the results via both methods are very close with respect to any
i-th product, mostly within several precent, and the mean difference shown in the last row is about 4–8%. Thus, these methods support the results of each other, and are open for further investigation.
It is important to note that the decomposition of a function change due to the changes in its independent variables presents a special kind of descriptive analysis which can indicate in which directions researchers and managers can find how to improve the outcome values. With some products of positive and others of negative contributions into the change in the mean price, the best and worst players can be identified. Of course, it is difficult to predict an actual rate of the mean price change with improvement in the product characteristics because many factors play their role in the market. For example, some products can be complementary, others substitutional, the market context has its effects, and other conditions can influence the consumers decisions [
34,
35]. It can also be useful to build a spreadsheet calculator for performing the described decompositions and considering various “what-if” scenarios according to the obtained results.