docstr: Calculate the mean using numerical integration.
docstr_tok: ["Calculate","the","mean","using","numerical","integration","."]
code: def mean(self) -> float:
      """
      Calculate the mean using numerical integration.
      """
      # determine points based on t_min and t_max
      lower_exponent = int(np.log10(np.abs(self.t_min)))
      upper_exponent = int(np.log10(self.t_max))
      points = np.concatenate(
          [
              [self.t_min],
              -np.logspace(start=lower_exponent, stop=-5, num=10),
              [0],
              np.logspace(start=-5, stop=upper_exponent, num=10),
              [self.t_max],
          ]
      )
  
      mean = 0.0
      for left, right in zip(points[:-1], points[1:]):
          integral, _ = integrate.quad(self.cdf, left, right, limit=500)
          mean += (
              right * self.cdf(right) - left * self.cdf(left) - integral
          )
  
      return mean
  
imports: from dataclasses import dataclass
  from typing import Tuple
  import numpy
  from scipy import integrate
  from scipy.special import erfc
  from ..rdp import _compute_rdp
  from .domain import Domain
label_desc: Use image node_id 4 for calling the TruncatedPrivacyRandomVariable obj's underlying member method code with example usage: obj.mean() and returns: mean