code: def _pdf_r(r, sigma):
      """Pdf for the log of eigenvalues of a SPD matrix.
  
      Probability density function for the logarithm of the eigenvalues of a SPD
      matrix samples from the Riemannian Gaussian distribution. See Said et al.
      "Riemannian Gaussian distributions on the space of symmetric positive
      definite matrices" (2017) for the mathematical details.
  
      Parameters
      ----------
      r : ndarray, shape (n_dim,)
          Vector with the logarithm of the eigenvalues of a SPD matrix.
      sigma : float
          Dispersion of the Riemannian Gaussian distribution.
  
      Returns
      -------
      p : float
          Probability density function applied to data point r.
      """
  
      if sigma <= 0:
          raise ValueError(
              f"sigma must be a positive number (Got {sigma})"
          )
  
      n_dim = len(r)
      partial_1 = -np.sum(r**2) / (2 * sigma**2)
      partial_2 = 0
      for i in range(n_dim):
          for j in range(i + 1, n_dim):
              partial_2 = partial_2 + np.log(
                  np.sinh(np.abs(r[i] - r[j]) / 2)
              )
  
      return np.exp(partial_1 + partial_2)
  
file_path: pyRiemann/pyriemann/datasets/sampling.py
imports: from functools import partial
  import warnings
  import numpy
  from scipy.stats import multivariate_normal
  from sklearn.utils import check_random_state
  from joblib import Parallel, delayed
  from ..utils.base import sqrtm, expm
  from ..utils.test import is_sym_pos_semi_def
label_desc: Use image node_id 1 for calling a global function with example usage: _pdf_r(r, sigma) and returns: np