Follow ______ on twitter.

3.2.3 Exponential Distribution

Code

Vega-Lite Chart

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "Exponential Distribution PDF for different rate parameters",
  "data": {
    "sequence": {
      "start": 0,
      "stop": 5,
      "step": 0.01,
      "as": "x"
    }
  },
  "transform": [
    {
      "calculate": "0.5 * exp(-0.5 * datum.x)",
      "as": "y1"
    },
    {
      "calculate": "1 * exp(-1 * datum.x)",
      "as": "y2"
    },
    {
      "calculate": "2 * exp(-2 * datum.x)",
      "as": "y3"
    }
  ],
  "hconcat": [
    {
      "width": 250,
      "height": 200,
      "title": "λ = 0.5",
      "mark": "line",
      "encoding": {
        "x": {
          "field": "x",
          "type": "quantitative",
          "title": "Time"
        },
        "y": {
          "field": "y1",
          "type": "quantitative",
          "title": "Probability Density"
        },
        "color": {
          "value": "#004976"
        }
      }
    },
    {
      "width": 250,
      "height": 200,
      "title": "λ = 1",
      "mark": "line",
      "encoding": {
        "x": {
          "field": "x",
          "type": "quantitative",
          "title": "Time"
        },
        "y": {
          "field": "y2",
          "type": "quantitative",
          "title": "Probability Density"
        },
        "color": {
          "value": "#7A0045"
        }
      }
    },
    {
      "width": 250,
      "height": 200,
      "title": "λ = 2",
      "mark": "line",
      "encoding": {
        "x": {
          "field": "x",
          "type": "quantitative",
          "title": "Time"
        },
        "y": {
          "field": "y3",
          "type": "quantitative",
          "title": "Probability Density"
        },
        "color": {
          "value": "#486300"
        }
      }
    }
  ]
}