{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {},
  "_ordered_sections": [],
  "item_file": null,
  "item_line": null,
  "item_type": null,
  "aliases": [],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": null,
  "references": null,
  "qa": "tutorial:stats:continuous_nakagami",
  "arbitrary": [
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Generalization of the chi distribution. Shape parameter is "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\nu>0."
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " The support is "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "x\\geq0."
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": ""
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "where "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\gamma"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the lower incomplete gamma function, "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\gamma\\left(\\nu, x\\right) = \\int_0^x t^{\\nu-1} e^{-t} dt"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": ""
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Implementation: "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "scipy.stats.nakagami",
              "domain": null,
              "role": null,
              "inventory": null
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Nakagami Distribution"
        }
      ],
      "level": 0,
      "target": "continuous-nakagami"
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The probability density function of the "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "nakagami",
              "domain": null,
              "role": "code",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " distribution in SciPy is"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": ""
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "for "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "x"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " such that "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\frac{x-\\mu}{\\sigma} \\geq 0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", where "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\nu \\geq \\frac{1}{2}"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the shape parameter, "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\mu"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the location, and "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\sigma"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the scale."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The log-likelihood function is therefore"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": ""
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "which can be expanded as"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": ""
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Leaving supports constraints out, the first-order condition for optimality on the likelihood derivatives gives estimates of parameters:"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": ""
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "where "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\psi^{(0)}"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the polygamma function of order "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "; i.e. "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\psi^{(0)}(\\nu) = \\frac{d}{d\\nu} \\log \\Gamma(\\nu)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "However, the support of the distribution is the values of "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "x"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " for which "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\frac{x-\\mu}{\\sigma} \\geq 0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", and this provides an additional constraint that"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": ""
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "For "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\nu = \\frac{1}{2}"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", the partial derivative of the log-likelihood with respect to "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\mu"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " reduces to:"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": ""
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "which is positive when the support constraint is satisfied. Because the partial derivative with respect to "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\mu"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is positive, increasing "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\mu"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " increases the log-likelihood, and therefore the constraint is active at the maximum likelihood estimate for "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\mu"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": ""
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "For "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\nu"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " sufficiently greater than "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\frac{1}{2}"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", the likelihood equation "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\frac{\\partial l}{\\partial \\mu}(\\nu, \\mu, \\sigma)=0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " has a solution, and this solution provides the maximum likelihood estimate for "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\mu"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". In either case, however, the condition "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\mu = \\min_i{x_i}"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " provides a reasonable initial guess for numerical optimization."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Furthermore, the likelihood equation for "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "\\sigma"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " can be solved explicitly, and it provides the maximum likelihood estimate"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": ""
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Hence, the "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "_fitstart",
              "domain": null,
              "role": "code",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " method for "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "nakagami",
              "domain": null,
              "role": "code",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " uses"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": ""
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "as initial guesses for numerical optimization accordingly."
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "MLE of the Nakagami Distribution in SciPy ("
        },
        {
          "__type": "InlineRole",
          "__tag": 4003,
          "value": "nakagami.fit",
          "domain": null,
          "role": "code",
          "inventory": null
        },
        {
          "__type": "Text",
          "__tag": 4046,
          "value": ")"
        }
      ],
      "level": 1,
      "target": null
    }
  ],
  "local_refs": []
}