提交 0980c410 authored 作者: Ricardo's avatar Ricardo 提交者: ricardoV94

Add LogisticRV

上级 0e6069db
......@@ -190,6 +190,20 @@ class WeibullRV(RandomVariable):
weibull = WeibullRV()
class LogisticRV(RandomVariable):
name = "logistic"
ndim_supp = 0
ndims_params = [0, 0]
dtype = "floatX"
_print_name = ("Logistic", "\\operatorname{Logistic}")
def __call__(self, loc=0, scale=1, size=None, **kwargs):
return super().__call__(loc, scale, size=size, **kwargs)
logistic = LogisticRV()
def safe_multivariate_normal(mean, cov, size=None, rng=None):
"""A shape consistent multivariate normal sampler.
......
......@@ -30,6 +30,7 @@ from aesara.tensor.random.basic import (
hypergeometric,
invgamma,
laplace,
logistic,
lognormal,
multinomial,
multivariate_normal,
......@@ -267,6 +268,15 @@ def test_weibull_samples():
rv_numpy_tester(weibull, test_alpha, size=[2, 3])
def test_logistic_samples():
test_loc = np.array(2, dtype=config.floatX)
test_scale = np.array(0.5, dtype=config.floatX)
rv_numpy_tester(logistic)
rv_numpy_tester(logistic, test_loc)
rv_numpy_tester(logistic, test_loc, test_scale, size=[2, 3])
def test_pareto_samples():
test_alpha = np.array(0.5, dtype=config.floatX)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论