{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The probability density function for "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "vonmises",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "vonmises_line",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is:"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": "f(x, \\kappa) = \\frac{ \\exp(\\kappa \\cos(x)) }{ 2 \\pi I_0(\\kappa) }"
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "for "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "-\\pi \\le x \\le \\pi"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\kappa \\ge 0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "I_0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the modified Bessel function of order zero ("
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "scipy.special.i0",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ")."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "vonmises",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is a circular distribution which does not restrict the distribution to a fixed interval. Currently, there is no circular distribution framework in SciPy. The "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "cdf"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is implemented such that "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "cdf(x + 2*np.pi) == cdf(x) + 1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "vonmises_line",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the same distribution, defined on "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "[-\\pi, \\pi]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " on the real line. This is a regular (i.e. non-circular) distribution."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Note about distribution parameters: "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "vonmises",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "vonmises_line",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " take "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "kappa"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " as a shape parameter (concentration) and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "loc"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " as the location (circular mean). A "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "scale"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " parameter is accepted but does not have any effect."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "A Von Mises continuous random variable."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "%(before_notes)s"
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/scipy/stats/_continuous_distns.py",
  "item_line": 11072,
  "item_type": "class",
  "aliases": [
    "scipy.stats._continuous_distns.vonmises_gen"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "Import the necessary modules.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.stats import vonmises\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nDefine distribution parameters.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "loc = 0.5 * np.pi  # circular mean\nkappa = 1  # concentration\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nCompute the probability density at ``x=0`` via the ``pdf`` method.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "vonmises.pdf(0, loc=loc, kappa=kappa)\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nVerify that the percentile function ``ppf`` inverts the cumulative\ndistribution function ``cdf`` up to floating point accuracy.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "x = 1\ncdf_value = vonmises.cdf(x, loc=loc, kappa=kappa)\nppf_value = vonmises.ppf(cdf_value, loc=loc, kappa=kappa)\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "x, cdf_value, ppf_value\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nDraw 1000 random variates by calling the ``rvs`` method.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "sample_size = 1000\nsample = vonmises(loc=loc, kappa=kappa).rvs(sample_size)\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nPlot the von Mises density on a Cartesian and polar grid to emphasize\nthat it is a circular distribution.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "fig = plt.figure(figsize=(12, 6))\nleft = plt.subplot(121)\nright = plt.subplot(122, projection='polar')\nx = np.linspace(-np.pi, np.pi, 500)\nvonmises_pdf = vonmises.pdf(x, loc=loc, kappa=kappa)\nticks = [0, 0.15, 0.3]\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nThe left image contains the Cartesian plot.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "left.plot(x, vonmises_pdf)\nleft.set_yticks(ticks)\n",
        "execution_status": "failure"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "number_of_bins = int(np.sqrt(sample_size))\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "left.hist(sample, density=True, bins=number_of_bins)\nleft.set_title(\"Cartesian plot\")\nleft.set_xlim(-np.pi, np.pi)\n",
        "execution_status": "failure"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "left.grid(True)\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nThe right image contains the polar plot.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "right.plot(x, vonmises_pdf, label=\"PDF\")\nright.set_yticks(ticks)\nright.hist(sample, density=True, bins=number_of_bins,\n           label=\"Histogram\")\nright.set_title(\"Polar plot\")\nright.legend(bbox_to_anchor=(0.15, 1.06))\n",
        "execution_status": "failure"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "scipy.stats.vonmises_fisher",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "scipy.stats.vonmises_fisher"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Von-Mises Fisher distribution on a hypersphere"
            }
          ]
        }
      ],
      "type": null
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "momtype",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "1"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "a",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "b",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "xtol",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "1e-14"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "badvalue",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "name",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "longname",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "shapes",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "seed",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "vonmises_gen"
  },
  "references": null,
  "qa": "scipy.stats._continuous_distns:vonmises_gen",
  "arbitrary": [],
  "local_refs": []
}