BetaGeoModel.expected_num_purchases#

BetaGeoModel.expected_num_purchases(customer_id, t, frequency, recency, T)[source]#

Given a purchase history/profile of \(x\) and \(t_x\) for an individual customer, this method returns the expected number of future purchases in the next time interval of length \(t\), i.e. \((T, T + t]\). The closed form solution for this equation is available as (10) from [1] linked above. With \(\text{hyp2f1}\) being the Gaussian hypergeometric function, the expectation is defined as below. :rtype: DataArray

\[\mathbb{E}\left[Y(t) \mid x, t_x, T, r, \alpha, a, b\right] = \frac { \frac{a + b + x - 1}{a - 1}\left[ 1 - \left(\frac{\alpha + T}{\alpha + T + t}\right)^{r + x} \text{hyp2f1}\left( r + x, b + x; a + b + x, \frac{1}{\alpha + T + t} \right) \right] } { 1 + \delta_{x > 0} \frac{a}{b + x - 1} \left( \frac{\alpha + T}{\alpha + T + t} \right)^{r + x} }\]