Skip to main content
2 of 2
edited tags
kjetil b halvorsen
  • 82.8k
  • 32
  • 201
  • 663

Derive log-likelihood of Bernoulli logistic regression

I have a problem where I am supposed to derive the log-likelihood for the parameters of a logistic regression. This problem should be rather straightforward arithmetically, but no matter how I go about it, I cannot get the desired result. See the below picture for a full problem description:

enter image description here

As the calculations are rather long, I will not be posting the entire chain, but rather the end result that I get, which is

$$ l(\mathbf{\beta}) = - \sum^n_{i=1} \ln \left ( e^{(1-y_i)\beta^Tx_i} + e^{-y_i\beta^Tx_i} \right ). $$

I have gone through all of my calculations twice but I cannot find any errors. So I'm starting to wonder if I should somehow rewrite this last expression? If someone could provide some direct way of calculating this quantity or just pointing me towards some material pertaining to this issue, I would be very grateful.

Tingiskhan
  • 141
  • 1
  • 4