提交 0e6069db authored 作者: Ricardo's avatar Ricardo 提交者: ricardoV94

Add WeibullRV

上级 9d410ebf
...@@ -179,6 +179,17 @@ class ExponentialRV(RandomVariable): ...@@ -179,6 +179,17 @@ class ExponentialRV(RandomVariable):
exponential = ExponentialRV() exponential = ExponentialRV()
class WeibullRV(RandomVariable):
name = "weibull"
ndim_supp = 0
ndims_params = [0]
dtype = "floatX"
_print_name = ("Weibull", "\\operatorname{Weibull}")
weibull = WeibullRV()
def safe_multivariate_normal(mean, cov, size=None, rng=None): def safe_multivariate_normal(mean, cov, size=None, rng=None):
"""A shape consistent multivariate normal sampler. """A shape consistent multivariate normal sampler.
......
...@@ -44,6 +44,7 @@ from aesara.tensor.random.basic import ( ...@@ -44,6 +44,7 @@ from aesara.tensor.random.basic import (
truncexpon, truncexpon,
uniform, uniform,
wald, wald,
weibull,
) )
from aesara.tensor.type import iscalar, scalar, tensor from aesara.tensor.type import iscalar, scalar, tensor
...@@ -259,6 +260,13 @@ def test_exponential_samples(): ...@@ -259,6 +260,13 @@ def test_exponential_samples():
rv_numpy_tester(exponential, test_lambda, size=[2, 3]) rv_numpy_tester(exponential, test_lambda, size=[2, 3])
def test_weibull_samples():
test_alpha = np.array(3, dtype=config.floatX)
rv_numpy_tester(weibull, test_alpha)
rv_numpy_tester(weibull, test_alpha, size=[2, 3])
def test_pareto_samples(): def test_pareto_samples():
test_alpha = np.array(0.5, dtype=config.floatX) test_alpha = np.array(0.5, dtype=config.floatX)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论