@@ -890,10 +890,37 @@ def entropy(self) -> ArrayLike:
890890
891891
892892class Chi2 (Gamma ):
893+ r"""A chi-square continuous random variable, parameterized by the degrees of
894+ freedom :math:`k`.
895+
896+ The Probability Density Function (PDF) of the chi-square distribution with
897+ :math:`k` degrees of freedom is defined as:
898+
899+ .. math::
900+ f(x; k) = \frac{x^{k/2 - 1} e^{-x/2}}{2^{k/2}\,\Gamma(k/2)},
901+ \quad x > 0
902+
903+ Where, :math:`k` represents the degrees of freedom (:attr:`df`),
904+ :math:`\Gamma(\cdot)` is the gamma function, and :math:`x` is the observed value.
905+ The support domain is :math:`x \in (0, \infty)`.
906+
907+ The chi-square distribution is a special case of the Gamma distribution:
908+
909+ .. math::
910+ \chi^2(k) \equiv \mathrm{Gamma}(k/2,\; 1/2)
911+
912+ so this class inherits sampling, log-probability, mean, variance, and entropy
913+ implementations from :class:`Gamma`.
914+ """
915+
893916 arg_constraints = {"df" : constraints .positive }
894917 reparametrized_params = ["df" ]
895918
896919 def __init__ (self , df : ArrayLike , * , validate_args : Optional [bool ] = None ) -> None :
920+ r"""
921+ :param df: Degrees of freedom parameter :math:`k > 0` (:attr:`df`).
922+ :param validate_args: If True, enforce domain constraints during initialization.
923+ """
897924 self .df = df
898925 super (Chi2 , self ).__init__ (0.5 * df , 0.5 , validate_args = validate_args )
899926
0 commit comments