{
  "id": 383711,
  "title": "Why was Laplace Log Likelihood used ?",
  "url": "/competitions/osic-pulmonary-fibrosis-progression/discussion/383711",
  "author_name": "",
  "post_date": "2023-02-04T20:06:09.152215600Z",
  "votes": 3,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Hi everyone,</p>\n<p>Recently I've been working on a project using this dataset and I was intrigued by the choice of metric, and I would like to understand the reason behind the choice.</p>\n<p>I would be very thankful for your explanations</p>",
  "messages": [
    {
      "id": "2129710",
      "postDate": "02/04/2023 20:06:09",
      "content": "<p>Hi everyone,</p>\n<p>Recently I've been working on a project using this dataset and I was intrigued by the choice of metric, and I would like to understand the reason behind the choice.</p>\n<p>I would be very thankful for your explanations</p>",
      "rawMarkdown": "Hi everyone,\n\nRecently I've been working on a project using this dataset and I was intrigued by the choice of metric, and I would like to understand the reason behind the choice.\n\nI would be very thankful for your explanations",
      "votes": null
    },
    {
      "id": "2139653",
      "postDate": "02/11/2023 00:58:28",
      "content": "<p>Hi Ayman,</p>\n<p>Thanks for your question. You know, in medical applications particularly, it is more important to evaluate a model confidence in its decisions. Such confidence (or uncertainty) will allow the clinicians to judge the model predictions and whether or not to trust it. Accordingly, the evaluation metric of FVC decline prediction task needed to assess both the prediction error and model confidence. By examining predictions when using a linear regressor, the residuals of FVC values seemed to follow a Laplace distribution, whose general formula is:<br>\n$$f(x) = \\frac{1}{2b} \\exp(-\\frac{|x-\\mu|}{b})$$<br>\nwhere $\\mu$ is the location parameter, $$b = \\frac{\\sigma}{\\sqrt{2}}$$ is the scale parameter and $\\sigma$ is the standard deviation. This formula can be modified to model the residuals of FVC values as follows<br>\n$$ f(x) = \\frac{1}{2b} \\exp( -\\frac{|FVC_{pred}-FVC_{true}|}{b} ) $$<br>\nthen<br>\n$$ \\text{Laplace Log Likelihood} = \\log{ (\\frac{1}{2b} \\exp{ (-\\frac{|FVC_{pred}-FVC_{true}|}{b}) }) } = -\\log{(2b)} -\\frac{|FVC_{pred}-FVC_{true}|}{b} $$<br>\nSince $$b = \\frac{\\sigma}{\\sqrt{2}}$$, the final version will be<br>\n$$ \\text{Laplace Log Likelihood} = -\\log{(\\sqrt{2}\\sigma)} -\\frac{\\sqrt{2}|FVC_{pred}-FVC_{true}|}{\\sigma} $$</p>\n<p>Hope that helps.<br>\nThanks!<br>\nAhmed</p>",
      "rawMarkdown": "Hi Ayman,\n\nThanks for your question. You know, in medical applications particularly, it is more important to evaluate a model confidence in its decisions. Such confidence (or uncertainty) will allow the clinicians to judge the model predictions and whether or not to trust it. Accordingly, the evaluation metric of FVC decline prediction task needed to assess both the prediction error and model confidence. By examining predictions when using a linear regressor, the residuals of FVC values seemed to follow a Laplace distribution, whose general formula is:\n$$f(x) = \\frac{1}{2b} \\exp(-\\frac{|x-\\mu|}{b})$$\nwhere $\\mu$ is the location parameter, $$b = \\frac{\\sigma}{\\sqrt{2}}$$ is the scale parameter and $\\sigma$ is the standard deviation. This formula can be modified to model the residuals of FVC values as follows\n$$ f(x) = \\frac{1}{2b} \\exp( -\\frac{|FVC_{pred}-FVC_{true}|}{b} ) $$\nthen\n$$ \\text{Laplace Log Likelihood} = \\log{ (\\frac{1}{2b} \\exp{ (-\\frac{|FVC_{pred}-FVC_{true}|}{b}) }) } = -\\log{(2b)} -\\frac{|FVC_{pred}-FVC_{true}|}{b} $$\nSince $$b = \\frac{\\sigma}{\\sqrt{2}}$$, the final version will be\n$$ \\text{Laplace Log Likelihood} = -\\log{(\\sqrt{2}\\sigma)} -\\frac{\\sqrt{2}|FVC_{pred}-FVC_{true}|}{\\sigma} $$\n\nHope that helps.\nThanks!\nAhmed",
      "votes": null
    },
    {
      "id": "2140545",
      "postDate": "02/11/2023 20:20:10",
      "content": "<p>Thank you soo much for the explanation Ahmed!</p>",
      "rawMarkdown": "Thank you soo much for the explanation Ahmed!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2139653,
      "author_name": "ahmedhshahin",
      "author_url": "",
      "post_date": "02/11/2023 00:58:28",
      "content": "<p>Hi Ayman,</p>\n<p>Thanks for your question. You know, in medical applications particularly, it is more important to evaluate a model confidence in its decisions. Such confidence (or uncertainty) will allow the clinicians to judge the model predictions and whether or not to trust it. Accordingly, the evaluation metric of FVC decline prediction task needed to assess both the prediction error and model confidence. By examining predictions when using a linear regressor, the residuals of FVC values seemed to follow a Laplace distribution, whose general formula is:<br>\n$$f(x) = \\frac{1}{2b} \\exp(-\\frac{|x-\\mu|}{b})$$<br>\nwhere $\\mu$ is the location parameter, $$b = \\frac{\\sigma}{\\sqrt{2}}$$ is the scale parameter and $\\sigma$ is the standard deviation. This formula can be modified to model the residuals of FVC values as follows<br>\n$$ f(x) = \\frac{1}{2b} \\exp( -\\frac{|FVC_{pred}-FVC_{true}|}{b} ) $$<br>\nthen<br>\n$$ \\text{Laplace Log Likelihood} = \\log{ (\\frac{1}{2b} \\exp{ (-\\frac{|FVC_{pred}-FVC_{true}|}{b}) }) } = -\\log{(2b)} -\\frac{|FVC_{pred}-FVC_{true}|}{b} $$<br>\nSince $$b = \\frac{\\sigma}{\\sqrt{2}}$$, the final version will be<br>\n$$ \\text{Laplace Log Likelihood} = -\\log{(\\sqrt{2}\\sigma)} -\\frac{\\sqrt{2}|FVC_{pred}-FVC_{true}|}{\\sigma} $$</p>\n<p>Hope that helps.<br>\nThanks!<br>\nAhmed</p>",
      "votes": null,
      "replies": [
        {
          "id": 2140545,
          "author_name": "aymanlafaz",
          "author_url": "",
          "post_date": "02/11/2023 20:20:10",
          "content": "<p>Thank you soo much for the explanation Ahmed!</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2129710": "Hi everyone,\n\nRecently I've been working on a project using this dataset and I was intrigued by the choice of metric, and I would like to understand the reason behind the choice.\n\nI would be very thankful for your explanations",
    "2139653": "Hi Ayman,\n\nThanks for your question. You know, in medical applications particularly, it is more important to evaluate a model confidence in its decisions. Such confidence (or uncertainty) will allow the clinicians to judge the model predictions and whether or not to trust it. Accordingly, the evaluation metric of FVC decline prediction task needed to assess both the prediction error and model confidence. By examining predictions when using a linear regressor, the residuals of FVC values seemed to follow a Laplace distribution, whose general formula is:\n$$f(x) = \\frac{1}{2b} \\exp(-\\frac{|x-\\mu|}{b})$$\nwhere $\\mu$ is the location parameter, $$b = \\frac{\\sigma}{\\sqrt{2}}$$ is the scale parameter and $\\sigma$ is the standard deviation. This formula can be modified to model the residuals of FVC values as follows\n$$ f(x) = \\frac{1}{2b} \\exp( -\\frac{|FVC_{pred}-FVC_{true}|}{b} ) $$\nthen\n$$ \\text{Laplace Log Likelihood} = \\log{ (\\frac{1}{2b} \\exp{ (-\\frac{|FVC_{pred}-FVC_{true}|}{b}) }) } = -\\log{(2b)} -\\frac{|FVC_{pred}-FVC_{true}|}{b} $$\nSince $$b = \\frac{\\sigma}{\\sqrt{2}}$$, the final version will be\n$$ \\text{Laplace Log Likelihood} = -\\log{(\\sqrt{2}\\sigma)} -\\frac{\\sqrt{2}|FVC_{pred}-FVC_{true}|}{\\sigma} $$\n\nHope that helps.\nThanks!\nAhmed",
    "2140545": "Thank you soo much for the explanation Ahmed!"
  },
  "source": "meta"
}