# Taking logarithm of sum and products

$\newcommand{\cost}{\operatorname{cost}}$My cost-metric is in following form

$$\cost(x,y) = A(x,y_1) \times \sum_{i}b_i B_i(x,y_i)\tag{1}$$

where $A$ and $B$'s follow normal distribution. For my computer implementation, I am thinking of taking $\log(\cdot)$ to avoid computing exponential. By taking log of (1), I get

$$\log(\cost(x,y)) = \log(A(x,y_1)) + \log\left(\sum_i b_i B_i(x,y_i)\right)$$

which simplifies first term but second term remains unchanged. Can I bring $\log(\cdot)$ inside the summation?

• No, you cannot. May 24, 2017 at 23:12
• Are $A$ and $B_i$ all independent of each other? In what what do they depend on $x$ and $y$? Are those supposed to be parameters identifying which normal distribution it is? May 24, 2017 at 23:42