class_docstr: The CholeskyLKJ distribution on cholesky factors of correlation matrices.
  
  This is a one-parameter family of distributions on cholesky factors of
  correlation matrices.
  
  In other words, if If `X ~ CholeskyLKJ(c)`, then `X @ X^T ~ LKJ(c)`.
  
  The distribution is supported on lower triangular N x N matrices which are
  Cholesky factors of correlation matrices; equivalently, matrices whose rows
  have Euclidean norm 1 and diagonal entries are positive. The probability
  density function is given by:
  
    pdf(X; c) = (1/Z(c)) prod_i X_ii^{n-i+2c-3}  (0 <= i < n)
  
  where there are n(n-1)/2 independent variables X_ij (0 <= i < j < n) and
  Z(c) is the normalizing constant; the same one as that of LKJ(c).
  
  For more details on the LKJ distribution, see `tfp.distributions.LKJ`.
  
  #### Examples
  
  ```python
  # Initialize a single 3x3 LKJ with concentration parameter 1.5
  dist = tfp.distributions.CholeskyLKJ(dimension=3, concentration=1.5)
  
  # Evaluate this at a batch of two observations, each in R^{3x3}.
  x = ...  # Shape is [2, 3, 3].
  dist.prob(x)  # Shape is [2].
  
  # Draw 6 Cholesky LKJ-distributed 3x3 lower triangular matrices
  ans = dist.sample(sample_shape=[2, 3], seed=42)
  # shape of ans is [2, 3, 3, 3]
  ```
  The sampler follows the 'onion' method from
  
  [1] Daniel Lewandowski, Dorota Kurowicka, and Harry Joe,
  'Generating random correlation matrices based on vines and extended
  onion method,' Journal of Multivariate Analysis 100 (2009), pp
  1989-2001.
class_docstr_tok: ["The","CholeskyLKJ","distribution","on","cholesky","factors","of","correlation","matrices",".","This","is","a","one-parameter","family","of","distributions","on","cholesky","factors","of","correlation","matrices",".","In","other","words",",","if","If","`","X","~","CholeskyLKJ","(","c",")","`",",","then","`","X","@","X^T","~","LKJ","(","c",")","`",".","The","distribution","is","supported","on","lower","triangular","N","x","N","matrices","which","are","Cholesky","factors","of","correlation","matrices",";","equivalently",",","matrices","whose","rows","have","Euclidean","norm","1","and","diagonal","entries","are","positive",".","The","probability","density","function","is","given","by",":","pdf","(","X",";","c",")","=","(","1\/Z","(","c",")",")","prod_i","X_ii^","{","n-i+2c-3","}","(","0","<","=","i","<","n",")","where","there","are","n","(","n-1",")","\/2","independent","variables","X_ij","(","0","<","=","i","<","j","<","n",")","and","Z","(","c",")","is","the","normalizing","constant",";","the","same","one","as","that","of","LKJ","(","c",")",".","For","more","details","on","the","LKJ","distribution",",","see","`","tfp.distributions.LKJ","`",".","#","#","#","#","Examples","``","`","python","#","Initialize","a","single","3x3","LKJ","with","concentration","parameter","1.5","dist","=","tfp.distributions.CholeskyLKJ","(","dimension=3",",","concentration=1.5",")","#","Evaluate","this","at","a","batch","of","two","observations",",","each","in","R^","{","3x3","}",".","x","=","...","#","Shape","is","[","2",",","3",",","3","]",".","dist.prob","(","x",")","#","Shape","is","[","2","]",".","#","Draw","6","Cholesky","LKJ-distributed","3x3","lower","triangular","matrices","ans","=","dist.sample","(","sample_shape=","[","2",",","3","]",",","seed=42",")","#","shape","of","ans","is","[","2",",","3",",","3",",","3","]","``","`","The","sampler","follows","the","'onion","'","method","from","[","1","]","Daniel","Lewandowski",",","Dorota","Kurowicka",",","and","Harry","Joe",",","'Generating","random","correlation","matrices","based","on","vines","and","extended","onion","method",",","'","Journal","of","Multivariate","Analysis","100","(","2009",")",",","pp","1989-2001","."]
docstr: Returns the unnormalized log density of a CholeskyLKJ distribution.
  
  Args:
    x: `float` or `double` `Tensor` of Cholesky factors of correlation
      matrices. The shape of `x` must be `B + [D, D]`, where `B` broadcasts
      with the shape of `concentration`.
    concentration: `float` or `double` `Tensor`. The positive concentration
      parameter of the CholeskyLKJ distributions.
    name: Python `str` name prefixed to Ops created by this function.
  
  Returns:
    log_p: A Tensor of the unnormalized log density of each matrix element of
      `x`, with respect to an CholeskyLKJ distribution with parameter the
      corresponding element of `concentration`.
