code: def compute_true_volumes(
      det_bounds, dim, num_samples, error_rate=1e-6, seed=42
  ):
      """Returns confidence intervals for the desired correlation matrix volumes.
  
      The confidence intervals are computed by the [Clopper-Pearson method]
      (https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval).
  
      Args:
        det_bounds: A rank-1 numpy array of lower bounds on the
          determinants of acceptable matrices.  Entries must be unique.
        dim: A Python `int` dimension of correlation matrices to sample.
        num_samples: The number of samples to draw.
        error_rate: The statistical significance of the returned
          confidence intervals.  The significance is broadcast: Each
          returned interval separately may be incorrect with probability
          (under the sample of correlation-like matrices drawn internally)
          at most `error_rate`.
        seed: PRNG seed; see `tfp.random.sanitize_seed` for details.
  
      Returns:
        bounds: A Python `dict` mapping each determinant bound to the low, high
          tuple giving the confidence interval.
      """
      bounds = {}
      with tf1.Session() as sess:
          rej_weights, _ = correlation_matrix_volume_rejection_samples(
              det_bounds,
              dim,
              [num_samples, len(det_bounds)],
              np.float32,
              seed=seed,
          )
          rej_weights = sess.run(rej_weights)
          for rw, det in zip(np.rollaxis(rej_weights, 1), det_bounds):
              template = (
                  "Estimating volume of {}x{} correlation "
                  "matrices with determinant >= {}."
              )
              print(template.format(dim, dim, det))
              sys.stdout.flush()
              bounds[det] = _clopper_pearson_confidence_interval(
                  rw, error_rate=error_rate
              )
          return bounds
  
file_path: probability/tensorflow_probability/python/distributions/internal/correlation_matrix_volumes_lib.py
imports: import sys
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import uniform
  from tensorflow_probability.python.internal import empirical_statistical_testing
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.math.linalg import fill_triangular
label_desc: Use image node_id 6 for calling a global function with example usage: compute_true_volumes(det_bounds, dim, num_samples, error_rate, seed) and returns: bounds