{"id":1916,"date":"2019-05-15T12:00:00","date_gmt":"2019-05-15T10:00:00","guid":{"rendered":"https:\/\/kindsonthegenius.com\/blog\/what-is-likelihood-function-in-data-science-and-machine-learning\/"},"modified":"2026-07-05T03:23:15","modified_gmt":"2026-07-05T01:23:15","slug":"what-is-likelihood-function-in-data-science-and-machine-learning","status":"publish","type":"post","link":"https:\/\/kindsonthegenius.com\/blog\/what-is-likelihood-function-in-data-science-and-machine-learning\/","title":{"rendered":"What is Likelihood Function in Data Science and Machine Learning?"},"content":{"rendered":"<p>I will try to explain Likelihood Function in very clear and simple terms. Likelihood Function in <a href=\"https:\/\/kindsonthegenius.com\/blog\/introduction-to-machine-learning-ml\">Machine Learning<\/a> and Data Science is the joint probability distribution(jpd) of the dataset given as a function of the parameter.<\/p>\n<p>Think of it as the probability of obtaining the observed data given the parameter values.<\/p>\n<p>We would now define Likelihood Function for both discreet and continuous distributions:<\/p>\n<p>&nbsp;<\/p>\n<p><strong>For discreet distributions:<\/strong><\/p>\n<p>Assuming X is a discreet random variable (X can take value x)<\/p>\n<p>Let the probability mass function (pmf) of x be p<\/p>\n<p>Let the parameter of the distribution be\u00a0\u03b8<\/p>\n<p>Then the likelihood function is simply given as:<\/p>\n<h5 style=\"text-align: center;\"><em>L(\u03b8 | x) = p(x)<\/em><\/h5>\n<p>This is a function of\u00a0\u03b8.<\/p>\n<p>L is the likelihood function of\u00a0\u03b8 given x, the value of the random variable X.<\/p>\n<p>Also, the probability that the random variable X takes the value x for the parameter\u00a0\u03b8 is given as <em>P(X = x |\u00a0\u03b8)<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><strong>For continuous distributions:<\/strong><\/p>\n<p>Similarly, for continuous distribution, let X be a random variable can can take a value x.<\/p>\n<p>X has a density function of f that depend on the parameter\u00a0\u03b8.<\/p>\n<p>Then the function:<\/p>\n<h5 style=\"text-align: center;\"><em>L(\u03b8 | x) = f(x) <\/em><\/h5>\n<p>for the parameter\u00a0\u03b8 is the likelihood function of\u00a0\u03b8 given x<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h4><strong>A Closer Look at Likelihood Function<\/strong><\/h4>\n<p>Let&#8217;s approach the definition from another way. Maybe, it&#8217;ll be clearer for you.<\/p>\n<p>Assuming a set of observations <em>X = x<sub>1<\/sub>, x<sub>2<\/sub>, &#8230;, x<sub>n<\/sub> <\/em>that has a joint probability density function given by <em>p(x<sub>1<\/sub>, x<sub>2<\/sub>, &#8230; , x<sub>n<\/sub> |\u00a0\u03b8)<\/em><\/p>\n<p>Then the likelihood function\u00a0 is given by<\/p>\n<p><em>L(\u03b8) = L(\u03b8 | x<sub>1<\/sub>, x<sub>2<\/sub>, &#8230;, x<sub>n<\/sub>) = p(x<sub>1<\/sub>, x<sub>2<\/sub>, &#8230;, xn |\u03b8)<\/em><\/p>\n<p>In this case, <em>x<sub>1<\/sub>, x<sub>2<\/sub>,&#8230;, x<sub>n<\/sub><\/em> is fixed<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Log Likelihood<\/strong><\/p>\n<p>It is generally easier to find the natural logarithm of the likelihood function. This is known as the log-likelihood and is given by:<\/p>\n<p>log L(\u03b8)<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h4><strong>Properties of Likelihood Function<\/strong><\/h4>\n<p>The likelihood function(lf) is a function is function of the parameter \u03b8<\/p>\n<p>The likelihood function is different from the probability density function<\/p>\n<p>If the data is independent and identically distributed(iid), then the likelihood is given by:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-839 aligncenter\" src=\"https:\/\/www.kindsonthegenius.com\/wp-content\/uploads\/2020\/09\/Likelihood-Function-300x114.jpg\" alt=\"\" width=\"168\" height=\"64\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>The likelihood function is defined up to some constant proportionality<\/p>\n<p>It is used in estimation to generate estimators for example maximum likelihood estimation and for Bayesian inference.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I will try to explain Likelihood Function in very clear and simple terms. Likelihood Function in Machine Learning and Data Science is the joint probability &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[16],"tags":[],"class_list":["post-1916","post","type-post","status-publish","format-standard","hentry","category-machine-learning"],"_links":{"self":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/1916","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/comments?post=1916"}],"version-history":[{"count":1,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/1916\/revisions"}],"predecessor-version":[{"id":2084,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/1916\/revisions\/2084"}],"wp:attachment":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/media?parent=1916"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/categories?post=1916"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/tags?post=1916"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}