docstr_tok: ["Returns","the","unnormalized","log","density","of","a","CholeskyLKJ","distribution",".","Args",":","x",":","`","float","`","or","`","double","`","`","Tensor","`","of","Cholesky","factors","of","correlation","matrices",".","The","shape","of","`","x","`","must","be","`","B","+","[","D",",","D","]","`",",","where","`","B","`","broadcasts","with","the","shape","of","`","concentration","`",".","concentration",":","`","float","`","or","`","double","`","`","Tensor","`",".","The","positive","concentration","parameter","of","the","CholeskyLKJ","distributions",".","name",":","Python","`","str","`","name","prefixed","to","Ops","created","by","this","function",".","Returns",":","log_p",":","A","Tensor","of","the","unnormalized","log","density","of","each","matrix","element","of","`","x","`",",","with","respect","to","an","CholeskyLKJ","distribution","with","parameter","the","corresponding","element","of","`","concentration","`","."]
code: def _log_unnorm_prob(self, x, concentration, name=None):
      """Returns the unnormalized log density of a CholeskyLKJ distribution.
  
      Args:
        x: `float` or `double` `Tensor` of Cholesky factors of correlation
          matrices. The shape of `x` must be `B + [D, D]`, where `B` broadcasts
          with the shape of `concentration`.
        concentration: `float` or `double` `Tensor`. The positive concentration
          parameter of the CholeskyLKJ distributions.
        name: Python `str` name prefixed to Ops created by this function.
  
      Returns:
        log_p: A Tensor of the unnormalized log density of each matrix element of
          `x`, with respect to an CholeskyLKJ distribution with parameter the
          corresponding element of `concentration`.
      """
      with tf.name_scope(name or "log_unnorm_prob_cholesky_lkj"):
          x = tf.convert_to_tensor(x, name="x")
          logdiag = tf.math.log(tf.linalg.diag_part(x))
          # We pick up a weighted sum of the log(diag) due to the jacobian
          # of the cholesky decomposition. By an argument similar to that of
          # `tfp.bijectors.CholeskyOuterProduct`, the jacobian is given by:
          #   prod_i x_ii^{n-i-1} (0 <= i < n).
          #
          # To see this, observe that if x @ x^T = p, then p_ij depends only on
          # those x_kl where k<=i and l<=j. Therefore, on vectorizing the strictly
          # lower triangular parts of x and p, we get that the jacobian matrix
          # [d/dvec(x) vec(p)] is lower triangular. The jacobian determinant is then
          # the product of the n(n-1)/2 diagonal entries:
          #   J = prod_ij d/dx_ij p_ij  (0 <= j < i < n)
          #     = prod_ij d/dx_ij (x_i0 * x_j0 + x_i1 * x_j1 + ... + x_ij * x_jj)
          #     = prod_ij x_jj
          #     = prod_i x_ii^{n-i-1}
          #
          # For more details, see `tfp.bijectors.CholeskyOuterProduct`.
          dimension_range = np.linspace(
              self.dimension - 1,
              0.0,
              self.dimension,
              dtype=dtype_util.as_numpy_dtype(concentration.dtype),
          )
          return tf.reduce_sum(
              (
                  2.0 * concentration[..., tf.newaxis]
                  - 2.0
                  + dimension_range
              )
              * logdiag,
              axis=-1,
          )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import correlation_cholesky
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import lkj
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math import special
label_desc: Use image node_id 9 for calling the CholeskyLKJ obj's underlying member method code with example usage: obj._log_unnorm_prob(x, concentration, name) and returns: tf