{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "This class is similar to "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "rv_continuous",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". Whether a shape parameter is valid is decided by an "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "_argcheck"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " method (which defaults to checking that its arguments are strictly positive.) The main differences are as follows."
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The support of the distribution is a set of integers."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Instead of the probability density function, "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "pdf"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " (and the   corresponding private "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "_pdf"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "), this class defines the   "
                    },
                    {
                      "__type": "Emphasis",
                      "__tag": 4047,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "probability mass function"
                        }
                      ]
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "pmf",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": null,
                        "version": null,
                        "kind": "local",
                        "path": "pmf"
                      },
                      "kind": "local"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " (and the corresponding   private "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "_pmf"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ".)"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "There is no "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "scale"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " parameter."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The default implementations of methods (e.g. "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "_cdf"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ") are not designed   for distributions with support that is unbounded below (i.e.   "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "a=-np.inf"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "), so they must be overridden."
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "To create a new discrete distribution, we would do the following:"
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> from scipy.stats import rv_discrete\n>>> class poisson_gen(rv_discrete):\n...     \"Poisson distribution\"\n...     def _pmf(self, k, mu):\n...         return exp(-mu) * mu**k / factorial(k)",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "and create an instance  "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> poisson = poisson_gen(name=\"poisson\")",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Note that above we defined the Poisson distribution in the standard form. Shifting the distribution can be done by providing the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "loc"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " parameter to the methods of the instance. For example, "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "poisson.pmf(x, mu, loc)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " delegates the work to "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "poisson._pmf(x-loc, mu)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Discrete distributions from a list of probabilities"
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Alternatively, you can construct an arbitrary discrete rv defined on a finite set of values "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "xk"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " with "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "Prob{X=xk} = pk"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " by using the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "values"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " keyword argument to the "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "rv_discrete",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.stats._distn_infrastructure:rv_discrete"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " constructor."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Deepcopying / Pickling"
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If a distribution or frozen distribution is deepcopied (pickled/unpickled, etc.), any underlying random number generator is deepcopied with it. An implication is that if a distribution relies on the singleton RandomState before copying, it will rely on a copy of that random state after copying, and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "np.random.seed"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " will no longer control the state."
            }
          ]
        }
      ],
      "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": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "rvs",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "pmf",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "logpmf",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "cdf",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "logcdf",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "sf",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "logsf",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "ppf",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "isf",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "moment",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "stats",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "entropy",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "expect",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "median",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "mean",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "std",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "var",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "interval",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "__call__",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "support",
              "annotation": "",
              "desc": []
            }
          ]
        }
      ],
      "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 generic discrete random variable class meant for subclassing."
            }
          ]
        }
      ],
      "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": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "a, b",
              "annotation": "float, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Lower/upper bound of the support of the unshifted/unscaled distribution. This value is unaffected by the "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "loc",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "scale",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "module",
                        "path": "scipy.stats._qmc:scale"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " parameters. To calculate the support of the shifted/scaled distribution, use the "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "support",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": null,
                        "version": null,
                        "kind": "local",
                        "path": "support"
                      },
                      "kind": "local"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " method."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "a",
              "annotation": "float, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Lower bound of the support of the distribution, default: 0"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "b",
              "annotation": "float, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Upper bound of the support of the distribution, default: plus infinity"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "moment_tol",
              "annotation": "float, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The tolerance for the generic calculation of moments."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "values",
              "annotation": "tuple of two array_like, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "(xk, pk)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " where "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "xk"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " are integers and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "pk"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " are the non-zero probabilities between 0 and 1 with "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "sum(pk) = 1"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "xk"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "pk"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " must have the same shape, and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "xk"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " must be unique."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "inc",
              "annotation": "integer, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Increment for the support of the distribution. Default is 1. (other values have not been tested)"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "badvalue",
              "annotation": "float, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The value in a result arrays that indicates a value that for which some argument restriction is violated, default is np.nan."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "name",
              "annotation": "str, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The name of the instance. This string is used to construct the default example for distributions."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "longname",
              "annotation": "str, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "This string is used as part of the first line of the docstring returned when a subclass has no docstring of its own. Note: "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "longname"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " exists for backwards compatibility, do not use for new subclasses."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "shapes",
              "annotation": "str, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The shape of the distribution. For example \"m, n\" for a distribution that takes two integers as the two shape arguments for all its methods If not provided, shape parameters will be inferred from the signatures of the private methods, "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "_pmf"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "_cdf"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " of the instance."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "seed",
              "annotation": "{None, int, `numpy.random.Generator`, `numpy.random.RandomState`}, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "seed"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is None (or "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "np.random",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "), the "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "numpy.random.RandomState",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": "numpy",
                        "version": "*",
                        "kind": "api",
                        "path": "numpy.random.mtrand:RandomState"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " singleton is used. If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "seed"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is an int, a new "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "RandomState"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " instance is used, seeded with "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "seed"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "seed"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is already a "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Generator"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " or "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "RandomState"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " instance then that instance is used."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "rv_discrete",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.stats._distn_infrastructure:rv_discrete"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is a base class to construct specific distribution classes and instances for discrete random variables. It can also be used to construct an arbitrary distribution defined by a list of support points and corresponding probabilities."
            }
          ]
        }
      ],
      "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/_distn_infrastructure.py",
  "item_line": 3172,
  "item_type": "class",
  "aliases": [
    "scipy.stats.rv_discrete"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "Custom made discrete distribution:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nfrom scipy import stats\nxk = np.arange(7)\npk = (0.1, 0.2, 0.3, 0.1, 0.1, 0.0, 0.2)\ncustm = stats.rv_discrete(name='custm', values=(xk, pk))\nimport matplotlib.pyplot as plt\nfig, ax = plt.subplots(1, 1)\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "ax.plot(xk, custm.pmf(xk), 'ro', ms=12, mec='r')\nax.vlines(xk, 0, custm.pmf(xk), colors='r', lw=4)\n",
        "execution_status": "failure"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.show()\n",
        "execution_status": "success"
      },
      {
        "__type": "Figure",
        "__tag": 4024,
        "value": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "scipy",
          "version": "1.17.1",
          "kind": "assets",
          "path": "fig-54869f19a6fbca5c.png"
        }
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nRandom number generation:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "R = custm.rvs(size=100)\n",
        "execution_status": "success"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "a",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "0"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "b",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "inf"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "name",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "badvalue",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "moment_tol",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "1e-08"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "values",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "inc",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "1"
      },
      {
        "__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": "rv_discrete"
  },
  "references": null,
  "qa": "scipy.stats._distn_infrastructure:rv_discrete",
  "arbitrary": [],
  "local_refs": [
    "__call__",
    "a",
    "b",
    "badvalue",
    "cdf",
    "entropy",
    "expect",
    "inc",
    "interval",
    "isf",
    "logcdf",
    "logpmf",
    "logsf",
    "longname",
    "mean",
    "median",
    "moment",
    "moment_tol",
    "name",
    "pmf",
    "ppf",
    "rvs",
    "seed",
    "sf",
    "shapes",
    "stats",
    "std",
    "support",
    "values",
    "var"
  ]
}