Distributions
These are the supported distributions based on the conjugate models.
Many have the dist attribute which is a scipy.stats distribution object. From there,
you can use the methods from scipy.stats to get the pdf, cdf, etc.
Distributions can be plotted using the plot_pmf or plot_pdf methods of the distribution.
from conjugate.distribution import Beta
beta = Beta(1, 1)
scipy_dist = beta.dist
print(scipy_dist.mean())
# 0.5
print(scipy_dist.ppf([0.025, 0.975]))
# [0.025 0.975]
samples = scipy_dist.rvs(100)
beta.plot_pmf(label="beta distribution")
Distributions like Poisson can be added with other Poissons or multiplied by numerical values in order to scale rate. For instance,
daily_rate = 0.25
daily_pois = Poisson(lam=daily_rate)
two_day_pois = daily_pois + daily_pois
weekly_pois = 7 * daily_pois
Below are the currently supported distributions
Bernoulli
dataclass
Bases: DiscretePlotMixin, SliceMixin
Bernoulli distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p
|
Probability
|
probability of success |
required |
Source code in conjugate/distributions.py
Beta
dataclass
Bases: ContinuousPlotDistMixin, SliceMixin
Beta distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alpha
|
PositiveReal
|
shape parameter |
required |
beta
|
PositiveReal
|
shape parameter |
required |
Source code in conjugate/distributions.py
from_mean(mean, alpha)
classmethod
Alternative constructor from mean and alpha.
from_successes_and_failures(successes, failures)
classmethod
Alternative constructor based on hyperparameter interpretation.
Source code in conjugate/distributions.py
BetaBinomial
dataclass
Bases: DiscretePlotMixin, SliceMixin
Beta binomial distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Natural
|
number of trials |
required |
alpha
|
PositiveReal
|
shape parameter |
required |
beta
|
PositiveReal
|
shape parameter |
required |
Source code in conjugate/distributions.py
BetaGeometric
dataclass
Bases: DiscretePlotMixin, SliceMixin
Beta geometric distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alpha
|
PositiveReal
|
shape parameter |
required |
beta
|
PositiveReal
|
shape parameter |
required |
one_start
|
bool
|
whether to start at 1 or 0. Default is 1. |
True
|
Source code in conjugate/distributions.py
BetaNegativeBinomial
dataclass
Bases: DiscretePlotMixin, SliceMixin
Beta negative binomial distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Natural
|
number of successes |
required |
alpha
|
PositiveReal
|
shape parameter |
required |
beta
|
PositiveReal
|
shape parameter |
required |
Source code in conjugate/distributions.py
BetaProportional
dataclass
Beta proportional distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p
|
NUMERIC
|
product of observations |
required |
q
|
NUMERIC
|
product of complements |
required |
k
|
NUMERIC
|
number of observations |
required |
Source code in conjugate/distributions.py
approx_log_likelihood(alpha, beta, ln=np.log, gammaln=gammaln)
Approximate log likelihood.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alpha
|
NUMERIC
|
shape parameter |
required |
beta
|
NUMERIC
|
shape parameter |
required |
ln
|
Callable
|
log function |
log
|
gammaln
|
Callable
|
log gamma function |
gammaln
|
Returns:
| Type | Description |
|---|---|
NUMERIC
|
log likelihood up to a constant |
Source code in conjugate/distributions.py
Binomial
dataclass
Bases: DiscretePlotMixin, SliceMixin
Binomial distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Natural
|
number of trials |
required |
p
|
Probability
|
probability of success |
required |
Source code in conjugate/distributions.py
CompoundGamma
dataclass
Bases: ContinuousPlotDistMixin, SliceMixin
Compound gamma distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alpha
|
PositiveReal
|
shape |
required |
beta
|
PositiveReal
|
scale |
required |
lam
|
PositiveReal
|
rate |
required |
Source code in conjugate/distributions.py
Dirichlet
dataclass
Bases: DirichletPlotDistMixin
Dirichlet distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alpha
|
NUMERIC
|
shape parameter |
required |
Source code in conjugate/distributions.py
DirichletMultinomial
dataclass
Bases: SliceMixin
Dirichlet multinomial distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alpha
|
NUMERIC
|
shape parameter |
required |
n
|
NUMERIC
|
number of trials |
required |
Source code in conjugate/distributions.py
Exponential
dataclass
Bases: ContinuousPlotDistMixin, SliceMixin
Exponential distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lam
|
PositiveReal
|
rate parameter |
required |
Source code in conjugate/distributions.py
Gamma
dataclass
Bases: ContinuousPlotDistMixin, SliceMixin
Gamma distribution.
Gamma Distribution Scipy Docmentation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alpha
|
PositiveReal
|
shape parameter |
required |
beta
|
PositiveReal
|
rate parameter |
required |
Source code in conjugate/distributions.py
GammaKnownRateProportional
dataclass
Gamma known rate proportional distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
NUMERIC
|
prod of observations |
required |
b
|
NUMERIC
|
number of observations |
required |
c
|
NUMERIC
|
number of observations |
required |
Source code in conjugate/distributions.py
approx_log_likelihood(alpha, beta, ln=np.log, gammaln=gammaln)
Approximate log likelihood.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alpha
|
NUMERIC
|
shape parameter |
required |
beta
|
NUMERIC
|
known rate parameter |
required |
ln
|
Callable
|
log function |
log
|
gammaln
|
Callable
|
log gamma function |
gammaln
|
Returns:
| Type | Description |
|---|---|
NUMERIC
|
log likelihood up to a constant |
Source code in conjugate/distributions.py
GammaProportional
dataclass
Gamma proportional distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p
|
NUMERIC
|
product of r observations |
required |
q
|
NUMERIC
|
sum of s observations |
required |
r
|
NUMERIC
|
number of observations for p |
required |
s
|
NUMERIC
|
number of observations for q |
required |
Source code in conjugate/distributions.py
approx_log_likelihood(alpha, beta, ln=np.log, gammaln=gammaln)
Approximate log likelihood.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alpha
|
NUMERIC
|
shape parameter |
required |
beta
|
NUMERIC
|
rate parameter |
required |
ln
|
Callable
|
log function |
log
|
gammaln
|
Callable
|
log gamma function |
gammaln
|
Returns:
| Type | Description |
|---|---|
NUMERIC
|
log likelihood up to a constant |
Source code in conjugate/distributions.py
Geometric
dataclass
Bases: DiscretePlotMixin, SliceMixin
Geometric distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p
|
Probability
|
probability of success |
required |
one_start
|
bool
|
whether to start at 1 or 0. Default is 1. |
True
|
Source code in conjugate/distributions.py
Hypergeometric
dataclass
Bases: DiscretePlotMixin, SliceMixin
Hypergeometric distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
N
|
Natural
|
population size |
required |
k
|
Natural
|
number of successes in the population |
required |
n
|
Natural
|
number of draws |
required |
Source code in conjugate/distributions.py
InverseGamma
dataclass
Bases: ContinuousPlotDistMixin, SliceMixin
InverseGamma distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alpha
|
PositiveReal
|
shape |
required |
beta
|
PositiveReal
|
scale |
required |
Source code in conjugate/distributions.py
InverseWishart
dataclass
Inverse Wishart distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nu
|
NUMERIC
|
degrees of freedom |
required |
psi
|
NUMERIC
|
scale matrix |
required |
Source code in conjugate/distributions.py
LogNormal
dataclass
Bases: ContinuousPlotDistMixin, SliceMixin
Log normal distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
Real
|
mean |
required |
sigma
|
PositiveReal
|
standard deviation |
required |
Source code in conjugate/distributions.py
Lomax
dataclass
Bases: ContinuousPlotDistMixin, SliceMixin
Lomax distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alpha
|
PositiveReal
|
shape |
required |
lam
|
PositiveReal
|
scale |
required |
Source code in conjugate/distributions.py
Multinomial
dataclass
Bases: SliceMixin
Multinomial distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Natural
|
number of trials |
required |
p
|
Probability
|
probability of success |
required |
Source code in conjugate/distributions.py
MultivariateNormal
dataclass
Multivariate normal distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
NUMERIC
|
mean |
required |
cov
|
NUMERIC
|
covariance matrix |
required |
Source code in conjugate/distributions.py
MultivariateStudentT
dataclass
MultivariateStudentT distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
NUMERIC
|
mean |
required |
sigma
|
NUMERIC
|
covariance matrix |
required |
nu
|
NUMERIC
|
degrees of freedom |
required |
Source code in conjugate/distributions.py
NegativeBinomial
dataclass
Bases: DiscretePlotMixin, SliceMixin
Negative binomial distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Natural
|
number of successes |
required |
p
|
Probability
|
probability of success |
required |
Source code in conjugate/distributions.py
Normal
dataclass
Bases: ContinuousPlotDistMixin, SliceMixin
Normal distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
Real
|
mean |
required |
sigma
|
PositiveReal
|
standard deviation |
required |
Source code in conjugate/distributions.py
from_mean_and_precision(mean, precision)
classmethod
Alternative constructor from mean and precision.
from_mean_and_variance(mean, variance)
classmethod
Alternative constructor from mean and variance.
NormalGamma
dataclass
Normal gamma distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
NUMERIC
|
mean |
required |
lam
|
NUMERIC
|
precision |
required |
alpha
|
NUMERIC
|
shape |
required |
beta
|
NUMERIC
|
scale |
required |
Source code in conjugate/distributions.py
1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 | |
sample_beta(size, return_variance=False, random_state=None)
Sample beta from the normal distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
int
|
number of samples |
required |
return_variance
|
bool
|
whether to return variance as well |
False
|
random_state
|
RandomState | None
|
random state |
None
|
Returns:
| Type | Description |
|---|---|
NUMERIC | tuple[NUMERIC, NUMERIC]
|
samples from the normal distribution |
Source code in conjugate/distributions.py
sample_mean(size, return_variance=False, random_state=None)
Sample mean from the normal distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
int
|
number of samples |
required |
return_variance
|
bool
|
whether to return variance as well |
False
|
random_state
|
RandomState | None
|
random state |
None
|
Returns:
| Type | Description |
|---|---|
NUMERIC | tuple[NUMERIC, NUMERIC]
|
samples from the normal distribution |
Source code in conjugate/distributions.py
sample_variance(size, random_state=None)
Sample precision from gamma distribution and invert.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
int
|
number of samples |
required |
random_state
|
RandomState | None
|
random state |
None
|
Returns:
| Type | Description |
|---|---|
NUMERIC
|
samples from the inverse gamma distribution |
Source code in conjugate/distributions.py
NormalInverseGamma
dataclass
Normal inverse gamma distribution.
Supports both 1 dimensional and multivariate cases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
Real
|
mean |
required |
alpha
|
PositiveReal
|
shape |
required |
beta
|
PositiveReal
|
scale |
required |
delta_inverse
|
NUMERIC | None
|
covariance matrix, 2d array for multivariate case |
None
|
nu
|
PositiveReal | None
|
alternative precision parameter for 1 dimensional case |
None
|
Source code in conjugate/distributions.py
586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 | |
sample_beta(size, return_variance=False, random_state=None)
Sample beta from the normal distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
int
|
number of samples |
required |
return_variance
|
bool
|
whether to return variance as well |
False
|
random_state
|
RandomState | None
|
random state |
None
|
Returns:
| Type | Description |
|---|---|
NUMERIC | tuple[NUMERIC, NUMERIC]
|
samples from the normal distribution and optionally variance |
Source code in conjugate/distributions.py
sample_mean(size, return_variance=False, random_state=None)
Sample the mean from the normal distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
int
|
number of samples |
required |
return_variance
|
bool
|
whether to return variance as well |
False
|
random_state
|
RandomState | None
|
random state |
None
|
Returns:
| Type | Description |
|---|---|
NUMERIC | tuple[NUMERIC, NUMERIC]
|
samples from the normal distribution and optionally variance |
Source code in conjugate/distributions.py
sample_variance(size, random_state=None)
Sample variance from the inverse gamma distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
int
|
number of samples |
required |
random_state
|
RandomState | None
|
random state |
None
|
Returns:
| Type | Description |
|---|---|
NUMERIC
|
samples from the inverse gamma distribution |
Source code in conjugate/distributions.py
NormalInverseWishart
dataclass
Normal inverse Wishart distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
NUMERIC
|
mean |
required |
kappa
|
NUMERIC
|
precision |
required |
nu
|
NUMERIC
|
degrees of freedom |
required |
psi
|
NUMERIC
|
scale matrix |
required |
Source code in conjugate/distributions.py
1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 | |
inverse_wishart
property
Inverse wishart distribution.
sample_mean(size, return_variance=False, random_state=None)
Sample the mean from the normal distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
int
|
number of samples |
required |
return_variance
|
bool
|
whether to return variance as well |
False
|
random_state
|
Generator | None
|
random state |
None
|
Returns:
| Type | Description |
|---|---|
NUMERIC
|
samples from the normal distribution and optionally variance |
Source code in conjugate/distributions.py
sample_variance(size, random_state=None)
Sample precision from gamma distribution and invert.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
int
|
number of samples |
required |
random_state
|
Generator | None
|
random state |
None
|
Returns:
| Type | Description |
|---|---|
NUMERIC
|
samples from the inverse wishart distribution |
Source code in conjugate/distributions.py
NormalWishart
dataclass
Normal Wishart distribution.
Parameterization from Wikipedia.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
NUMERIC
|
mean |
required |
lam
|
NUMERIC
|
precision |
required |
W
|
NUMERIC
|
scale matrix |
required |
nu
|
NUMERIC
|
degrees of freedom |
required |
Source code in conjugate/distributions.py
1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 | |
sample_mean(size=1, return_variance=False, random_state=None)
Sample mean
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
int
|
number of samples |
1
|
return_variance
|
bool
|
whether to return variance as well |
False
|
random_state
|
Generator | None
|
random state |
None
|
Returns:
| Type | Description |
|---|---|
ndarray | tuple[ndarray, ndarray]
|
samples from the normal distribution and optionally variance |
Source code in conjugate/distributions.py
sample_variance(size=1, random_state=None, inv=np.linalg.inv)
Sample variance
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
int
|
number of samples |
1
|
random_state
|
Generator | None
|
random state |
None
|
inv
|
Callable
|
matrix inversion function |
inv
|
Returns:
| Type | Description |
|---|---|
ndarray
|
samples from the inverse wishart distribution |
Source code in conjugate/distributions.py
Pareto
dataclass
Bases: ContinuousPlotDistMixin, SliceMixin
Pareto distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_m
|
PositiveReal
|
minimum value |
required |
alpha
|
PositiveReal
|
scale parameter |
required |
Source code in conjugate/distributions.py
Poisson
dataclass
Bases: DiscretePlotMixin, SliceMixin
Poisson distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lam
|
PositiveReal
|
rate parameter |
required |
Source code in conjugate/distributions.py
ScaledInverseChiSquared
dataclass
Bases: ContinuousPlotDistMixin, SliceMixin
Scaled inverse chi squared distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nu
|
PositiveReal
|
degrees of freedom |
required |
sigma2
|
PositiveReal
|
scale parameter |
required |
Source code in conjugate/distributions.py
from_inverse_gamma(inverse_gamma)
classmethod
Alternative constructor from inverse gamma distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inverse_gamma
|
InverseGamma
|
inverse gamma distribution |
required |
Returns:
| Type | Description |
|---|---|
ScaledInverseChiSquared
|
scaled inverse chi squared distribution |
Source code in conjugate/distributions.py
to_inverse_gamma()
Convert to inverse gamma distribution.
Returns:
| Type | Description |
|---|---|
InverseGamma
|
inverse gamma distribution |
StudentT
dataclass
Bases: ContinuousPlotDistMixin, SliceMixin
StudentT distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
Real
|
mean |
required |
sigma
|
PositiveReal
|
standard deviation |
required |
nu
|
PositiveReal
|
degrees of freedom |
required |
Source code in conjugate/distributions.py
Uniform
dataclass
Bases: ContinuousPlotDistMixin, SliceMixin
Uniform distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
low
|
Real
|
lower bound |
required |
high
|
Real
|
upper bound |
required |
Source code in conjugate/distributions.py
VectorizedDist
Vectorized distribution to handle scipy distributions that don't support vectorization.
Source code in conjugate/distributions.py
VonMises
dataclass
Bases: ContinuousPlotDistMixin, SliceMixin
Von Mises distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
Real
|
mean |
required |
kappa
|
PositiveReal
|
concentration |
required |
Source code in conjugate/distributions.py
VonMisesKnownConcentration
dataclass
Von Mises known concentration distribution.
Taken from Section 2.13.1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
NUMERIC
|
positive value |
required |
b
|
NUMERIC
|
value between 0 and 2 pi |
required |
Source code in conjugate/distributions.py
log_likelihood(mu, cos=np.cos, ln=np.log, i0=i0)
Approximate log likelihood.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
NUMERIC
|
mean |
required |
cos
|
Callable
|
cosine function |
cos
|
ln
|
Callable
|
log function |
log
|
i0
|
Callable
|
modified bessel function of order 0 |
i0
|
Returns:
| Type | Description |
|---|---|
NUMERIC
|
log likelihood |
Source code in conjugate/distributions.py
VonMisesKnownDirectionProportional
dataclass
Von Mises known direction proportional distribution.
Taken from Section 2.13.2.
Args: c: NUMERIC r: NUMERIC
Source code in conjugate/distributions.py
approx_log_likelihood(kappa, ln=np.log, i0=i0)
Approximate log likelihood.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kappa
|
NUMERIC
|
concentration |
required |
ln
|
Callable
|
log function |
log
|
i0
|
Callable
|
modified bessel function of order 0 |
i0
|
Returns:
| Type | Description |
|---|---|
NUMERIC
|
log likelihood up to a constant |
Source code in conjugate/distributions.py
Weibull
dataclass
Bases: ContinuousPlotDistMixin, SliceMixin
Weibull distribution.
Parameterization from Section 2.11 of paper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
beta
|
PositiveReal
|
shape parameter |
required |
theta
|
PositiveReal
|
scale parameter |
required |
Example
Recreation of the plot on Wikipedia.
import matplotlib.pyplot as plt
import numpy as np
from conjugate.distributions import Weibull
lam = 1
k = np.array([0.5, 1.0, 1.5, 5.0])
beta = k
theta = lam**beta
distribution = Weibull(beta=beta, theta=theta)
ax = distribution.set_bounds(0, 2.5).plot_pdf(
label=["k=0.5", "k=1.0", "k=1.5", "k=5.0"],
color=["blue", "red", "pink", "green"],
)
ax.legend()
Source code in conjugate/distributions.py
Wishart
dataclass
Wishart distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nu
|
NUMERIC
|
degrees of freedom |
required |
V
|
NUMERIC
|
scale matrix |
required |