From 4b730b8753c7e03a9fed051d34914e53e613e173 Mon Sep 17 00:00:00 2001 From: Tanish Yelgoe <143334319+tanishy7777@users.noreply.github.com> Date: Wed, 13 Nov 2024 23:05:05 +0530 Subject: [PATCH 1/7] Update multivariate.py Updated the docstrings for better clarity. Replaced "log-likelihood" with "distribution" to accurately describe the functionality, as the class provides more than just log-likelihood, including cdf, mean, and random methods. --- pymc/distributions/multivariate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymc/distributions/multivariate.py b/pymc/distributions/multivariate.py index da10b12fa..9a927e7be 100644 --- a/pymc/distributions/multivariate.py +++ b/pymc/distributions/multivariate.py @@ -194,7 +194,7 @@ def quaddist_chol(value, mu, cov): class MvNormal(Continuous): r""" - Multivariate normal log-likelihood. + Multivariate normal distribution. .. math:: From eaa22ae25bd46ba12fc9443d104aeeacc143d486 Mon Sep 17 00:00:00 2001 From: Tanish Yelgoe <143334319+tanishy7777@users.noreply.github.com> Date: Wed, 27 Nov 2024 17:43:43 +0530 Subject: [PATCH 2/7] Update multivariate.py Updated the docstrings for better clarity. Replaced "log-likelihood" with "distribution" to accurately describe the functionality, as the class provides more than just log-likelihood, including mean, variance, covariance. --- pymc/distributions/multivariate.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pymc/distributions/multivariate.py b/pymc/distributions/multivariate.py index 9a927e7be..80dce87de 100644 --- a/pymc/distributions/multivariate.py +++ b/pymc/distributions/multivariate.py @@ -394,7 +394,7 @@ def rng_fn(cls, rng, nu, mu, cov, size): class MvStudentT(Continuous): r""" - Multivariate Student-T log-likelihood. + Multivariate Student-T distribution. .. math:: f(\mathbf{x}| \nu,\mu,\Sigma) = @@ -491,7 +491,7 @@ def logp(value, nu, mu, scale): class Dirichlet(SimplexContinuous): r""" - Dirichlet log-likelihood. + Dirichlet distribution. .. math:: @@ -563,7 +563,7 @@ def logp(value, a): class Multinomial(Discrete): r""" - Multinomial log-likelihood. + Multinomial distribution. Generalizes binomial distribution, but instead of each trial resulting in "success" or "failure", each one results in exactly one of some @@ -691,7 +691,7 @@ def rv_op(cls, n, a, *, size=None, rng=None): class DirichletMultinomial(Discrete): - r"""Dirichlet Multinomial log-likelihood. + r"""Dirichlet Multinomial distribution. Dirichlet mixture of Multinomials distribution, with a marginalized PMF. @@ -950,7 +950,7 @@ def rng_fn(cls, rng, nu, V, size): class Wishart(Continuous): r""" - Wishart log-likelihood. + Wishart distribution. The Wishart distribution is the probability distribution of the maximum-likelihood estimator (MLE) of the precision matrix of a @@ -1648,7 +1648,7 @@ def lkjcorr_default_transform(op, rv): class LKJCorr: r""" - The LKJ (Lewandowski, Kurowicka and Joe) log-likelihood. + The LKJ (Lewandowski, Kurowicka and Joe) distribution. The LKJ distribution is a prior distribution for correlation matrices. If eta = 1 this corresponds to the uniform distribution over correlation @@ -1753,7 +1753,7 @@ def rng_fn(cls, rng, mu, rowchol, colchol, size=None): class MatrixNormal(Continuous): r""" - Matrix-valued normal log-likelihood. + Matrix-valued normal distribution. .. math:: f(x \mid \mu, U, V) = @@ -1961,7 +1961,7 @@ def rv_op(cls, mu, sigma, *covs, size=None, rng=None): class KroneckerNormal(Continuous): r""" - Multivariate normal log-likelihood with Kronecker-structured covariance. + Multivariate normal distribution with Kronecker-structured covariance. .. math:: From 40001d25b7fce249141d19c7100b73c19608c2fb Mon Sep 17 00:00:00 2001 From: Tanish Yelgoe <143334319+tanishy7777@users.noreply.github.com> Date: Wed, 27 Nov 2024 21:42:01 +0530 Subject: [PATCH 3/7] Update continuous.py Updated the docstrings for better clarity. Replaced "log-likelihood" with "distribution" to accurately describe the functionality, as the class provides more than just log-likelihood, including mean, variance, covariance, etc. --- pymc/distributions/continuous.py | 60 ++++++++++++++++---------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/pymc/distributions/continuous.py b/pymc/distributions/continuous.py index 803418528..e8a0cccd9 100644 --- a/pymc/distributions/continuous.py +++ b/pymc/distributions/continuous.py @@ -246,7 +246,7 @@ def get_tau_sigma( class Uniform(BoundedContinuous): r""" - Continuous uniform log-likelihood. + Continuous uniform distribution. The pdf of this distribution is @@ -360,7 +360,7 @@ def rng_fn(cls, rng, size): class Flat(Continuous): - """Uninformative log-likelihood that returns 0 regardless of the passed value.""" + """Uninformative distribution that returns 0 regardless of the passed value.""" rv_op = flat @@ -417,7 +417,7 @@ def logcdf(value): class Normal(Continuous): r""" - Univariate normal log-likelihood. + Univariate normal distribution. The pdf of this distribution is @@ -558,7 +558,7 @@ def rng_fn( class TruncatedNormal(BoundedContinuous): r""" - Univariate truncated normal log-likelihood. + Univariate truncated normal distribution. The pdf of this distribution is @@ -745,7 +745,7 @@ def truncated_normal_default_transform(op, rv): class HalfNormal(PositiveContinuous): r""" - Half-normal log-likelihood. + Half-normal distribution. The pdf of this distribution is @@ -875,7 +875,7 @@ def rng_fn(cls, rng, mu, lam, alpha, size) -> np.ndarray: class Wald(PositiveContinuous): r""" - Wald log-likelihood. + Wald distribution. The pdf of this distribution is @@ -1055,7 +1055,7 @@ def rng_fn(cls, rng, alpha, beta, size) -> np.ndarray: class Beta(UnitContinuous): r""" - Beta log-likelihood. + Beta distribution. The pdf of this distribution is @@ -1241,7 +1241,7 @@ def rv_op(cls, a, b, *, size=None, rng=None): class Kumaraswamy(UnitContinuous): r""" - Kumaraswamy log-likelihood. + Kumaraswamy distribution. The pdf of this distribution is @@ -1331,7 +1331,7 @@ def logcdf(value, a, b): class Exponential(PositiveContinuous): r""" - Exponential log-likelihood. + Exponential distribution. The pdf of this distribution is @@ -1426,7 +1426,7 @@ def icdf(value, mu): class Laplace(Continuous): r""" - Laplace log-likelihood. + Laplace distribution. The pdf of this distribution is @@ -1548,7 +1548,7 @@ def rv_op(cls, b, kappa, mu, *, size=None, rng=None): class AsymmetricLaplace(Continuous): r""" - Asymmetric-Laplace log-likelihood. + Asymmetric-Laplace distribution. The pdf of this distribution is @@ -1639,7 +1639,7 @@ def logp(value, b, kappa, mu): class LogNormal(PositiveContinuous): r""" - Log-normal log-likelihood. + Log-normal distribution. Distribution of any random variable whose logarithm is normally distributed. A variable might be modeled as log-normal if it can @@ -1758,7 +1758,7 @@ def icdf(value, mu, sigma): class StudentT(Continuous): r""" - Student's T log-likelihood. + Student's T distribution. Describes a normal variable whose precision is gamma distributed. If only nu parameter is passed, this specifies a standard (central) @@ -1904,7 +1904,7 @@ def rng_fn(cls, rng, a, b, mu, sigma, size=None) -> np.ndarray: class SkewStudentT(Continuous): r""" - Skewed Student's T distribution log-likelihood. + Skewed Student's T distribution distribution. This follows Jones and Faddy (2003) @@ -2019,7 +2019,7 @@ def icdf(value, a, b, mu, sigma): class Pareto(BoundedContinuous): r""" - Pareto log-likelihood. + Pareto distribution. Often used to characterize wealth distribution, or other examples of the 80/20 rule. @@ -2128,7 +2128,7 @@ def pareto_default_transform(op, rv): class Cauchy(Continuous): r""" - Cauchy log-likelihood. + Cauchy distribution. Also known as the Lorentz or the Breit-Wigner distribution. @@ -2216,7 +2216,7 @@ def icdf(value, alpha, beta): class HalfCauchy(PositiveContinuous): r""" - Half-Cauchy log-likelihood. + Half-Cauchy distribution. The pdf of this distribution is @@ -2300,7 +2300,7 @@ def icdf(value, loc, beta): class Gamma(PositiveContinuous): r""" - Gamma log-likelihood. + Gamma distribution. Represents the sum of alpha exponentially distributed random variables, each of which has rate beta. @@ -2429,7 +2429,7 @@ def icdf(value, alpha, scale): class InverseGamma(PositiveContinuous): r""" - Inverse gamma log-likelihood, the reciprocal of the gamma distribution. + Inverse gamma distribution, the reciprocal of the gamma distribution. The pdf of this distribution is @@ -2545,7 +2545,7 @@ def logcdf(value, alpha, beta): class ChiSquared: r""" - :math:`\chi^2` log-likelihood. + :math:`\chi^2` distribution. This is the distribution from the sum of the squares of :math:`\nu` independent standard normal random variables or a special case of the gamma distribution with :math:`\alpha = \nu/2` and :math:`\beta = 1/2`. @@ -2617,7 +2617,7 @@ def rng_fn(cls, rng, alpha, beta, size) -> np.ndarray: class Weibull(PositiveContinuous): r""" - Weibull log-likelihood. + Weibull distribution. The pdf of this distribution is @@ -2738,7 +2738,7 @@ def rv_op(cls, nu, sigma, *, size=None, rng=None) -> np.ndarray: class HalfStudentT(PositiveContinuous): r""" - Half Student's T log-likelihood. + Half Student's T distribution. The pdf of this distribution is @@ -2859,7 +2859,7 @@ def rv_op(cls, mu, sigma, nu, *, size=None, rng=None): class ExGaussian(Continuous): r""" - Exponentially modified Gaussian log-likelihood. + Exponentially modified Gaussian distribution. Results from the convolution of a normal distribution with an exponential distribution. @@ -2982,7 +2982,7 @@ def logcdf(value, mu, sigma, nu): class VonMises(CircularContinuous): r""" - Univariate VonMises log-likelihood. + Univariate VonMises distribution. The pdf of this distribution is @@ -3068,7 +3068,7 @@ def rng_fn(cls, rng, mu, sigma, alpha, size=None) -> np.ndarray: class SkewNormal(Continuous): r""" - Univariate skew-normal log-likelihood. + Univariate skew-normal distribution. The pdf of this distribution is @@ -3163,7 +3163,7 @@ def logp(value, mu, sigma, alpha): class Triangular(BoundedContinuous): r""" - Continuous Triangular log-likelihood. + Continuous Triangular distribution. The pdf of this distribution is @@ -3292,7 +3292,7 @@ def triangular_default_transform(op, rv): class Gumbel(Continuous): r""" - Univariate right-skewed Gumbel log-likelihood. + Univariate right-skewed Gumbel distribution. This distribution is typically used for modeling maximum (or extreme) values. Those looking to find the extreme minimum provided by the left-skewed Gumbel should @@ -3519,7 +3519,7 @@ def logp(value, b, sigma): class Logistic(Continuous): r""" - Logistic log-likelihood. + Logistic distribution. The pdf of this distribution is @@ -3627,7 +3627,7 @@ def rv_op(cls, mu, sigma, *, size=None, rng=None): class LogitNormal(UnitContinuous): r""" - Logit-Normal log-likelihood. + Logit-Normal distribution. The pdf of this distribution is @@ -3872,7 +3872,7 @@ def rng_fn(cls, rng, mu, sigma, size=None) -> np.ndarray: class Moyal(Continuous): r""" - Moyal log-likelihood. + Moyal distribution. The pdf of this distribution is From 77cab6e2ba9f4e1360f2fd86aa37a989fe6a6218 Mon Sep 17 00:00:00 2001 From: Tanish Yelgoe <143334319+tanishy7777@users.noreply.github.com> Date: Wed, 27 Nov 2024 21:46:54 +0530 Subject: [PATCH 4/7] Update discrete.py Updated the docstrings for better clarity. Replaced "log-likelihood" with "distribution" to accurately describe the functionality, as the class provides more than just log-likelihood, including mean, variance, covariance. --- pymc/distributions/discrete.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pymc/distributions/discrete.py b/pymc/distributions/discrete.py index 179bae25f..b0d23a99a 100644 --- a/pymc/distributions/discrete.py +++ b/pymc/distributions/discrete.py @@ -71,7 +71,7 @@ class Binomial(Discrete): R""" - Binomial log-likelihood. + Binomial distribution. The discrete probability distribution of the number of successes in a sequence of n independent yes/no experiments, each of which @@ -176,7 +176,7 @@ def logcdf(value, n, p): class BetaBinomial(Discrete): R""" - Beta-binomial log-likelihood. + Beta-binomial distribution. Equivalent to binomial random variable with success probability drawn from a beta distribution. @@ -293,7 +293,7 @@ def logcdf(value, n, alpha, beta): class Bernoulli(Discrete): - R"""Bernoulli log-likelihood. + R"""Bernoulli distribution. The Bernoulli distribution describes the probability of successes (x=1) and failures (x=0). @@ -413,7 +413,7 @@ def rv_op(cls, q, beta, *, size=None, rng=None): class DiscreteWeibull(Discrete): - R"""Discrete Weibull log-likelihood. + R"""Discrete Weibull distribution. The discrete Weibull distribution is a flexible model of count data that can handle both over- and under-dispersion. @@ -506,7 +506,7 @@ def logcdf(value, q, beta): class Poisson(Discrete): R""" - Poisson log-likelihood. + Poisson distribution. Often used to model the number of events occurring in a fixed period of time when the times at which events occur are independent. @@ -602,7 +602,7 @@ def logcdf(value, mu): class NegativeBinomial(Discrete): R""" - Negative binomial log-likelihood. + Negative binomial distribution. The negative binomial distribution describes a Poisson random variable whose rate parameter is gamma distributed. @@ -750,7 +750,7 @@ def logcdf(value, n, p): class Geometric(Discrete): R""" - Geometric log-likelihood. + Geometric distribution. The probability that the first success in a sequence of Bernoulli trials occurs on the x'th trial. @@ -1084,7 +1084,7 @@ def icdf(value, lower, upper): class Categorical(Discrete): R""" - Categorical log-likelihood. + Categorical distribution. The most general discrete distribution. The pmf of this distribution is From ce38886863d9769bd9a628fa459eaf22a38556f3 Mon Sep 17 00:00:00 2001 From: Tanish Yelgoe <143334319+tanishy7777@users.noreply.github.com> Date: Wed, 27 Nov 2024 21:49:37 +0530 Subject: [PATCH 5/7] Update distribution.py Updated the docstrings for better clarity. Replaced "log-likelihood" with "distribution" to accurately describe the functionality, as the class provides more than just log-likelihood including log-cdf, log-pdf. --- pymc/distributions/distribution.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymc/distributions/distribution.py b/pymc/distributions/distribution.py index 8e55f649d..a76857227 100644 --- a/pymc/distributions/distribution.py +++ b/pymc/distributions/distribution.py @@ -668,7 +668,7 @@ def rv_op(cls, c, *, size=None, rng=None): class DiracDelta(Discrete): r""" - DiracDelta log-likelihood. + DiracDelta distribution. Parameters ---------- From d24ee39d9762a20695ee26467e038e9dcaaa5519 Mon Sep 17 00:00:00 2001 From: Tanish Yelgoe <143334319+tanishy7777@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:53:59 +0530 Subject: [PATCH 6/7] Update mixture.py Updated the docstrings for better clarity. Replaced "log-likelihood" with "distribution" to accurately describe the functionality, as the class provides more than just log-likelihood, including mean, variance and covariance. --- pymc/distributions/mixture.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pymc/distributions/mixture.py b/pymc/distributions/mixture.py index dc704e512..125dc3c1e 100644 --- a/pymc/distributions/mixture.py +++ b/pymc/distributions/mixture.py @@ -57,7 +57,7 @@ class MarginalMixtureRV(SymbolicRandomVariable): - """A placeholder used to specify a log-likelihood for a mixture sub-graph.""" + """A placeholder used to specify a distribution for a mixture sub-graph.""" _print_name = ("MarginalMixture", "\\operatorname{MarginalMixture}") @@ -163,7 +163,7 @@ def update(self, node: Apply): class Mixture(Distribution): R""" - Mixture log-likelihood. + Mixture distribution. Often used to model subpopulation heterogeneity @@ -493,7 +493,7 @@ def mixture_args_fn(rng, weights, *components): class NormalMixture: R""" - Normal mixture log-likelihood. + Normal mixture distribution. .. math:: @@ -573,7 +573,7 @@ def _zero_inflated_mixture(*, name, nonzero_p, nonzero_dist, **kwargs): class ZeroInflatedPoisson: R""" - Zero-inflated Poisson log-likelihood. + Zero-inflated Poisson distribution. Often used to model the number of events occurring in a fixed period of time when the times at which events occur are independent. @@ -637,7 +637,7 @@ def dist(cls, psi, mu, **kwargs): class ZeroInflatedBinomial: R""" - Zero-inflated Binomial log-likelihood. + Zero-inflated Binomial distribution. The pmf of this distribution is @@ -701,7 +701,7 @@ def dist(cls, psi, n, p, **kwargs): class ZeroInflatedNegativeBinomial: R""" - Zero-Inflated Negative binomial log-likelihood. + Zero-Inflated Negative binomial distribution. The Zero-inflated version of the Negative Binomial (NB). The NB distribution describes a Poisson random variable @@ -831,7 +831,7 @@ def _hurdle_mixture(*, name, nonzero_p, nonzero_dist, dtype, max_n_steps=10_000, class HurdlePoisson: R""" - Hurdle Poisson log-likelihood. + Hurdle Poisson distribution. The Poisson distribution is often used to model the number of events occurring in a fixed period of time or space when the times or locations @@ -877,7 +877,7 @@ def dist(cls, psi, mu, **kwargs): class HurdleNegativeBinomial: R""" - Hurdle Negative Binomial log-likelihood. + Hurdle Negative Binomial distribution. The negative binomial distribution describes a Poisson random variable whose rate parameter is gamma distributed. @@ -935,7 +935,7 @@ def dist(cls, psi, mu=None, alpha=None, p=None, n=None, **kwargs): class HurdleGamma: R""" - Hurdle Gamma log-likelihood. + Hurdle Gamma distribution. .. math:: @@ -987,7 +987,7 @@ def dist(cls, psi, alpha=None, beta=None, mu=None, sigma=None, **kwargs): class HurdleLogNormal: R""" - Hurdle LogNormal log-likelihood. + Hurdle LogNormal distribution. .. math:: From e79f4315137b963c20b236c00f95d83a545e710e Mon Sep 17 00:00:00 2001 From: Tanish Yelgoe <143334319+tanishy7777@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:56:29 +0530 Subject: [PATCH 7/7] Update timeseries.py Updated the docstrings for better clarity. Replaced "log-likelihood" with "distribution" to accurately describe the functionality. --- pymc/distributions/timeseries.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pymc/distributions/timeseries.py b/pymc/distributions/timeseries.py index 6469cd101..e9095cd0d 100644 --- a/pymc/distributions/timeseries.py +++ b/pymc/distributions/timeseries.py @@ -419,7 +419,7 @@ def get_dists( class AutoRegressiveRV(SymbolicRandomVariable): - """A placeholder used to specify a log-likelihood for an AR sub-graph.""" + """A placeholder used to specify a distribution for an AR sub-graph.""" extended_signature = "(o),(),(o),(s),[rng]->[rng],(t)" ar_order: int @@ -865,7 +865,7 @@ def garch11_support_point(op, rv, omega, alpha_1, beta_1, initial_vol, init_dist class EulerMaruyamaRV(SymbolicRandomVariable): - """A placeholder used to specify a log-likelihood for a EulerMaruyama sub-graph.""" + """A placeholder used to specify a distribution for a EulerMaruyama sub-graph.""" dt: float sde_fn: Callable