pymc.Triangular#

class pymc.Triangular(name, *args, rng=None, dims=None, initval=None, observed=None, total_size=None, transform=UNSET, **kwargs)[源代码]#

连续三角对数似然。

此分布的pdf是

\[\begin{split}\begin{cases} 0 & \text{对于 } x < a, \\ \frac{2(x-a)}{(b-a)(c-a)} & \text{对于 } a \le x < c, \\[4pt] \frac{2}{b-a} & \text{对于 } x = c, \\[4pt] \frac{2(b-x)}{(b-a)(b-c)} & \text{对于 } c < x \le b, \\[4pt] 0 & \text{对于 } b < x. \end{cases}\end{split}\]

(Source code, png, hires.png, pdf)

../../../_images/pymc-Triangular-1.png

支持

\(x \in [lower, upper]\)

均值

\(\dfrac{lower + upper + c}{3}\)

方差

\(\dfrac{upper^2 + lower^2 +c^2 - lower*upper - lower*c - upper*c}{18}\)

参数:
lower : 类似张量float,默认值为 0tensor_like of python:float, 默认值为 0

下限。

c : 类似张量float,默认值为 0.5tensor_like of python:float, 默认值 0.5

模式。

upper : 类似张量float,默认值为 1tensor_like of python:float, 默认值为 1

上限。

方法

Triangular.dist([lower, upper, c])

创建一个与 cls 分布相对应的张量变量。