# Simplify the log of the multivariate logit (or logistic)-normal probability density function

According to wikipedia, the probability density function of the multivariate logit-normal (sometimes called logistic-normal) distribution is

$$f_X( \mathbf{x}; \boldsymbol{\mu} , \boldsymbol{\Sigma} ) = \frac{1}{ | 2 \pi \boldsymbol{\Sigma} |^\frac{1}{2} } \, \frac{1}{ \prod\limits_{i=1}^D \left(x_i(1-x_i)\right) } \, e^{- \frac{1}{2} \left\{ \log \left( \frac{ \mathbf{x} }{ 1-\mathbf{x} } \right) - \boldsymbol{\mu} \right\}^\top \boldsymbol{\Sigma}^{-1} \left\{ \log \left( \frac{ \mathbf{x}}{ 1-\mathbf{x} } \right) - \boldsymbol{\mu} \right\} }$$

I'm interested in fitting a model to some data that have this distribution. Therefore, I would like to calculate the log likelihood of the model, or $\ln{}(f_X( \mathbf{x}; \boldsymbol{\mu} , \boldsymbol{\Sigma} ))$. I imagine there must be a simplification to this formula, but it is beyond my mathematical ability to find it.

$$\log \left(f_X(x;\mu;\Sigma)\right) \\ = -\log|2\pi\Sigma |^\frac12 - {\log\left( \prod_{i=1}^D \left(x_i(1-x_i)\right) \right)} {- \frac12 \left\{ \log \left( \frac{ x }{ 1-x } \right) - \mu \right\}^\top \Sigma^{-1} \left\{ \log \left( \frac{ x}{ 1-x } \right) - \mu \right\} }\\ =-\log|2\pi\Sigma |^\frac12 - \sum_{i=1}^D{\log\left( \left(x_i(1-x_i)\right) \right)} {- \frac12 \left\{ \log \left( \frac{ x }{ 1-x } \right) - \mu \right\}^\top \Sigma^{-1} \left\{ \log \left( \frac{ x}{ 1-x } \right) - \mu \right\} }$$Of course the initial constant will not matter when differentiating this. The second term differentiates to $\frac{1-2x_j}{ x_j(1-x_j)}$. The final term is probably much more complicated, but I will give the first term. Differentiating with respect to $x_k$ gives $$\sum_i\frac12\frac{1}{x_k}\frac{1+x_k}{1-x_k}\Sigma^{-1}_{ki}\left\{\log\left(\frac{x_i}{1-x_i}-\mu\right)\right\}+\text{other similar terms}$$ This is of course due to the product rule.