diff --git a/docs/examples/img/AsymmetricLaplace.png b/docs/examples/img/AsymmetricLaplace.png index caf57aad..116c5caf 100644 Binary files a/docs/examples/img/AsymmetricLaplace.png and b/docs/examples/img/AsymmetricLaplace.png differ diff --git a/docs/examples/img/Bernoulli.png b/docs/examples/img/Bernoulli.png index 3c7547bd..d690722b 100644 Binary files a/docs/examples/img/Bernoulli.png and b/docs/examples/img/Bernoulli.png differ diff --git a/docs/examples/img/Beta.png b/docs/examples/img/Beta.png index 813bf2c7..e495ee41 100644 Binary files a/docs/examples/img/Beta.png and b/docs/examples/img/Beta.png differ diff --git a/docs/examples/img/BetaBinomial.png b/docs/examples/img/BetaBinomial.png index 85bbcab2..32f0a0df 100644 Binary files a/docs/examples/img/BetaBinomial.png and b/docs/examples/img/BetaBinomial.png differ diff --git a/docs/examples/img/BetaScaled.png b/docs/examples/img/BetaScaled.png index 2f81a37d..fb74e0e9 100644 Binary files a/docs/examples/img/BetaScaled.png and b/docs/examples/img/BetaScaled.png differ diff --git a/docs/examples/img/Binomial.png b/docs/examples/img/Binomial.png index 78e74d38..919d78d4 100644 Binary files a/docs/examples/img/Binomial.png and b/docs/examples/img/Binomial.png differ diff --git a/docs/examples/img/Categorical.png b/docs/examples/img/Categorical.png index e19fbf93..556d20c0 100644 Binary files a/docs/examples/img/Categorical.png and b/docs/examples/img/Categorical.png differ diff --git a/docs/examples/img/Cauchy.png b/docs/examples/img/Cauchy.png index b1f4f3e5..e90eac05 100644 Binary files a/docs/examples/img/Cauchy.png and b/docs/examples/img/Cauchy.png differ diff --git a/docs/examples/img/Censored.png b/docs/examples/img/Censored.png index 335d877d..a00ad4d4 100644 Binary files a/docs/examples/img/Censored.png and b/docs/examples/img/Censored.png differ diff --git a/docs/examples/img/ChiSquared.png b/docs/examples/img/ChiSquared.png index 7c8b44e6..14c83765 100644 Binary files a/docs/examples/img/ChiSquared.png and b/docs/examples/img/ChiSquared.png differ diff --git a/docs/examples/img/DiscreteUniform.png b/docs/examples/img/DiscreteUniform.png index 629af509..25bf3f2a 100644 Binary files a/docs/examples/img/DiscreteUniform.png and b/docs/examples/img/DiscreteUniform.png differ diff --git a/docs/examples/img/DiscreteWeibull.png b/docs/examples/img/DiscreteWeibull.png index b100c26e..069ba67a 100644 Binary files a/docs/examples/img/DiscreteWeibull.png and b/docs/examples/img/DiscreteWeibull.png differ diff --git a/docs/examples/img/ExGaussian.png b/docs/examples/img/ExGaussian.png index 325f4c3d..b309eb13 100644 Binary files a/docs/examples/img/ExGaussian.png and b/docs/examples/img/ExGaussian.png differ diff --git a/docs/examples/img/Exponential.png b/docs/examples/img/Exponential.png index 96f04ce8..850bc6a3 100644 Binary files a/docs/examples/img/Exponential.png and b/docs/examples/img/Exponential.png differ diff --git a/docs/examples/img/Gamma.png b/docs/examples/img/Gamma.png index a6a3e7f7..bc97b7eb 100644 Binary files a/docs/examples/img/Gamma.png and b/docs/examples/img/Gamma.png differ diff --git a/docs/examples/img/Geometric.png b/docs/examples/img/Geometric.png index d45bf63a..e0250b9a 100644 Binary files a/docs/examples/img/Geometric.png and b/docs/examples/img/Geometric.png differ diff --git a/docs/examples/img/Gumbel.png b/docs/examples/img/Gumbel.png index 97db5a95..80f74237 100644 Binary files a/docs/examples/img/Gumbel.png and b/docs/examples/img/Gumbel.png differ diff --git a/docs/examples/img/HalfCauchy.png b/docs/examples/img/HalfCauchy.png index dcd28dce..a51f0d0e 100644 Binary files a/docs/examples/img/HalfCauchy.png and b/docs/examples/img/HalfCauchy.png differ diff --git a/docs/examples/img/HalfNormal.png b/docs/examples/img/HalfNormal.png index f63fca26..28679eb7 100644 Binary files a/docs/examples/img/HalfNormal.png and b/docs/examples/img/HalfNormal.png differ diff --git a/docs/examples/img/HalfStudentT.png b/docs/examples/img/HalfStudentT.png index 5d968aa0..fa053476 100644 Binary files a/docs/examples/img/HalfStudentT.png and b/docs/examples/img/HalfStudentT.png differ diff --git a/docs/examples/img/Hurdle.png b/docs/examples/img/Hurdle.png index 63f10bbd..ec0926ea 100644 Binary files a/docs/examples/img/Hurdle.png and b/docs/examples/img/Hurdle.png differ diff --git a/docs/examples/img/HyperGeometric.png b/docs/examples/img/HyperGeometric.png index 889d6f2f..2f857501 100644 Binary files a/docs/examples/img/HyperGeometric.png and b/docs/examples/img/HyperGeometric.png differ diff --git a/docs/examples/img/InverseGamma.png b/docs/examples/img/InverseGamma.png index c1fa645b..aa1be710 100644 Binary files a/docs/examples/img/InverseGamma.png and b/docs/examples/img/InverseGamma.png differ diff --git a/docs/examples/img/Kumaraswamy.png b/docs/examples/img/Kumaraswamy.png index a8b0afff..2a783acb 100644 Binary files a/docs/examples/img/Kumaraswamy.png and b/docs/examples/img/Kumaraswamy.png differ diff --git a/docs/examples/img/Laplace.png b/docs/examples/img/Laplace.png index 2bd2cc0b..bc92516e 100644 Binary files a/docs/examples/img/Laplace.png and b/docs/examples/img/Laplace.png differ diff --git a/docs/examples/img/LogLogistic.png b/docs/examples/img/LogLogistic.png index 4a87b7ad..1d18ef6a 100644 Binary files a/docs/examples/img/LogLogistic.png and b/docs/examples/img/LogLogistic.png differ diff --git a/docs/examples/img/LogNormal.png b/docs/examples/img/LogNormal.png index 0b884cbc..65bfece4 100644 Binary files a/docs/examples/img/LogNormal.png and b/docs/examples/img/LogNormal.png differ diff --git a/docs/examples/img/Logistic.png b/docs/examples/img/Logistic.png index b5f696dd..85b47b63 100644 Binary files a/docs/examples/img/Logistic.png and b/docs/examples/img/Logistic.png differ diff --git a/docs/examples/img/LogitNormal.png b/docs/examples/img/LogitNormal.png index ccb6f456..c1244af9 100644 Binary files a/docs/examples/img/LogitNormal.png and b/docs/examples/img/LogitNormal.png differ diff --git a/docs/examples/img/Moyal.png b/docs/examples/img/Moyal.png index 63d83131..9af044f9 100644 Binary files a/docs/examples/img/Moyal.png and b/docs/examples/img/Moyal.png differ diff --git a/docs/examples/img/NegativeBinomial.png b/docs/examples/img/NegativeBinomial.png index 2e883e5f..b7ceeb6d 100644 Binary files a/docs/examples/img/NegativeBinomial.png and b/docs/examples/img/NegativeBinomial.png differ diff --git a/docs/examples/img/Normal.png b/docs/examples/img/Normal.png index 08714b55..09328a52 100644 Binary files a/docs/examples/img/Normal.png and b/docs/examples/img/Normal.png differ diff --git a/docs/examples/img/Pareto.png b/docs/examples/img/Pareto.png index dbd09d44..591c0ae4 100644 Binary files a/docs/examples/img/Pareto.png and b/docs/examples/img/Pareto.png differ diff --git a/docs/examples/img/Poisson.png b/docs/examples/img/Poisson.png index cc1e877b..21cc544e 100644 Binary files a/docs/examples/img/Poisson.png and b/docs/examples/img/Poisson.png differ diff --git a/docs/examples/img/Rice.png b/docs/examples/img/Rice.png index 391544e1..20adf49e 100644 Binary files a/docs/examples/img/Rice.png and b/docs/examples/img/Rice.png differ diff --git a/docs/examples/img/SkewNormal.png b/docs/examples/img/SkewNormal.png index 312b4d68..81d9625d 100644 Binary files a/docs/examples/img/SkewNormal.png and b/docs/examples/img/SkewNormal.png differ diff --git a/docs/examples/img/SkewStudentT.png b/docs/examples/img/SkewStudentT.png index 703aabd9..d819134a 100644 Binary files a/docs/examples/img/SkewStudentT.png and b/docs/examples/img/SkewStudentT.png differ diff --git a/docs/examples/img/StudentT.png b/docs/examples/img/StudentT.png index 3138dd01..f8c19c69 100644 Binary files a/docs/examples/img/StudentT.png and b/docs/examples/img/StudentT.png differ diff --git a/docs/examples/img/Triangular.png b/docs/examples/img/Triangular.png index d5abf012..53fd637e 100644 Binary files a/docs/examples/img/Triangular.png and b/docs/examples/img/Triangular.png differ diff --git a/docs/examples/img/Truncated.png b/docs/examples/img/Truncated.png index ee1d8d82..5ac1690c 100644 Binary files a/docs/examples/img/Truncated.png and b/docs/examples/img/Truncated.png differ diff --git a/docs/examples/img/TruncatedNormal.png b/docs/examples/img/TruncatedNormal.png index 8a1507f0..9d5f3e9a 100644 Binary files a/docs/examples/img/TruncatedNormal.png and b/docs/examples/img/TruncatedNormal.png differ diff --git a/docs/examples/img/Uniform.png b/docs/examples/img/Uniform.png index 00449204..2138145f 100644 Binary files a/docs/examples/img/Uniform.png and b/docs/examples/img/Uniform.png differ diff --git a/docs/examples/img/VonMises.png b/docs/examples/img/VonMises.png index a148e110..f1a6cd89 100644 Binary files a/docs/examples/img/VonMises.png and b/docs/examples/img/VonMises.png differ diff --git a/docs/examples/img/Wald.png b/docs/examples/img/Wald.png index 1f3ac085..f8e69450 100644 Binary files a/docs/examples/img/Wald.png and b/docs/examples/img/Wald.png differ diff --git a/docs/examples/img/Weibull.png b/docs/examples/img/Weibull.png index 2df5cef6..23892ac7 100644 Binary files a/docs/examples/img/Weibull.png and b/docs/examples/img/Weibull.png differ diff --git a/docs/examples/img/ZeroInflatedBinomial.png b/docs/examples/img/ZeroInflatedBinomial.png index 28158793..5df057fb 100644 Binary files a/docs/examples/img/ZeroInflatedBinomial.png and b/docs/examples/img/ZeroInflatedBinomial.png differ diff --git a/docs/examples/img/ZeroInflatedNegativeBinomial.png b/docs/examples/img/ZeroInflatedNegativeBinomial.png index 6dc961cb..2fa82387 100644 Binary files a/docs/examples/img/ZeroInflatedNegativeBinomial.png and b/docs/examples/img/ZeroInflatedNegativeBinomial.png differ diff --git a/docs/examples/img/ZeroInflatedPoisson.png b/docs/examples/img/ZeroInflatedPoisson.png index 0d92728d..dae515b1 100644 Binary files a/docs/examples/img/ZeroInflatedPoisson.png and b/docs/examples/img/ZeroInflatedPoisson.png differ diff --git a/docs/get_cover_gallery.py b/docs/get_cover_gallery.py index 35a5d41a..fd38d97d 100644 --- a/docs/get_cover_gallery.py +++ b/docs/get_cover_gallery.py @@ -12,9 +12,10 @@ rng = np.random.default_rng(247) init_vals["Hurdle"] = None +init_vals["SkewStudentT"] = {"mu": 0.0, "sigma": 1, "a": 2.5, "b": 1.5} for name, params in init_vals.items(): color = f"C{rng.integers(0, 4)}" - _, ax = plt.subplots(figsize=(6, 4)) + _, ax = plt.subplots(figsize=(3.5, 2.3)) dist = getattr(distributions, name) if name in ["Truncated", "Censored"]: dist(Gamma(mu=2, sigma=1), -np.inf, 2).plot_pdf(legend=False, ax=ax, color=color) @@ -42,5 +43,78 @@ ax.set_xticks([]) ax.set_yticks([]) - ax.spines[["left", "bottom"]].set_visible(False) + ax.spines[["left"]].set_visible(False) + + if name in ["Categorical"]: + ax.set_xticks([0, 1, 2], labels=["♣", "♥", "♦"]) + else: + if name in ["BetaScaled", "Truncated", "Censored", "Pareto"]: + l_b, u_b = (-np.inf, np.inf) + elif name == "Hurdle": + l_b, u_b = (0, np.inf) + else: + l_b, u_b = dist().support + + if l_b == -np.inf: + l_b = None + if u_b == np.inf: + u_b = None + + pos = ax.get_ylim()[0] + + # The boundaries depended on the parameterization + if name in [ + "BetaScaled", + "TruncatedNormal", + "Triangular", + "Uniform", + "Binomial", + "BetaBinomial", + "DiscreteUniform", + "HyperGeometric", + "Censored", + "Hurdle", + "Truncated", + ]: + marker_0 = marker_1 = "*" + elif name == "Pareto": + marker_0 = "*" + marker_1 = ">" + else: + marker_0 = "<" + marker_1 = ">" + + if l_b is None: + ax.plot( + 0, + pos, + color="k", + marker=marker_0, + transform=ax.get_yaxis_transform(), + clip_on=False, + zorder=3, + ) + if u_b is None: + ax.plot( + 1, + pos, + color="k", + marker=marker_1, + transform=ax.get_yaxis_transform(), + clip_on=False, + zorder=3, + ) + + if name == "VonMises": + ax.set_xticks([l_b, u_b], labels=["$-\pi$", "$\pi$"]) + + if l_b is not None and u_b is not None: + ax.set_xticks([l_b, u_b]) + elif l_b is not None and u_b is None: + ax.set_xticks([l_b]) + elif l_b is None and u_b is not None: + ax.set_xticks([u_b]) + + ax.spines["bottom"].set_position(("data", pos)) + plt.savefig(f"examples/img/{name}.png") diff --git a/preliz/internal/distribution_helper.py b/preliz/internal/distribution_helper.py index da2b97e2..10351d6a 100644 --- a/preliz/internal/distribution_helper.py +++ b/preliz/internal/distribution_helper.py @@ -97,7 +97,7 @@ def process_extra(input_string): "Pareto": {"alpha": 5, "m": 2.0}, "Rice": {"nu": 2.0, "sigma": 1.0}, "SkewNormal": {"mu": 0.0, "sigma": 1, "alpha": 6.0}, - "SkewStudentT": {"mu": 0.0, "sigma": 1, "a": 2.0, "b": 2.0}, + "SkewStudentT": {"mu": 0.0, "sigma": 1, "a": 2, "b": 2}, "StudentT": {"nu": 7, "mu": 0.0, "sigma": 1}, "Triangular": {"lower": -2, "c": 0.0, "upper": 2.0}, "TruncatedNormal": {"mu": 0.0, "sigma": 1, "lower": -2, "upper": 3.0},