0
$\begingroup$

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.

$\endgroup$

1 Answer 1

0
$\begingroup$

Yes, this can be simplified, however it is still not going to be very pleasant looking.

$$\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.

$\endgroup$
4
  • $\begingroup$ ~~Thanks! Is the question at the end rhetorical? Its the vector of your observations divided by 1 minus that vector, no?~~ I see what you mean, you can't take the log of a negative number. $\endgroup$
    – sammosummo
    Apr 13, 2018 at 19:52
  • $\begingroup$ In the wikipedia article it says: "where the log and the division in the argument are taken element-wise", does this explain it? $\endgroup$
    – sammosummo
    Apr 13, 2018 at 20:31
  • $\begingroup$ The end was not rhetorical, I didn't understand the meaning of dividing by a vector. If it is elementwise, then yes that makes sense. I suppose I should have noticed that haha $\endgroup$
    – John Doe
    Apr 13, 2018 at 21:30
  • $\begingroup$ I think your work is correct so I've accepted the answer, however I think the equation for the multivariate logit-normal likelihood might be wrong (off be a constant or something, so I asked a new question here: math.stackexchange.com/questions/2741389/… $\endgroup$
    – sammosummo
    Apr 17, 2018 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.