{ "cells": [ { "cell_type": "markdown", "id": "c57b2ce5", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Likelihood Function and Loss Function\n", "\n", "Feng Li\n", "\n", "School of Statistics and Mathematics\n", "\n", "Central University of Finance and Economics\n", "\n", "[feng.li@cufe.edu.cn](mailto:feng.li@cufe.edu.cn)\n", "\n", "[https://feng.li/statcomp](https://feng.li/statcomp)\n" ] }, { "cell_type": "markdown", "id": "055df123", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Likelihood Function\n", "\n", "- Given that $x_i\\sim N(\\mu,\\sigma)$ for $i=1,...,n$, the **likelihood\n", " function** is\n", "\n", " $$\\prod_{i=1}^n f(x_i,\\mu,\\sigma)$$\n", "\n", "- However the **log likelihood function** is more often used\n", " $$\\sum_{i=1}^n \\log f(x_i,\\mu,\\sigma)$$\n", "\n", "- Do you know why?" ] }, { "cell_type": "code", "execution_count": 6, "id": "42b9aabc", "metadata": { "slideshow": { "slide_type": "slide" } }, "outputs": [ { "data": { "text/html": [ "0" ], "text/latex": [ "0" ], "text/markdown": [ "0" ], "text/plain": [ "[1] 0" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "-1926.43418681411" ], "text/latex": [ "-1926.43418681411" ], "text/markdown": [ "-1926.43418681411" ], "text/plain": [ "[1] -1926.434" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "NormLike <- function(mu, sigma, data)\n", " {\n", " out = prod(dnorm(x = data, mean = mu, sd = sigma))\n", " return(out)\n", " }\n", "\n", "logNormLike <- function(mu, sigma, data)\n", " {\n", " out = sum(dnorm(\n", " x = data, mean = mu, sd = sigma,\n", " log = TRUE))\n", " return(out)\n", " }\n", "\n", "set.seed(123)\n", "data = rnorm(1000, mean=2, sd=1)\n", "NormLike(mu = 1, sigma = 1, data=data) \n", "logNormLike(mu = 1, sigma = 1, data=data) " ] }, { "cell_type": "markdown", "id": "bd3ee8fd", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "\n", "### Walking APP example: How long do you walk every day?\n", "\n", "- Here is a list about my past six days walking statistics. Can you\n", " estimate how long do I walk everyday? and what is the variation?\n", "\n", "\n", "![walking](figures/walking.png)" ] }, { "cell_type": "code", "execution_count": 7, "id": "68acebc3", "metadata": { "slideshow": { "slide_type": "slide" } }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAMAAAC46dgSAAAC/VBMVEUAAAABAQECAgIDAwME\nBAQFBQUGBgYHBwcICAgJCQkKCgoLCwsMDAwNDQ0ODg4PDw8QEBARERESEhITExMUFBQVFRUW\nFhYXFxcYGBgZGRkaGhobGxscHBwdHR0eHh4fHx8gICAhISEiIiIjIyMkJCQlJSUmJiYnJyco\nKCgpKSkqKiorKyssLCwtLS0uLi4vLy8wMDAxMTEyMjIzMzM0NDQ1NTU2NjY3Nzc4ODg5OTk6\nOjo7Ozs8PDw9PT0+Pj4/Pz9AQEBBQUFCQkJDQ0NERERFRUVGRkZHR0dISEhJSUlKSkpLS0tM\nTExNTU1OTk5PT09QUFBRUVFSUlJTU1NUVFRVVVVWVlZXV1dYWFhZWVlaWlpbW1tcXFxdXV1e\nXl5fX19gYGBhYWFiYmJjY2NkZGRlZWVmZmZnZ2doaGhpaWlqampra2tsbGxtbW1ubm5vb29w\ncHBxcXFycnJzc3N0dHR1dXV2dnZ3d3d4eHh5eXl6enp8fHx9fX1+fn5/f3+AgICBgYGCgoKD\ng4OEhISFhYWGhoaHh4eIiIiJiYmKioqLi4uMjIyNjY2Ojo6Pj4+QkJCRkZGSkpKTk5OUlJSV\nlZWWlpaXl5eYmJiZmZmampqbm5ucnJydnZ2enp6fn5+goKChoaGioqKjo6OkpKSlpaWmpqan\np6eoqKipqamqqqqrq6usrKytra2urq6vr6+wsLCxsbGysrKzs7O0tLS1tbW2tra3t7e4uLi5\nubm6urq7u7u8vLy9vb2+vr6/v7/AwMDBwcHCwsLDw8PExMTFxcXGxsbHx8fIyMjJycnKysrL\ny8vM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851DUysyozWwIM/q2NyKHtGN4Qt2vst0oMxy7lMGcRY/MzQ6pbrVy7vBecD5MD8w+DIHX\ntz4sNFmaENdv5HnJTWAzM76zGb0yM2ozG8KMvu2NyKZ2LIfSBpgqlx2OXcpgyhKIzM3eAoXm\nZq7xXvDrynWmxiTYqc0EhoWm78Ir6tXss6or7GPGdzYRqMyM2syFMBHY9sHIfDuOx2CRqXLZ\n4bilBqYswcjs7GTYY27mGu8FL4EZgdlZ+jmRMSy0TsMa3PjOHMHK7KjNoSGC8NueRuba8Zzd\noNhUuexwFktDesdFNmbH+kJPGdziveBt0E+ZLKzwHH0z5yuzzLDQLz1Ld2tkKYzjxndmYSoz\nozYzS83o296IzLbj+QammrthIxyzlIXLEozMzV5dq5Q+u8B7waSvbyEhRT1868h6eJ7ww0IP\nhZfpCWjnuMCxT9tFn9p3IFCBrWyM2swuZSqr6NueicyM9sxXHg/5Id0oOxyzlK3MZGEic7Mt\neoffUk6IAcFra8Xljc2G2+ls/RsIPyz0H9X8nYc1qPhyoK4meAm0DCwwjSGtj9rMLmUqq+jb\nno1sjPbMVz47/iQxV7YRzljKVWbGlDYis7OH/DPtbzW7xIBgsmPYWcltXlB2cWMblZiGhd4w\nsE5yl8+DVUMEc5WDozazS0sxwkUOjvbMVd4GXQKzRmU74awFM2NKM5GZ2fkWt2VcEwuCDX63\nOWL9vrblCCq4cuRyD7y4HJXtEluCSS97Q9YvsvxcIDqVI5Z7b+VPyhHZLjEmeG3yHzZqLe1k\np1ZkKkcu9x159uvaJ8YEk5kRuN/+z+BgztZIhI01wYhgULDkoGDJQcGSg4IlBwVLDgqWHBQs\nOShYclCw5KBgyUHBkoOCJQcFSw4KlhwULDkoWHJQsOSgYMlBwZKDgiUHBUsOCpYcFCw5KFhy\nULDkoGDJ+R9mRYU1spn4owAAAABJRU5ErkJggg==", "text/plain": [ "Plot with title “Histogram of c(294, 262, 196, 79, 191, 677)”" ] }, "metadata": { "image/png": { "height": 180, "width": 240 } }, "output_type": "display_data" } ], "source": [ "hist(c(294,262,196,79,191,677))" ] }, { "cell_type": "markdown", "id": "b9bd295e", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### The likelihood function\n", "\n", "- We assume everyday’s walking steps ($x_i$) are independent, and\n", " $x_i$ follows standard normal distribution $\\sim N(\\mu,\\sigma)$, the corresponding likelihood function is\n", "\n", " $$\\prod_{i=1}^n f(x_i,\\mu,\\sigma)$$ which can be easily written in R\n", "\n", "- **The scope** Find a proper combination of $\\mu$ and $\\sigma$ that\n", " maximizes the loglikelihood function." ] }, { "cell_type": "markdown", "id": "a5944b92", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### Conditional likelihood function\n", "\n", "- Fix other parameters\n", "\n", "![conddensity](figures/conddensity.png)\n", "\n", "Left: fix variance to allow $\\mu$ to change with likelihood function. Right: fix mean to allow $\\sigma$ to change with likelihood function." ] }, { "cell_type": "code", "execution_count": 8, "id": "f9071724", "metadata": { "slideshow": { "slide_type": "slide" } }, "outputs": [], "source": [ "x <- c(294, 262, 196, 79, 191, 677)\n", "mu = 260:300\n", "sigma = 180:220\n", "\n", "parMat <- expand.grid(mu, sigma)\n", "muALL <- parMat[, 1]\n", "sigmaALL <- parMat[, 2]\n", "\n", "myLogLike <- matrix(NA, 1, length(sigma))\n", "for(i in 1:length(sigmaALL))\n", "{\n", " myLogLike[i] <- logNormLike(mu = muALL[i], sigma = sigmaALL[i], data = x)\n", "}" ] }, { "cell_type": "markdown", "id": "b1916648", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "R\n", "persp(as.vector(mu), as.vector(sigma), \n", " matrix(myLogLike, length(mu),), \n", " theta = 90, phi = 30, expand = 0.5, \n", " col = \"lightblue\", xlab = \"mu\", \n", " ylab = \"sigma\", zlab = \"log likelihood\", \n", " ticktype = \"detailed\")\n", "\n", "filled.contour(as.vector(mu), as.vector(sigma), \n", " matrix(myLogLike, length(mu),), \n", " xlab = \"mu\", ylab = \"sigma\")\n", "" ] }, { "cell_type": "markdown", "id": "876dcc3b", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "- 2D and 3D loglikelihood function\n", "\n", " ![3dlike](figures/3dlike.png)\n" ] }, { "cell_type": "markdown", "id": "dd211cfe", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "- Are $\\mu$ and $\\sigma$ we obtained the best combination?\n", "\n", " ![2dlike](figures/2dlike.png)\n" ] }, { "cell_type": "markdown", "id": "7f7f59d6", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### Likelihood function for linear regression\n", "\n", "- Assume you want to make a regression model\n", " $$y_i = \\beta_0 + \\beta_1 x_i + \\epsilon_i$$\n", " where $\\epsilon_i \\sim N(0, \\sigma^2)$\n", "\n", "- What is the (log) likelihood function?\n", "\n", "- What are the unknown parameters?\n", "\n", "- How do we estimate the parameters?\n", "\n", " - Write down a likelihood function with respect to the unknown\n", " parameters.\n", "\n", " - Use an optimization algorithm to find the estimates of the\n", " unknown parameters.\n" ] }, { "cell_type": "code", "execution_count": 9, "id": "60704413", "metadata": { "slideshow": { "slide_type": "slide" } }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAIAAAAAVb93AAAACXBIWXMAABJ0AAASdAHeZh94\nAAAgAElEQVR4nO3de1yOd+MH8M/dOToppVJCq+jA5lRakeNojMgYG8YzmrPs2Wab/Rg/h3iM\nYQ4PNqw5zWGOj/FgLOSwnEKFhFKOEZ3r/v3R/eskUe7u7/euz/u1P7q/99V1fUY+Lt/re1+X\nQqlUgoiI5KMjOgAREZWNBU1EJCkWNBGRpFjQRESSYkETEUmKBU1EJCkWNBGRpFjQRESSYkET\nEUmKBU1EJCkWNBGRpFjQRESSYkETEUmKBU1EJCkWNBGRpFjQRESSYkETEUmKBU1EJCkWNBGR\npFjQRESSYkETEUmKBU1EJCkWNBGRpFjQRESSYkETEUmKBU1EJCkWNBGRpFjQRESSYkETEUmK\nBU1EJCkWNBGRpFjQRESSYkETEUmK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2IAAAAAElFTkSuQmCC", "text/plain": [ "plot without title" ] }, "metadata": { "image/png": { "height": 180, "width": 240 } }, "output_type": "display_data" } ], "source": [ "beta0 <- 1\n", "beta1 <- 3\n", "sigma <- 0.5\n", "\n", "n <- 1000\n", "x <- rnorm(n, 3, 1)\n", "\n", "y <- beta0 +x*beta1 + rnorm(n, mean = 0, sd = sigma)\n", "plot(x, y, col = \"blue\", pch = 20)" ] }, { "cell_type": "code", "execution_count": 10, "id": "706f5887", "metadata": { "slideshow": { "slide_type": "slide" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Warning message in dnorm(x = y, mean = mean, sd = sigma, log = TRUE):\n", "“NaNs produced”\n", "Warning message in dnorm(x = y, mean = mean, sd = sigma, log = TRUE):\n", "“NaNs produced”\n", "Warning message in dnorm(x = y, mean = mean, sd = sigma, log = TRUE):\n", "“NaNs produced”\n" ] } ], "source": [ "logNormLikelihood <- function(par, y, x)\n", " {\n", " beta0 <- par[1]\n", " beta1 <- par[2]\n", " sigma <- par[3]\n", " mean <- beta0 + x*beta1\n", " logDens <- dnorm(x = y, mean = mean, sd = sigma, log = TRUE)\n", " loglikelihood <- sum(logDens)\n", " return(loglikelihood)\n", " }\n", "\n", "optimOut <- optim(c(0.2, 0.3, 0.5), logNormLikelihood,\n", " control = list(fnscale = -1),\n", " x = x, y = y)\n", "\n", "beta0Hat <- optimOut$par[1]\n", "beta1Hat <- optimOut$par[2]\n", "sigmaHat <- optimOut$par[3]\n", "yHat <- beta0Hat + beta1Hat*x" ] }, { "cell_type": "code", "execution_count": 11, "id": "ea97b1ad", "metadata": { "slideshow": { "slide_type": "slide" } }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAIAAAAAVb93AAAACXBIWXMAABJ0AAASdAHeZh94\nAAAgAElEQVR4nO3deVhV1f7H8fdhRkHECUVxyHkgrTSVnNM0tcyc54lDltlg/Rpuw81rt0yb\nvGUlB5zI1Mw0c0yvVqZW1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MSgEtImJSCmgREZNSQIuI\nmJQCWkTEpBTQIiImpYAWETEpBbSIiEkpoEVETEoBLSJiUgpoERGTUkCLiJiUAlpExKQU0CIi\nJqWAFhExKQW0iIhJKaBFRExKAS0iYlIKaBERk1JAi4iYlAJaRMSkFNAiIialgBYRMSkFtIiI\nSSmgRURMSgEtImJSCmgREZNSQIuImNT/A7gJwljddLTOAAAAAElFTkSuQmCC", "text/plain": [ "plot without title" ] }, "metadata": { "image/png": { "height": 180, "width": 240 } }, "output_type": "display_data" } ], "source": [ "myLM <- lm(y~x)\n", "myLMCoef <- myLM$coefficients\n", "yHatOLS <- myLMCoef[1] + myLMCoef[2]*x\n", "\n", "plot(x, y, pch = 20, col = \"blue\")\n", "points(sort(x), yHat[order(x)], type = \"l\", col = \"red\", lwd = 5)\n", "points(sort(x), yHatOLS[order(x)], type = \"l\", lty = \"dashed\",\n", " col = \"yellow\", lwd = 2, pch = 20)" ] }, { "cell_type": "markdown", "id": "c51a5cb6", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Loss function\n", "\n", "- Every statistical learning algorithm is trained to learn a prediction. \n", "\n", "- These predictions should be as close as possible to the label value (ground-truth value). \n", "\n", "- The loss function measures how near or far are these predicted values compared to original label values.\n", "\n", "- Loss functions are also referred to as error functions as it gives an idea about prediction error.\n", "\n", "- Loss Functions, in simple terms, are nothing but an equation that gives the error between the actual value and the predicted value.\n", "\n" ] }, { "cell_type": "markdown", "id": "ffc72b09", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### Mean squared error loss\n", "\n", "- Mean squared error (MSE) can be computed by taking the actual value and predicted value as the inputs and returning the error via the below equation (mean squared error equation).\n", "$$Loss(\\beta_0, \\beta_1; y, x) = \\frac{1}{N}\\sum_{i=1}^{N}(y_i-(\\beta_0+\\beta_1 x_i))^2$$\n", "\n", "- The equation is very simple and thus can be implemented easily as a computer program. Besides that, it is powerful enough to solve complex problems.\n", "\n", "- The equation we have is differentiable hence the optimization becomes easy. This is one of the reasons for adopting MSE widely" ] }, { "cell_type": "code", "execution_count": 12, "id": "3f6a8d35", "metadata": { "slideshow": { "slide_type": "slide" } }, "outputs": [], "source": [ "loss <- function(par, y, x)\n", " {\n", " beta0 <- par[1]\n", " beta1 <- par[2]\n", " yHat <- beta0 + x*beta1\n", " out <- mean((y- yHat)^2)\n", " return(out)\n", " }\n", "\n", "optimLossOut <- optim(c(0.2, 0.3), loss, x = x, y = y)\n", "\n", "beta0Hat <- optimLossOut$par[1]\n", "beta1Hat <- optimLossOut$par[2]\n", "yHatLoss <- beta0Hat + beta1Hat*x" ] }, { "cell_type": "code", "execution_count": 13, "id": "9b1191e7", "metadata": { "slideshow": { "slide_type": "slide" } }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAIAAAAAVb93AAAACXBIWXMAABJ0AAASdAHeZh94\nAAAgAElEQVR4nO3dd3hUVf7H8fekBxJCCC1AKNJLBBUEIl0QpClNes9EVkQU/VnWsrK4iuC6\nsopKJkGKCIgI0hEWXBBQ0QUkCIReEgggLZTUub8/EtIYQoAkcwOf18PzOHPuuXe+N8CH651z\nz7EYhoGIiJiPi7MLEBERxxTQIiImpYAWETEpBbSIiEkpoEVETEoBLSJiUgpoERGTUkCLiJiU\nAlpExKQU0CIiJqWAFhExKQW0iIhJKaBFRExKAS0iYlIKaBERk1JAi4iYlAJaRMSkFNAiIial\ngBYRMSkFtIiISSmgRURMSgEtImJSCmgREZNSQIuImJQCWkTEpBTQIiImpYAWETEpBbSIiEkp\noEVETEoBLSJiUgpoERGTUkCLiJiUAlpExKQU0CIiJqWAFhExKQW0iIhJKaBFRExKAS0iYlIK\naBERk1JAi4iYlAJaRMSkFNAiIialgBYRMSkFtIiISSmgRURMSgEtImJSCmgREZNSQIuImJQC\nWkTEpBTQIiImpYAWETEpBbSIiEkpoEVETEoBLSJiUgpoERGTUkCLiJiUAlpExKQU0CIiJqWA\nFhExKQW0iIhJKaBFRExKAS0iYlIKaBERk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a\nNbt27err6+usGjIsWrTI19f3n//8Z0ZL586d27Vrt2PHjlOnThVyMT/++OODDz7YrVu3jJbh\nw4cD//vf/wq5kqwMwxgyZIifn99zzz3nxDKA6OhooE6dOs4tI82UKVNSUlI++ugjPz+/tJaR\nI0f+61//atasmXMLKzT31gqMBWTNmjWVKlW6//77M1oefPDBwMDA77//3lklffvtt2kvgoOD\nnf6Nk4uLS+vWrT09PbM2pq3QfO7cucJcltRut7/55ptVqlTJ2hgXFwfUqFGj0Mq43j//+c8f\nfvjhv//976ZNm5xYBrBv3z6gSpUqc+bM2bdvX6VKlUJCQurVq+eUYubNmxcUFJQ1ji0Wy/PP\nP++UYpzD2ZfwRd65c+eARx55JEd72s3NixcvOqWqDA0aNHD6LY7rnTp1ysvLq1y5cmk3hZzi\nypUrMTExK1asqFmzZrly5aKjo51VybZt2zw8PF577TXDMCZOnIhTb3GMGDECKFOmTEZEuLi4\njBkzpvB/p+Lj44GWLVtu3769W7duZcuWDQoK6t279759+wq5EifSLY47lfbHKCAgIEd7WsvF\nixedUJO5RUdHh4SEJCQkTJw4Me2mkFOMGzeuYsWKnTt3jo2NTYtpp5Rx9erVgQMH1qtX7+23\n33ZKATmk3eJ49NFHf//99/j4+B9//PGhhx76+OOPP/zww0Ku5Pz580BsbGyLFi0OHz7ctWvX\n+vXrf/vttw0bNvz1118LuRincfa/EEXeiRMngCeeeCJHe+fOnYHY2FinVJXBVFfQly5deuut\nt7y9vb28vD755BPnFrN9+/b58+f/4x//qFy5sqen5+LFi51SxujRo728vKKiotLeOv0KesOG\nDevWrcvacvr0aX9/fx8fn9TU1MKs5ODBg2kZ9eqrr9rt9rTGNWvWWCyWBx54oDArcSIF9J1K\nTU11dXVt1apVjvZmzZq5uroW8p/p65knoFesWFG5cmWga9eue/bscXY5mWJiYnx9fStWrFj4\nH7127VrgX//6V0aL0wPaod69ewOFfBfo5MmTQEBAQEpKStb2xx57DIiLiyvMYpxFtzjulIuL\nS9myZa//Ii4mJqZ8+fIu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TEpBTQIiImpYAWETEpBbSIiEkpoEVETEoBLSJi\nUgpoERGTUkCLiJiUAlpExKQU0CIiJqWAFhExKQW0iIhJKaBFRExKAS0iYlIKaBGAXbt2eXp6\ntm3bNqMlOTk5ODg4ICDg5MmTTixM7mUKaBGA+vXr//Wvf/3hhx+++OKLtJbJkydHRUX9+9//\nLl++vHNrk3uWxTAMZ9cgYgpJSUkPPfRQbGzsnj17Lly4EBwc3KFDhyVLlji7Lrl3KaBFMv38\n888hISH9+vU7efLktm3bdu3aFRgY6Oyi5N7l5uwCREykadOmY8eO/de//gXMmjVL6SzOpSto\nkWz2799fs2bN4sWLx8bGlihRwtnlyD1NXxKKZPPiiy96eHhcvnz5tddec3Ytcq9TQItkmjNn\nzpIlSyZOnNi7d+/PPvts8+bNzq5I7mm6xSGSLi4urn79+lWrVv3555/j4uLq1q1bqVKlbdu2\neXh4OLs0uUfpClok3TPPPHP+/Pnw8HBXV9cKFSq8++67f/zxx8SJE51dl9y7dAUtAjB//vx+\n/fq9+OKLH3zwQVqL3W5v3rz5jh07tm3bVrduXeeWJ/cmBbSIiEnpFoeIiEkpoEVETEoBLSJi\nUgpoERGTUkCLiJiUAlpExKQU0CIiJqWAFhExKQW0iIhJKaBFRExKAS0iYlIKaBERk1JAi4iY\nlAJaRMSkFNAiIialgBYRMSkFtIiISSmgRURMSgEtImJSCmgREZNSQIuImJQCWkTEpBTQIiIm\npYAWETEpBbSIiEkpoEVETEoBLSJiUgpoERGTUkCLiJiUAlpExKT+H1CAwo807wVHAAAAAElF\nTkSuQmCC", "text/plain": [ "plot without title" ] }, "metadata": { "image/png": { "height": 180, "width": 240 } }, "output_type": "display_data" } ], "source": [ "myLM <- lm(y~x)\n", "myLMCoef <- myLM\$coefficients\n", "yHatOLS <- myLMCoef[1] + myLMCoef[2]*x\n", "\n", "plot(x, y, pch = 20, col = \"blue\")\n", "points(sort(x), yHatLoss[order(x)], type = \"l\", col = \"red\", lwd = 5)\n", "points(sort(x), yHatOLS[order(x)], type = \"l\", lty = \"dashed\",\n", " col = \"yellow\", lwd = 2, pch = 20)" ] }, { "cell_type": "markdown", "id": "bde63ca2", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Discussion\n", "\n", "- What are the advantages and disadvantages of using likelihood function and loss function?" ] } ], "metadata": { "celltoolbar": "Slideshow", "kernelspec": { "display_name": "R", "language": "R", "name": "ir" }, "language_info": { "codemirror_mode": "r", "file_extension": ".r", "mimetype": "text/x-r-source", "name": "R", "pygments_lexer": "r", "version": "4.3.2" } }, "nbformat": 4, "nbformat_minor": 5 }