From the course: Machine Learning with Logistic Regression in Excel, R, and Power BI

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Calculating log likelihood

Calculating log likelihood

- [Instructor] Before we calculate the log likelihoods for a logistic regression model, let's think about how we would calculate the mean for a binomial distribution. The mean value for a binomial distribution with two outcomes like our model equals the probability, P that an event occurs multiplied by one plus the quantity of one minus P multiplied by zero. The second term of the formula goes to zero so the expected outcome or mean of this model equals the probability P. In order to ultimately optimize the coefficients in our logistic regression model, we first need to calculate the log likelihood for each data point and then sum them up and we'll minimize the distance when we solve the problem. I find the log likelihood function makes the most sense if I separate it into the actual outcome and the alternative outcome terms. In the first term, we multiply the actual outcome by the natural log of probability P…

Contents