{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "%(_matt_doc_callparams_note)s"
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The spread matrices specified by "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "row_spread",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "col_spread",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " must be (symmetric) positive definite. If the samples in "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "X",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " have shape "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "(m,n)",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " then "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "row_spread",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " must have shape "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "(m,m)",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "col_spread",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " must have shape "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "(n,n)",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". Spread matrices must be full rank."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The probability density function for "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "matrix_t",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": "f(X \\vert \\mathrm{M}, \\Sigma, \\Omega, \\mathrm{df}) =\n\\frac{\n    \\Gamma_n \\left(\n        \\frac{\\mathrm{df} + m + n - 1}{2}\n    \\right)\n    \\left(\n    \\det \\left(\n        I_n + (X - \\mathrm{M})^T \\Sigma^{-1} (X - \\mathrm{M}) \\Omega^{-1}\n    \\right)\n\\right)^{ -\\frac{\\mathrm{df} + m + n - 1}{2} }\n}{\n    \\Gamma_n \\left(\n        \\frac{\\mathrm{df} + n - 1}{2}\n    \\right)\n    \\pi^{mn / 2}\n    \\left( \\det \\Sigma \\right)^{n/2}\n    \\left( \\det \\Omega \\right)^{m/2}\n}"
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "or, alternatively,"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": "f(X \\vert \\mathrm{M}, \\Sigma, \\Omega, \\mathrm{df}) =\n\\frac{\n    \\Gamma_m \\left(\n        \\frac{\\mathrm{df} + m + n - 1}{2}\n    \\right)\n    \\left(\n        \\det \\left(\n            I_m + \\Sigma^{-1} (X - \\mathrm{M}) \\Omega^{-1} (X - \\mathrm{M})^T\n            \\right)\n    \\right)^{ -\\frac{\\mathrm{df} + m + n - 1}{2} }\n}{\n    \\Gamma_m \\left(\n        \\frac{\\mathrm{df} + n - 1}{2}\n    \\right)\n    \\pi^{mn / 2}\n    \\left( \\det \\Sigma \\right)^{n/2}\n    \\left( \\det \\Omega \\right)^{m/2}\n}"
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "where "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\mathrm{M}"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the mean, "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\Sigma"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the row-wise spread matrix, "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\Omega"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the column-wise matrix, "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\mathrm{df}"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the degrees of freedom, and "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\Gamma_n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the multivariate gamma function."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "These equivalent formulations come from the identity"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": "\\det\\left( I_m + A B \\right) = \\det\\left( I_n + B A \\right)"
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "for "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "m \\times n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " arrays "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "A"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "B^T"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and the fact that "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\gamma_n(\\mathrm{df} + m) / \\gamma_n(\\mathrm{df})"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is equal to "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\gamma_m(\\mathrm{df} + n) / \\gamma_m(\\mathrm{df})"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", where"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": "\\gamma_m(\\mathrm{df}) = 2^{m(m-1)/2}\n\\Gamma_m\\left( (\\mathrm{df} + m - 1) / 2 \\right)"
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "denotes a normalized multivariate gamma function."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "When "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\mathrm{df} = 1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " this distribution is known as the matrix variate Cauchy."
            }
          ]
        },
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "versionadded",
          "base_type": "neutral",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "versionadded 1.17.0"
                }
              ]
            }
          ]
        }
      ],
      "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": "pdf(x, mean=None, row_spread=None, col_spread=None)",
              "annotation": "",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Probability density function."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "logpdf(x, mean=None, row_spread=None, col_spread=None)",
              "annotation": "",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Log of the probability density function."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "rvs(mean=None, row_spread=1, col_spread=1, df=1, size=1, random_state=None)",
              "annotation": "",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Draw random samples."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "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 matrix t-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": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "%(_matt_doc_default_callparams)s",
              "annotation": "",
              "desc": []
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "%(_doc_random_state)s",
              "annotation": "",
              "desc": []
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "mean",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " keyword specifies the mean. The "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "row_spread",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " keyword specifies the row-wise spread matrix. The "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "col_spread",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " keyword specifies the column-wise spread matrix."
            }
          ]
        }
      ],
      "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/_multivariate.py",
  "item_line": 1579,
  "item_type": "class",
  "aliases": [
    "scipy.stats._multivariate.matrix_t_gen"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nfrom scipy.stats import matrix_t\nM = np.arange(6).reshape(3,2)\nM\nSigma = np.diag([1,2,3])\nSigma\nOmega = 0.3*np.identity(2)\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "Omega\n",
        "execution_status": "failure"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "X = M + 0.1\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "X\n",
        "execution_status": "failure"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "df = 3\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "matrix_t.pdf(X, mean=M, row_spread=Sigma, col_spread=Omega, df=df)\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nAlternatively, the object may be called (as a function) to fix the mean\nand spread parameters, returning a \"frozen\" matrix t\nrandom variable:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "rv = matrix_t(mean=None, row_spread=1, col_spread=1, df=1)\n",
        "execution_status": "success"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__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": "matrix_t_gen"
  },
  "references": [
    ".. [1] Gupta, A.K., & Nagar, D.K. (2000). Matrix Variate Distributions (1st ed.).",
    "       Chapman and Hall/CRC."
  ],
  "qa": "scipy.stats._multivariate:matrix_t_gen",
  "arbitrary": [],
  "local_refs": [
    "%(_doc_random_state)s",
    "%(_matt_doc_default_callparams)s",
    "col_spread=1",
    "col_spread=None)",
    "df=1",
    "logpdf(x",
    "mean=None",
    "pdf(x",
    "random_state=None)",
    "row_spread=1",
    "row_spread=None",
    "rvs(mean=None",
    "size=1"
  ]
}