code: def conditional_probability_alive_matrix(self, max_frequency=None, max_recency=None):
          
          max_frequency = max_frequency or int(self.data["frequency"].max())
          max_recency = max_recency or int(self.data["T"].max())
  
          Z = np.zeros((max_recency + 1, max_frequency + 1))
          for i, recency in enumerate(np.arange(max_recency + 1)):
              for j, frequency in enumerate(np.arange(max_frequency + 1)):
                  Z[i, j] = self.conditional_probability_alive(frequency, recency, max_recency)
  
          return Z
docs: Compute the probability alive matrix.
  
          Parameters
          ----------
          max_frequency: float, optional
              the maximum frequency to plot. Default is max observed frequency.
          max_recency: float, optional
              the maximum recency to plot. This also determines the age of the
              customer. Default to max observed age.
  
          Returns
          -------
          matrix:
              A matrix of the form [t_x: historical recency, x: historical frequency]