code: def _log_A_0(params, freq, recency, age):
          
          r, alpha, s, beta = params
  
          if alpha < beta:
              min_of_alpha_beta, max_of_alpha_beta, t = (alpha, beta, r + freq)
          else:
              min_of_alpha_beta, max_of_alpha_beta, t = (beta, alpha, s + 1)
          abs_alpha_beta = max_of_alpha_beta - min_of_alpha_beta
  
          rsf = r + s + freq
          p_1 = hyp2f1(rsf, t, rsf + 1.0, abs_alpha_beta / (max_of_alpha_beta + recency))
          q_1 = max_of_alpha_beta + recency
          p_2 = hyp2f1(rsf, t, rsf + 1.0, abs_alpha_beta / (max_of_alpha_beta + age))
          q_2 = max_of_alpha_beta + age
  
          try:
              size = len(freq)
              sign = np.ones(size)
          except TypeError:
              sign = 1
  
          return logsumexp([log(p_1) + rsf * log(q_2), log(p_2) + rsf * log(q_1)], axis=0, b=[sign, -sign]) - rsf * log(
              q_1 * q_2
          )
docs: log_A_0.