# How much a variable contributed to the result of some cost function

I have this simple cost function: $$\sum_{i=1}^n d_i\times h_i \times a_i$$

I wanted to analyze, for example, how much the $$a$$ component/variable contributed to the final cost function. In other words, i'm looking for some expression that tells me if the $$a$$ variable produced a big impact in the final cost or not.

What is the best and most straighforward way to achieve this? Thank you in advance.

• Just a suggestion but how about compare the cost function with a's in against one calculated with every $a=1$. – user121049 Nov 6 '18 at 13:54

$$C_d = \sum_{i=1}^n d_i$$
$$C_h = \sum_{i=1}^n (d_i \times h_i - di)$$
$$C_a = \sum_{i=1}^n (d_i \times h_i \times a_i - d_i \times h_i)$$
$$C_t = C_d + C_h + C_a$$