class_docstr: The LKJ distribution on correlation matrices.
  
  This is a one-parameter family of distributions on correlation matrices.  The
  probability density is proportional to the determinant raised to the power of
  the parameter: `pdf(X; eta) = Z(eta) * det(X) ** (eta - 1)`, where `Z(eta)` is
  a normalization constant.  The uniform distribution on correlation matrices is
  the special case `eta = 1`.
  
  The distribution is named after Lewandowski, Kurowicka, and Joe, who gave a
  sampler for the distribution in [(Lewandowski, Kurowicka, Joe, 2009)][1].
  
  Note: For better numerical stability, it is recommended that you use
  `CholeskyLKJ` instead.
  
  #### Examples
  
  ```python
  # Initialize a single 3x3 LKJ with concentration parameter 1.5
  dist = tfp.distributions.LKJ(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 LKJ-distributed 3x3 correlation matrices
  ans = dist.sample(sample_shape=[2, 3], seed=42)
  # shape of ans is [2, 3, 3, 3]
  ```
class_docstr_tok: ["The","LKJ","distribution","on","correlation","matrices",".","This","is","a","one-parameter","family","of","distributions","on","correlation","matrices",".","The","probability","density","is","proportional","to","the","determinant","raised","to","the","power","of","the","parameter",":","`","pdf","(","X",";","eta",")","=","Z","(","eta",")","*","det","(","X",")","*","*","(","eta","-","1",")","`",",","where","`","Z","(","eta",")","`","is","a","normalization","constant",".","The","uniform","distribution","on","correlation","matrices","is","the","special","case","`","eta","=","1","`",".","The","distribution","is","named","after","Lewandowski",",","Kurowicka",",","and","Joe",",","who","gave","a","sampler","for","the","distribution","in","[","(","Lewandowski",",","Kurowicka",",","Joe",",","2009",")","]","[","1","]",".","Note",":","For","better","numerical","stability",",","it","is","recommended","that","you","use","`","CholeskyLKJ","`","instead",".","#","#","#","#","Examples","``","`","python","#","Initialize","a","single","3x3","LKJ","with","concentration","parameter","1.5","dist","=","tfp.distributions.LKJ","(","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","LKJ-distributed","3x3","correlation","matrices","ans","=","dist.sample","(","sample_shape=","[","2",",","3","]",",","seed=42",")","#","shape","of","ans","is","[","2",",","3",",","3",",","3","]","``","`"]
docstr: Construct LKJ distributions.
  
  Args:
    dimension: Python `int`. The dimension of the correlation matrices
      to sample.
    concentration: `float` or `double` `Tensor`. The positive concentration
      parameter of the LKJ distributions. The pdf of a sample matrix `X` is
      proportional to `det(X) ** (concentration - 1)`.
    input_output_cholesky: Python `bool`. If `True`, functions whose input or
      output have the semantics of samples assume inputs are in Cholesky form
      and return outputs in Cholesky form. In particular, if this flag is
      `True`, input to `log_prob` is presumed of Cholesky form and output from
      `sample` is of Cholesky form.  Setting this argument to `True` is purely
      a computational optimization and does not change the underlying
      distribution. Additionally, validation checks which are only defined on
      the multiplied-out form are omitted, even if `validate_args` is `True`.
      Default value: `False` (i.e., input/output does not have Cholesky
      semantics). WARNING: Do not set this boolean to true, when using
      `tfp.mcmc`. The density is not the density of Cholesky factors of
      correlation matrices drawn via LKJ.
    validate_args: Python `bool`, default `False`. When `True` distribution
      parameters are checked for validity despite possibly degrading runtime
      performance. When `False` invalid inputs may silently render incorrect
      outputs.
    allow_nan_stats: Python `bool`, default `True`. When `True`, statistics
      (e.g., mean, mode, variance) use the value `NaN` to indicate the
      result is undefined. When `False`, an exception is raised if one or
      more of the statistic's batch members are undefined.
    name: Python `str` name prefixed to Ops created by this class.
  
  Raises:
    ValueError: If `dimension` is negative.
