pymc.Triangular#
- class pymc.Triangular(name, *args, rng=None, dims=None, initval=None, observed=None, total_size=None, transform=UNSET, **kwargs)[source]#
Continuous Triangular log-likelihood.
The pdf of this distribution is
\[\begin{split}\begin{cases} 0 & \text{for } x < a, \\ \frac{2(x-a)}{(b-a)(c-a)} & \text{for } a \le x < c, \\[4pt] \frac{2}{b-a} & \text{for } x = c, \\[4pt] \frac{2(b-x)}{(b-a)(b-c)} & \text{for } c < x \le b, \\[4pt] 0 & \text{for } b < x. \end{cases}\end{split}\](Source code, png, hires.png, pdf)
Support
\(x \in [lower, upper]\)
Mean
\(\dfrac{lower + upper + c}{3}\)
Variance
\(\dfrac{upper^2 + lower^2 +c^2 - lower*upper - lower*c - upper*c}{18}\)
- Parameters
- lowertensor_like of
float
, default 0 Lower limit.
- ctensor_like of
float
, default 0.5 Mode.
- uppertensor_like of
float
, default 1 Upper limit.
- lowertensor_like of
Methods
Triangular.__init__
(*args, **kwargs)Triangular.dist
([lower, upper, c])Creates a tensor variable corresponding to the cls distribution.
Triangular.logcdf
(lower, c, upper)Compute the log of the cumulative distribution function for Triangular distribution at the specified value.
Triangular.moment
(size, lower, c, upper)Attributes
bound_args_indices
rv_class
rv_op