Skip to content

Commit

Permalink
BetaGeoNBDRV as pre-pymc-labs#1269 definition
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloRoque committed Jan 2, 2025
1 parent 8beb7fc commit 4c46ae8
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions pymc_marketing/clv/distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,21 +672,20 @@ def logp_customer_died(t_x_i, x_i, alpha_i, beta_i, gamma_i, delta_i, T_i):

class BetaGeoNBDRV(RandomVariable):
name = "bg_nbd"
signature = "(),(),(),(),()->(2)"
# ndim_supp = 1
# ndims_params = [0, 0, 0, 0, 0]
ndim_supp = 1
ndims_params = [0, 0, 0, 0, 0]

dtype = "floatX"
_print_name = ("BetaGeoNBD", "\\operatorname{BetaGeoNBD}")

# def make_node(self, rng, size, dtype, a, b, r, alpha, T):
# a = pt.as_tensor_variable(a)
# b = pt.as_tensor_variable(b)
# r = pt.as_tensor_variable(r)
# alpha = pt.as_tensor_variable(alpha)
# T = pt.as_tensor_variable(T)
def make_node(self, rng, size, dtype, a, b, r, alpha, T):
a = pt.as_tensor_variable(a)
b = pt.as_tensor_variable(b)
r = pt.as_tensor_variable(r)
alpha = pt.as_tensor_variable(alpha)
T = pt.as_tensor_variable(T)

# return super().make_node(rng, size, dtype, a, b, r, alpha, T)
return super().make_node(rng, size, dtype, a, b, r, alpha, T)

def __call__(self, a, b, r, alpha, T, size=None, **kwargs):
return super().__call__(a, b, r, alpha, T, size=size, **kwargs)
Expand Down

0 comments on commit 4c46ae8

Please sign in to comment.