class_docstr: Gamma-Gamma distribution.
  
  Gamma-Gamma is a [compound
  distribution](https://en.wikipedia.org/wiki/Compound_probability_distribution)
  defined over positive real numbers using parameters `concentration`,
  `mixing_concentration` and `mixing_rate`.
  
  This distribution is also referred to as the beta of the second kind (B2), and
  can be useful for transaction value modeling, as [(Fader and Hardi, 2013)][1].
  
  #### Mathematical Details
  
  It is derived from the following Gamma-Gamma hierarchical model by integrating
  out the random variable `beta`.
  
  ```none
      beta ~ Gamma(alpha0, beta0)
  X | beta ~ Gamma(alpha, beta)
  ```
  where
  * `concentration = alpha`
  * `mixing_concentration = alpha0`
  * `mixing_rate = beta0`
  
  The probability density function (pdf) is
  
  ```none
                                         x**(alpha - 1)
  pdf(x; alpha, alpha0, beta0) = ---------------------------------
                                 Z * (x + beta0)**(alpha + alpha0)
  ```
  where the normalizing constant `Z = Beta(alpha, alpha0) * beta0**(-alpha0)`.
  
  Samples of this distribution are reparameterized as samples of the Gamma
  distribution are reparameterized using the technique described in
  [(Figurnov et al., 2018)][2].
  
  #### References
  
  [1]: Peter S. Fader, Bruce G. S. Hardi. The Gamma-Gamma Model of Monetary
       Value. _Technical Report_, 2013.
       http://www.brucehardie.com/notes/025/gamma_gamma.pdf
  
  [2]: Michael Figurnov, Shakir Mohamed, Andriy Mnih.
       Implicit Reparameterization Gradients. _arXiv preprint arXiv:1805.08498_,
       2018. https://arxiv.org/abs/1805.08498
class_docstr_tok: ["Gamma-Gamma","distribution",".","Gamma-Gamma","is","a","[","compound","distribution","]","(","https",":","\/\/en.wikipedia.org\/wiki\/Compound_probability_distribution",")","defined","over","positive","real","numbers","using","parameters","`","concentration","`",",","`","mixing_concentration","`","and","`","mixing_rate","`",".","This","distribution","is","also","referred","to","as","the","beta","of","the","second","kind","(","B2",")",",","and","can","be","useful","for","transaction","value","modeling",",","as","[","(","Fader","and","Hardi",",","2013",")","]","[","1","]",".","#","#","#","#","Mathematical","Details","It","is","derived","from","the","following","Gamma-Gamma","hierarchical","model","by","integrating","out","the","random","variable","`","beta","`",".","``","`","none","beta","~","Gamma","(","alpha0",",","beta0",")","X","|","beta","~","Gamma","(","alpha",",","beta",")","``","`","where","*","`","concentration","=","alpha","`","*","`","mixing_concentration","=","alpha0","`","*","`","mixing_rate","=","beta0","`","The","probability","density","function","(","pdf",")","is","``","`","none","x","*","*","(","alpha","-","1",")","pdf","(","x",";","alpha",",","alpha0",",","beta0",")","=","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-","Z","*","(","x","+","beta0",")","*","*","(","alpha","+","alpha0",")","``","`","where","the","normalizing","constant","`","Z","=","Beta","(","alpha",",","alpha0",")","*","beta0","*","*","(","-alpha0",")","`",".","Samples","of","this","distribution","are","reparameterized","as","samples","of","the","Gamma","distribution","are","reparameterized","using","the","technique","described","in","[","(","Figurnov","et","al.",",","2018",")","]","[","2","]",".","#","#","#","#","References","[","1","]",":","Peter","S.","Fader",",","Bruce","G.","S.","Hardi",".","The","Gamma-Gamma","Model","of","Monetary","Value",".","_Technical","Report_",",","2013.","http",":","\/\/www.brucehardie.com\/notes\/025\/gamma_gamma.pdf","[","2","]",":","Michael","Figurnov",",","Shakir","Mohamed",",","Andriy","Mnih",".","Implicit","Reparameterization","Gradients",".","_arXiv","preprint","arXiv:1805.08498_",",","2018.","https",":","\/\/arxiv.org\/abs\/1805.08498"]
docstr: Initializes a batch of Gamma-Gamma distributions.
  
  The parameters `concentration` and `rate` must be shaped in a way that
  supports broadcasting (e.g.
  `concentration + mixing_concentration + mixing_rate` is a valid operation).
  
  Args:
    concentration: Floating point tensor, the concentration params of the
      distribution(s). Must contain only positive values.
    mixing_concentration: Floating point tensor, the concentration params of
      the mixing Gamma distribution(s). Must contain only positive values.
    mixing_rate: Floating point tensor, the rate params of the mixing Gamma
      distribution(s). Must contain only positive values.
    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:
    TypeError: if `concentration` and `rate` are different dtypes.
docstr_tok: ["Initializes","a","batch","of","Gamma-Gamma","distributions",".","The","parameters","`","concentration","`","and","`","rate","`","must","be","shaped","in","a","way","that","supports","broadcasting","(","e.g",".","`","concentration","+","mixing_concentration","+","mixing_rate","`","is","a","valid","operation",")",".","Args",":","concentration",":","Floating","point","tensor",",","the","concentration","params","of","the","distribution","(","s",")",".","Must","contain","only","positive","values",".","mixing_concentration",":","Floating","point","tensor",",","the","concentration","params","of","the","mixing","Gamma","distribution","(","s",")",".","Must","contain","only","positive","values",".","mixing_rate",":","Floating","point","tensor",",","the","rate","params","of","the","mixing","Gamma","distribution","(","s",")",".","Must","contain","only","positive","values",".","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",":","TypeError",":","if","`","concentration","`","and","`","rate","`","are","different","dtypes","."]
code: def __init__(
      self,
      concentration,
      mixing_concentration,
      mixing_rate,
      validate_args=False,
      allow_nan_stats=True,
      name="GammaGamma",
  ):
      """Initializes a batch of Gamma-Gamma distributions.
  
      The parameters `concentration` and `rate` must be shaped in a way that
      supports broadcasting (e.g.
      `concentration + mixing_concentration + mixing_rate` is a valid operation).
  
      Args:
        concentration: Floating point tensor, the concentration params of the
          distribution(s). Must contain only positive values.
        mixing_concentration: Floating point tensor, the concentration params of
          the mixing Gamma distribution(s). Must contain only positive values.
        mixing_rate: Floating point tensor, the rate params of the mixing Gamma
          distribution(s). Must contain only positive values.
        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:
        TypeError: if `concentration` and `rate` are different dtypes.
      """
      parameters = dict(locals())
      with tf.name_scope(name):
          dtype = dtype_util.common_dtype(
              [concentration, mixing_concentration, mixing_rate],
              dtype_hint=tf.float32,
          )
          self._concentration = tensor_util.convert_nonref_to_tensor(
              concentration, name="concentration", dtype=dtype
          )
          self._mixing_concentration = (
              tensor_util.convert_nonref_to_tensor(
                  mixing_concentration,
                  name="mixing_concentration",
                  dtype=dtype,
              )
          )
          self._mixing_rate = tensor_util.convert_nonref_to_tensor(
              mixing_rate, name="mixing_rate", dtype=dtype
          )
  
          super(GammaGamma, self).__init__(
              dtype=self._concentration.dtype,
              validate_args=validate_args,
              allow_nan_stats=allow_nan_stats,
              reparameterization_type=reparameterization.FULLY_REPARAMETERIZED,
              parameters=parameters,
              name=name,
          )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import exp
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import gamma
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import distribution_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 samplers
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.math import special
label_desc: Use image node_id 1 to create a new GammaGamma object from inherited base classes: distribution with example: obj = GammaGamma(concentration, mixing_concentration, mixing_rate, validate_args, allow_nan_stats, name)