In the previous lecture, you understood what a likelihood function is. To recap, the likelihood function for our data is (1−P1)(1−P2)(1−P3)(1−P4)(1−P6)(P5)(P7)(P8)(P9)(P10) . The best-fitting sigmoid curve would be the one which maximises the value of this product.

So, let’s hear from Prof. Dinesh on how this best-fitting sigmoid curve can be found.

If you had to find β0and β1 for the best-fitting sigmoid curve, you would have to try a lot of combinations, unless you arrive at the one which maximises the likelihood. This is similar to linear regression, where you vary β0 and β1 until you find the combination that minimises the cost function.

Correction: In the above video, the value of the likelihood at the time 1:15 is 2.12×10−5 instead of 1.75×10−5

In the interactive app given below, you can try a few combinations yourself and see how the likelihood varies with betas

So, just by looking at the curve here, you can get a general idea of the curve’s fit. Just look at the yellow bars for each of the 10 points. A curve that has a lot of big yellow bars is a good curve. For example, this curve is not a good fit:

Clearly, this curve is a better fit. It has many big yellow bars, and even the small ones are reasonably large. Just by looking at this curve, you can tell that it will have a high likelihood value.