class_docstr: The SinhArcsinh transformation of a distribution on `(-inf, inf)`.
  
  This distribution models a random variable, making use of
  a `SinhArcsinh` transformation (which has adjustable tailweight and skew),
  a rescaling, and a shift.
  
  The `SinhArcsinh` transformation of the Normal is described in great depth in
  [Sinh-arcsinh distributions](https://www.jstor.org/stable/27798865).
  Here we use a slightly different parameterization, in terms of `tailweight`
  and `skewness`.  Additionally we allow for distributions other than Normal,
  and control over `scale` as well as a "shift" parameter `loc`.
  
  #### Mathematical Details
  
  Given random variable `Z`, we define the SinhArcsinh
  transformation of `Z`, `Y`, parameterized by
  `(loc, scale, skewness, tailweight)`, via the relation:
  
  ```
  Y := loc + scale * F(Z)
  F(Z) := Sinh( (Arcsinh(Z) + skewness) * tailweight ) * (2 / F_0(2))
  F_0(Z) := Sinh( Arcsinh(Z) * tailweight )
  ```
  
  This distribution is similar to the location-scale transformation
  `L(Z) := loc + scale * Z` in the following ways:
  
  * If `skewness = 0` and `tailweight = 1` (the defaults), `F(Z) = Z`, and then
    `Y = L(Z)` exactly.
  * `loc` is used in both to shift the result by a constant factor.
  * The multiplication of `scale` by `2 / F_0(2)` ensures that if `skewness = 0`
    `P[Y - loc <= 2 * scale] = P[L(Z) - loc <= 2 * scale]`.
    Thus it can be said that the weights in the tails of `Y` and `L(Z)` beyond
    `loc + 2 * scale` are the same.
  
  This distribution is different than `loc + scale * Z` due to the
  reshaping done by `F`:
  
  * Positive (negative) `skewness` leads to positive (negative) skew.
    * positive skew means, the mode of `F(Z)` is "tilted" to the right.
    * positive skew means positive values of `F(Z)` become more likely, and
      negative values become less likely.
  * Larger (smaller) `tailweight` leads to fatter (thinner) tails.
    * Fatter tails mean larger values of `|F(Z)|` become more likely.
    * `tailweight < 1` leads to a distribution that is "flat" around `Y = loc`,
      and a very steep drop-off in the tails.
    * `tailweight > 1` leads to a distribution more peaked at the mode with
      heavier tails.
  
  To see the argument about the tails, note that for `|Z| >> 1` and
  `|Z| >> (|skewness| * tailweight)**tailweight`, we have
  `Y approx 0.5 Z**tailweight e**(sign(Z) skewness * tailweight)`.
  
  To see the argument regarding multiplying `scale` by `2 / F_0(2)`,
  
  ```
  P[(Y - loc) / scale <= 2] = P[F(Z) * (2 / F_0(2)) <= 2]
                            = P[F(Z) <= F_0(2)]
                            = P[Z <= 2]  (if F = F_0).
  ```
class_docstr_tok: ["The","SinhArcsinh","transformation","of","a","distribution","on","`","(","-inf",",","inf",")","`",".","This","distribution","models","a","random","variable",",","making","use","of","a","`","SinhArcsinh","`","transformation","(","which","has","adjustable","tailweight","and","skew",")",",","a","rescaling",",","and","a","shift",".","The","`","SinhArcsinh","`","transformation","of","the","Normal","is","described","in","great","depth","in","[","Sinh-arcsinh","distributions","]","(","https",":","\/\/www.jstor.org\/stable\/27798865",")",".","Here","we","use","a","slightly","different","parameterization",",","in","terms","of","`","tailweight","`","and","`","skewness","`",".","Additionally","we","allow","for","distributions","other","than","Normal",",","and","control","over","`","scale","`","as","well","as","a","``","shift","''","parameter","`","loc","`",".","#","#","#","#","Mathematical","Details","Given","random","variable","`","Z","`",",","we","define","the","SinhArcsinh","transformation","of","`","Z","`",",","`","Y","`",",","parameterized","by","`","(","loc",",","scale",",","skewness",",","tailweight",")","`",",","via","the","relation",":","``","`","Y",":","=","loc","+","scale","*","F","(","Z",")","F","(","Z",")",":","=","Sinh","(","(","Arcsinh","(","Z",")","+","skewness",")","*","tailweight",")","*","(","2","\/","F_0","(","2",")",")","F_0","(","Z",")",":","=","Sinh","(","Arcsinh","(","Z",")","*","tailweight",")","``","`","This","distribution","is","similar","to","the","location-scale","transformation","`","L","(","Z",")",":","=","loc","+","scale","*","Z","`","in","the","following","ways",":","*","If","`","skewness","=","0","`","and","`","tailweight","=","1","`","(","the","defaults",")",",","`","F","(","Z",")","=","Z","`",",","and","then","`","Y","=","L","(","Z",")","`","exactly",".","*","`","loc","`","is","used","in","both","to","shift","the","result","by","a","constant","factor",".","*","The","multiplication","of","`","scale","`","by","`","2","\/","F_0","(","2",")","`","ensures","that","if","`","skewness","=","0","`","`","P","[","Y","-","loc","<","=","2","*","scale","]","=","P","[","L","(","Z",")","-","loc","<","=","2","*","scale","]","`",".","Thus","it","can","be","said","that","the","weights","in","the","tails","of","`","Y","`","and","`","L","(","Z",")","`","beyond","`","loc","+","2","*","scale","`","are","the","same",".","This","distribution","is","different","than","`","loc","+","scale","*","Z","`","due","to","the","reshaping","done","by","`","F","`",":","*","Positive","(","negative",")","`","skewness","`","leads","to","positive","(","negative",")","skew",".","*","positive","skew","means",",","the","mode","of","`","F","(","Z",")","`","is","``","tilted","''","to","the","right",".","*","positive","skew","means","positive","values","of","`","F","(","Z",")","`","become","more","likely",",","and","negative","values","become","less","likely",".","*","Larger","(","smaller",")","`","tailweight","`","leads","to","fatter","(","thinner",")","tails",".","*","Fatter","tails","mean","larger","values","of","`","|F","(","Z",")","|","`","become","more","likely",".","*","`","tailweight","<","1","`","leads","to","a","distribution","that","is","``","flat","''","around","`","Y","=","loc","`",",","and","a","very","steep","drop-off","in","the","tails",".","*","`","tailweight",">","1","`","leads","to","a","distribution","more","peaked","at","the","mode","with","heavier","tails",".","To","see","the","argument","about","the","tails",",","note","that","for","`","|Z|",">",">","1","`","and","`","|Z|",">",">","(","|skewness|","*","tailweight",")","*","*","tailweight","`",",","we","have","`","Y","approx","0.5","Z","*","*","tailweight","e","*","*","(","sign","(","Z",")","skewness","*","tailweight",")","`",".","To","see","the","argument","regarding","multiplying","`","scale","`","by","`","2","\/","F_0","(","2",")","`",",","``","`","P","[","(","Y","-","loc",")","\/","scale","<","=","2","]","=","P","[","F","(","Z",")","*","(","2","\/","F_0","(","2",")",")","<","=","2","]","=","P","[","F","(","Z",")","<","=","F_0","(","2",")","]","=","P","[","Z","<","=","2","]","(","if","F","=","F_0",")",".","``","`"]
docstr: Construct SinhArcsinh distribution on `(-inf, inf)`.
  
  Arguments `(loc, scale, skewness, tailweight)` must have broadcastable shape
  (indexing batch dimensions).  They must all have the same `dtype`.
  
  Args:
    loc: Floating-point `Tensor`.
    scale:  `Tensor` of same `dtype` as `loc`.
    skewness:  Skewness parameter.  Default is `0.0` (no skew).
    tailweight:  Tailweight parameter. Default is `1.0` (unchanged tailweight)
    distribution: `tf.Distribution`-like instance. Distribution that is
      transformed to produce this distribution.
      Must have a batch shape to which the shapes of `loc`, `scale`,
      `skewness`, and `tailweight` all broadcast. Default is
      `tfd.Normal(batch_shape, 1.)`, where `batch_shape` is the broadcasted
      shape of the parameters. Typically
      `distribution.reparameterization_type = FULLY_REPARAMETERIZED` or it is
      a function of non-trainable parameters. WARNING: If you backprop through
      a `SinhArcsinh` sample and `distribution` is not
      `FULLY_REPARAMETERIZED` yet is a function of trainable variables, then
      the gradient will be incorrect!
    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.
docstr_tok: ["Construct","SinhArcsinh","distribution","on","`","(","-inf",",","inf",")","`",".","Arguments","`","(","loc",",","scale",",","skewness",",","tailweight",")","`","must","have","broadcastable","shape","(","indexing","batch","dimensions",")",".","They","must","all","have","the","same","`","dtype","`",".","Args",":","loc",":","Floating-point","`","Tensor","`",".","scale",":","`","Tensor","`","of","same","`","dtype","`","as","`","loc","`",".","skewness",":","Skewness","parameter",".","Default","is","`","0.0","`","(","no","skew",")",".","tailweight",":","Tailweight","parameter",".","Default","is","`","1.0","`","(","unchanged","tailweight",")","distribution",":","`","tf.Distribution","`","-like","instance",".","Distribution","that","is","transformed","to","produce","this","distribution",".","Must","have","a","batch","shape","to","which","the","shapes","of","`","loc","`",",","`","scale","`",",","`","skewness","`",",","and","`","tailweight","`","all","broadcast",".","Default","is","`","tfd.Normal","(","batch_shape",",","1",".",")","`",",","where","`","batch_shape","`","is","the","broadcasted","shape","of","the","parameters",".","Typically","`","distribution.reparameterization_type","=","FULLY_REPARAMETERIZED","`","or","it","is","a","function","of","non-trainable","parameters",".","WARNING",":","If","you","backprop","through","a","`","SinhArcsinh","`","sample","and","`","distribution","`","is","not","`","FULLY_REPARAMETERIZED","`","yet","is","a","function","of","trainable","variables",",","then","the","gradient","will","be","incorrect","!","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","."]
code: def __init__(
      self,
      loc,
      scale,
      skewness=None,
      tailweight=None,
      distribution=None,
      validate_args=False,
      allow_nan_stats=True,
      name="SinhArcsinh",
  ):
      """Construct SinhArcsinh distribution on `(-inf, inf)`.
  
      Arguments `(loc, scale, skewness, tailweight)` must have broadcastable shape
      (indexing batch dimensions).  They must all have the same `dtype`.
  
      Args:
        loc: Floating-point `Tensor`.
        scale:  `Tensor` of same `dtype` as `loc`.
        skewness:  Skewness parameter.  Default is `0.0` (no skew).
        tailweight:  Tailweight parameter. Default is `1.0` (unchanged tailweight)
        distribution: `tf.Distribution`-like instance. Distribution that is
          transformed to produce this distribution.
          Must have a batch shape to which the shapes of `loc`, `scale`,
          `skewness`, and `tailweight` all broadcast. Default is
          `tfd.Normal(batch_shape, 1.)`, where `batch_shape` is the broadcasted
          shape of the parameters. Typically
          `distribution.reparameterization_type = FULLY_REPARAMETERIZED` or it is
          a function of non-trainable parameters. WARNING: If you backprop through
          a `SinhArcsinh` sample and `distribution` is not
          `FULLY_REPARAMETERIZED` yet is a function of trainable variables, then
          the gradient will be incorrect!
        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.
      """
      parameters = dict(locals())
  
      with tf.name_scope(name) as name:
          dtype = dtype_util.common_dtype(
              [loc, scale, skewness, tailweight], tf.float32
          )
          self._loc = tensor_util.convert_nonref_to_tensor(
              loc, name="loc", dtype=dtype
          )
          self._scale = tensor_util.convert_nonref_to_tensor(
              scale, name="scale", dtype=dtype
          )
          tailweight = 1.0 if tailweight is None else tailweight
          has_default_skewness = skewness is None
          skewness = 0.0 if has_default_skewness else skewness
          self._tailweight = tensor_util.convert_nonref_to_tensor(
              tailweight, name="tailweight", dtype=dtype
          )
          self._skewness = tensor_util.convert_nonref_to_tensor(
              skewness, name="skewness", dtype=dtype
          )
  
          # Recall, with Z a random variable,
          #   Y := loc + scale * F(Z),
          #   F(Z) := Sinh( (Arcsinh(Z) + skewness) * tailweight ) * C
          #   C := 2 / F_0(2)
          #   F_0(Z) := Sinh( Arcsinh(Z) * tailweight )
          if distribution is None:
              distribution = normal.Normal(
                  loc=tf.zeros([], dtype=dtype),
                  scale=tf.ones([], dtype=dtype),
                  allow_nan_stats=allow_nan_stats,
                  validate_args=validate_args,
              )
  
          # Make the SAS bijector, 'F'.
          f = sinh_arcsinh_bijector.SinhArcsinh(
              skewness=self._skewness,
              tailweight=self._tailweight,
              validate_args=validate_args,
          )
  
          # Make the affine scalar bijector, Z --> loc + scale * Z (2 / F_0(2))
          affine = shift_bijector.Shift(shift=self._loc)(
              scale_bijector.Scale(scale=self._scale)
          )
          bijector = chain_bijector.Chain([affine, f])
  
          super(SinhArcsinh, self).__init__(
              distribution=distribution,
              bijector=bijector,
              validate_args=validate_args,
              name=name,
          )
          self._parameters = parameters
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import chain
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.bijectors import shift
  from tensorflow_probability.python.bijectors import sinh_arcsinh
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import tensor_util
label_desc: Use image node_id 1 to create a new SinhArcsinh object from inherited base classes: transformed_distribution with example: obj = SinhArcsinh(loc, scale, skewness, tailweight, distribution, validate_args, allow_nan_stats, name)