What does it mean when the total and main effects ANOVA indices are the same?
Does it mean there is zero interaction of the different inputs? Is there some other way to quantify or understand that? I messed around with a few different functions and it looks like, as the interaction between the inputs increases, so does the difference between their main and total effects indices. Looking at the equations, it is not clear to me how I can predict when the main (S) and total (T) indexes will or will not similar in magnitude, but I'm sure something is escaping me. There is a symmetry to them. S and T are defined as
$ S_i = \frac{\mathrm{Var}_{x_i}\left( \mathbb{E}_{x_{\sim i}} \left[ f(x | x_i) \right] \right)}{\mathrm{Var}\left(f(x)\right)} $
$T_i = \frac{\mathbb{E}_{x_{\sim i}}\left[ \mathrm{Var}_{x_{i}} \left( f(x | x_{\sim i}) \right) \right]}{\mathrm{Var}\left(f(x)\right)}$
where $\mathbb{E}$ is the expectation/mean operator,
$\mathbb{E}_x[f]=\int$ f(x) P(x) dx\,,$
$\mathrm{Var}$ returns variance,
$\mathrm{Var}_x[f]=\int (f(x) - \mathbb{E}_x[f])^2 P(x) dx\,,$
and $x_{\sim i}$ denotes the vector $x$ excluding $x_i$. the entries of $x$ have a prescribed/known joint probability distribution, $P(x)$.
In my mind, the question above is self-contained. I include the following musing and code only to illustrate my point.
If I had to guess, I would think $T$ and $S$ will be the same if and only if
$\mathbb{E}[f(x_0,\dots,x_n]= \frac{1}{n} \sum_{i=1}^n \mathbb{E}[f(x_i | x_{\sim i})]$
and
$\mathrm{Var}[f(x_0,\dots,x_n]= \frac{1}{n} \sum_{i=1}^n \mathrm{Var}[f(x_i | x_{\sim i})]\,.$
import chaospy as cp
np.random.seed(88833)
# define dummy function
# ### def foo(param): return param[0] ** param[1] # there is a greater difference in the output
def foo(param): return param[0] * np.e ** (-param[1] ** param[0])
# Two arbitrary uniform random variables:
distribution = cp.J(
cp.Uniform(1, 2),
cp.Uniform(0.1, 0.2)
)
# sample input space
samples = distribution.sample(50)
evals = [foo(sample) for sample in samples.T]
# create 2nd order expansion for the random variables
polynomial_expansion = cp.orth_ttr(2, distribution)
# fit the polynomial coefficients to the samples
foo_approx = cp.fit_regression(polynomial_expansion, samples, evals)
# calculate main and total effects
total = cp.Sens_t(foo_approx, distribution)
main = cp.Sens_m(foo_approx, distribution)
print(total)
print('++++++++')
print(main)
output:
[0.99492682 0.00513335]
++++++++
[0.99486665 0.00507318]