Some trouble with algebra using logarithms and summations

30 Views Asked by At

I'm having some embarrassing trouble with algebraic manipulation.

I have the function $$f(y) = y^Tx-\log\sum_{i=1}^ne^{x_i}$$

and for each $i = 1,2,\ldots,n$ $$y_i = {e^{x_1} \over \sum_{i=1}^ne^{x_i}} $$

and I want to sub this back into $f(y)$ to get:

$$f(y) = \sum_{i=1}^ny_i\log y_i$$

where $y \ge 0$ and $1^Ty = 1$ and $0\log0 = 0$

1

There are 1 best solutions below

3
On

It is probably easier to do it the other way around.

Substitute your formula for $y_i$ into $y_i \log y_i$, and use $\log(\frac{a}{b})=\log a - \log b$. You should get $x_iy_i$ minus some remainder stuff which will sum to $\log \sum e^{x_i}$.