Follow ______ on twitter.

8.1.2 Development of Stochastic Models

Code

Vega-Lite Chart

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "Comparison of Normal, Student-t, Lognormal, and Gumbel Distributions",
  "width": 350,
  "height": 250,
  "data": {
    "sequence": {
      "start": -5,
      "stop": 5,
      "step": 0.01,
      "as": "x"
    }
  },
  "transform": [
    {
      "calculate": "exp(-pow(datum.x, 2) / 2) / sqrt(2 * PI)",
      "as": "Normal"
    },
    {
      "calculate": "densityStudentT(datum.x, 3)",
      "as": "Student-t"
    },
    {
      "calculate": "datum.x > 0 ? densityLogNormal(datum.x, 0, 0.5) : 0",
      "as": "Lognormal"
    },
    {
      "calculate": "exp(-datum.x - exp(-datum.x))",
      "as": "EVT (Gumbel)"
    }
  ],
  "layer": [
    {
      "transform": [
        {
          "fold": [
            "Normal",
            "Student-t",
            "EVT (Gumbel)"
          ]
        }
      ],
      "mark": "line",
      "encoding": {
        "x": {
          "field": "x",
          "type": "quantitative",
          "title": "Value"
        },
        "y": {
          "field": "value",
          "type": "quantitative",
          "title": "Density"
        },
        "color": {
          "field": "key",
          "type": "nominal",
          "title": "Distribution"
        }
      }
    }
  ]
}