{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Suppose a probability distribution has support "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "[l, r]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". The inverse log-CDF returns its minimum value of "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "l"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " at "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\log(p) = \\log(0) = -\\infty"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and its maximum value of "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "r"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " at "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\log(p) = \\log(1) = 0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". Because the log-CDF has range "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "[-\\infty, 0]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", the inverse log-CDF is only defined on the negative reals; for "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\log(p) > 0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "ilogcdf",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.stats._probability_distribution:_ProbabilityDistribution.ilogcdf"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " returns "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "nan"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Occasionally, it is needed to find the argument of the CDF for which the resulting probability is very close to "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " or "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " - too close to represent accurately with floating point arithmetic. In many cases, however, the "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "logarithm"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " of this resulting probability may be represented in floating point arithmetic, in which case this function may be used to find the argument of the CDF for which the "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "logarithm"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " of the resulting probability is "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "y = \\log(p)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The \"logarithmic complement\" of a number "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "z"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is mathematically equivalent to "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\log(1-\\exp(z))"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", but it is computed to avoid loss of precision when "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\exp(z)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is nearly "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " or "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "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": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "out",
              "annotation": "array",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The inverse log-CDF evaluated at the provided argument."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Inverse of the logarithm of the cumulative distribution function."
            }
          ]
        }
      ],
      "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": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "logp",
              "annotation": "array_like",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The argument of the inverse log-CDF."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "method",
              "annotation": "{None, 'formula', 'complement', 'inversion'}",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The strategy used to evaluate the inverse log-CDF. By default ("
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "None"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "), the infrastructure chooses between the following options, listed in order of precedence."
                    }
                  ]
                },
                {
                  "__type": "BulletList",
                  "__tag": 4053,
                  "ordered": false,
                  "start": 1,
                  "children": [
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "'formula'"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ": use a formula for the inverse log-CDF itself"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "'complement'"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ": evaluate the inverse log-CCDF at the   logarithmic complement of "
                            },
                            {
                              "__type": "ParamRef",
                              "__tag": 4071,
                              "name": "logp"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " (see Notes)"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "'inversion'"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ": solve numerically for the argument at which the   log-CDF is equal to "
                            },
                            {
                              "__type": "ParamRef",
                              "__tag": 4071,
                              "name": "logp"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Not all "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "method"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " options are available for all distributions. If the selected "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "method"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is not available, a "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "NotImplementedError"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " will be raised."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The inverse of the logarithm of the cumulative distribution function (\"inverse log-CDF\") is the argument "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "x"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " for which the logarithm of the cumulative distribution function "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\log(F(x))"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " evaluates to "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\log(p)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Mathematically, it is equivalent to "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "F^{-1}(\\exp(y))"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", where "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "y = \\log(p)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", but it may be numerically favorable compared to the naive implementation (computing "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "p = \\exp(y)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", then "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "F^{-1}(p)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ")."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "ilogcdf",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.stats._probability_distribution:_ProbabilityDistribution.ilogcdf"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " accepts "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "logp"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " for "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\log(p) ≤ 0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "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/_probability_distribution.py",
  "item_line": 1541,
  "item_type": "function",
  "aliases": [
    "scipy.stats._distribution_infrastructure._ProbabilityDistribution.ilogcdf"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "Instantiate a distribution with the desired parameters:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nfrom scipy import stats\nX = stats.Uniform(a=-0.5, b=0.5)\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nEvaluate the inverse log-CDF at the desired argument:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "X.ilogcdf(-0.25)\n",
        "execution_status": "failure"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.allclose(X.ilogcdf(-0.25), X.icdf(np.exp(-0.25)))\n",
        "execution_status": "success"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "icdf",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.stats._probability_distribution:_ProbabilityDistribution.icdf"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": null
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "logcdf",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.stats._probability_distribution:_ProbabilityDistribution.logcdf"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": null
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "self",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_ONLY",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "logp",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_ONLY",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "method",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "ilogcdf"
  },
  "references": null,
  "qa": "scipy.stats._probability_distribution:_ProbabilityDistribution.ilogcdf",
  "arbitrary": [],
  "local_refs": [
    "logp",
    "method",
    "out"
  ]
}