{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {},
  "_ordered_sections": [],
  "item_file": null,
  "item_line": null,
  "item_type": null,
  "aliases": [],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": null,
  "references": null,
  "qa": "tutorial:stats:continuous_norminvgauss",
  "arbitrary": [
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The probability density function is given by:"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": " \\begin{eqnarray*}\n\t        f(x; a, b) = \\frac{a \\exp\\left(\\sqrt{a^2 - b^2} + b x \\right)}{\\pi \\sqrt{1 + x^2}} \\, K_1\\left(a * \\sqrt{1 + x^2}\\right),\n\t\\end{eqnarray*}"
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "where "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "x"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is a real number, the parameter "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "a"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the tail heaviness and "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "b"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the asymmetry parameter satisfying "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "a > 0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "|b| \\leq a"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "K_1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the modified Bessel function of second kind ("
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "scipy.special.k1",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ")."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "A normal inverse Gaussian random variable with parameters "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "a"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "b"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " can be expressed  as "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "X = b V + \\sqrt(V) X"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " where "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "X"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "norm(0,1)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "V"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "invgauss(mu=1/sqrt(a**2 - b**2))"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". Hence, the normal inverse Gaussian distribution is a special case of normal variance-mean mixtures."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Another common parametrization of the distribution is given by the following expression of the pdf:"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": " \\begin{eqnarray*}\n        g(x, \\alpha, \\beta, \\delta, \\mu) = \\frac{\\alpha\\delta K_1 \\left(\\alpha\\sqrt{\\delta^2 + (x - \\mu)^2}\\right)}{\\pi \\sqrt{\\delta^2 + (x - \\mu)^2}} \\,\n        e^{\\delta \\sqrt{\\alpha^2 - \\beta^2} + \\beta (x - \\mu)}\n\t\\end{eqnarray*}"
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "In SciPy, this corresponds to "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "a = \\alpha \\delta, b = \\beta  \\delta, \\text{loc} = \\mu, \\text{scale}=\\delta"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Implementation: "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "scipy.stats.norminvgauss",
              "domain": null,
              "role": null,
              "inventory": null
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Normal Inverse Gaussian Distribution"
        }
      ],
      "level": 0,
      "target": "continuous-norminvgauss"
    }
  ],
  "local_refs": []
}