docstr_tok: ["Construct","LKJ","distributions",".","Args",":","dimension",":","Python","`","int","`",".","The","dimension","of","the","correlation","matrices","to","sample",".","concentration",":","`","float","`","or","`","double","`","`","Tensor","`",".","The","positive","concentration","parameter","of","the","LKJ","distributions",".","The","pdf","of","a","sample","matrix","`","X","`","is","proportional","to","`","det","(","X",")","*","*","(","concentration","-","1",")","`",".","input_output_cholesky",":","Python","`","bool","`",".","If","`","True","`",",","functions","whose","input","or","output","have","the","semantics","of","samples","assume","inputs","are","in","Cholesky","form","and","return","outputs","in","Cholesky","form",".","In","particular",",","if","this","flag","is","`","True","`",",","input","to","`","log_prob","`","is","presumed","of","Cholesky","form","and","output","from","`","sample","`","is","of","Cholesky","form",".","Setting","this","argument","to","`","True","`","is","purely","a","computational","optimization","and","does","not","change","the","underlying","distribution",".","Additionally",",","validation","checks","which","are","only","defined","on","the","multiplied-out","form","are","omitted",",","even","if","`","validate_args","`","is","`","True","`",".","Default","value",":","`","False","`","(","i.e.",",","input\/output","does","not","have","Cholesky","semantics",")",".","WARNING",":","Do","not","set","this","boolean","to","true",",","when","using","`","tfp.mcmc","`",".","The","density","is","not","the","density","of","Cholesky","factors","of","correlation","matrices","drawn","via","LKJ",".","validate_args",":","Python","`","bool","`",",","default","`","False","`",".","When","`","True","`","distribution","parameters","are","checked","for","validity","despite","possibly","degrading","runtime","performance",".","When","`","False","`","invalid","inputs","may","silently","render","incorrect","outputs",".","allow_nan_stats",":","Python","`","bool","`",",","default","`","True","`",".","When","`","True","`",",","statistics","(","e.g.",",","mean",",","mode",",","variance",")","use","the","value","`","NaN","`","to","indicate","the","result","is","undefined",".","When","`","False","`",",","an","exception","is","raised","if","one","or","more","of","the","statistic","'s","batch","members","are","undefined",".","name",":","Python","`","str","`","name","prefixed","to","Ops","created","by","this","class",".","Raises",":","ValueError",":","If","`","dimension","`","is","negative","."]
code: def __init__(
      self,
      dimension,
      concentration,
      input_output_cholesky=False,
      validate_args=False,
      allow_nan_stats=True,
      name="LKJ",
  ):
      """Construct LKJ distributions.
  
      Args:
        dimension: Python `int`. The dimension of the correlation matrices
          to sample.
        concentration: `float` or `double` `Tensor`. The positive concentration
          parameter of the LKJ distributions. The pdf of a sample matrix `X` is
          proportional to `det(X) ** (concentration - 1)`.
        input_output_cholesky: Python `bool`. If `True`, functions whose input or
          output have the semantics of samples assume inputs are in Cholesky form
          and return outputs in Cholesky form. In particular, if this flag is
          `True`, input to `log_prob` is presumed of Cholesky form and output from
          `sample` is of Cholesky form.  Setting this argument to `True` is purely
          a computational optimization and does not change the underlying
          distribution. Additionally, validation checks which are only defined on
          the multiplied-out form are omitted, even if `validate_args` is `True`.
          Default value: `False` (i.e., input/output does not have Cholesky
          semantics). WARNING: Do not set this boolean to true, when using
          `tfp.mcmc`. The density is not the density of Cholesky factors of
          correlation matrices drawn via LKJ.
        validate_args: Python `bool`, default `False`. When `True` distribution
          parameters are checked for validity despite possibly degrading runtime
          performance. When `False` invalid inputs may silently render incorrect
          outputs.
        allow_nan_stats: Python `bool`, default `True`. When `True`, statistics
          (e.g., mean, mode, variance) use the value `NaN` to indicate the
          result is undefined. When `False`, an exception is raised if one or
          more of the statistic's batch members are undefined.
        name: Python `str` name prefixed to Ops created by this class.
  
      Raises:
        ValueError: If `dimension` is negative.
      """
      if dimension < 0:
          raise ValueError(
              "There are no negative-dimension correlation matrices."
          )
      if dimension > 65536:
          raise ValueError(
              (
                  "Given dimension ({}) is greater than 65536, and will overflow "
                  "int32 array sizes."
              ).format(dimension)
          )
      parameters = dict(locals())
      self._input_output_cholesky = input_output_cholesky
      with tf.name_scope(name):
          dtype = dtype_util.common_dtype([concentration], tf.float32)
          self._concentration = tensor_util.convert_nonref_to_tensor(
              concentration, name="concentration", dtype=dtype
          )
          self._dimension = dimension
          super(LKJ, self).__init__(
              dtype=self._concentration.dtype,
              validate_args=validate_args,
              allow_nan_stats=allow_nan_stats,
              reparameterization_type=reparameterization.NOT_REPARAMETERIZED,
              parameters=parameters,
              name=name,
          )
  
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.bijectors import chain
  from tensorflow_probability.python.bijectors import cholesky_outer_product
  from tensorflow_probability.python.bijectors import correlation_cholesky
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import beta
  from tensorflow_probability.python.distributions import distribution
  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 prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math import linalg
  from tensorflow_probability.python.math import special
  from tensorflow_probability.python.math.numeric import clip_by_value_preserve_gradient
  from tensorflow_probability.python.random import random_ops
  from tensorflow.python.ops import control_flow_util
label_desc: Use image node_id 1 to create a new LKJ object from inherited base classes: distribution with example: obj = LKJ(dimension, concentration, input_output_cholesky, validate_args, allow_nan_stats, name)