class_docstr: Normal Inverse Gaussian distribution.
  
  The [Normal-inverse Gaussian distribution]
  (https://en.wikipedia.org/wiki/Normal-inverse_Gaussian_distribution)
  is parameterized by a `loc`, `tailweight`, `skewness` and `scale` parameter.
  
  #### Mathematical Details
  
  The name of this distribution refers to it being a variance mean mixture.
  In other words if `x` is sampled via:
  
  ```none
  z ~ InverseGaussian(1 / gamma, 1.)
  x ~ Normal(loc + skewness * z, scale * z)
  ```
  then `x ~ NormalInverseGaussian(loc, scale, tailweight, skewness)`.
  
  where `gamma = sqrt(tailweight ** 2 - skewness ** 2)`.
  
  
  The probability density function (pdf) is,
  
  ```none
  pdf(x; mu, sigma, alpha, beta) = [alpha * sigma * K1(alpha * g)] / (pi * g)
                                   exp(sigma * gamma + beta * (x - loc))
  ```
  
  where
  * `loc = mu`
  * `tailweight = alpha`
  * `skewness = beta`
  * `scale = sigma`
  * `g = sqrt(sigma ** 2 + (x - mu) ** 2)`
  * `gamma = sqrt(alpha ** 2 - beta ** 2)`
  * `K1(x)` is the modified Bessel function of the second kind with
    order parameter 1.
  
  The support of the distribution is defined on `(-infinity, infinity)`.
  
  Mapping to R and Python scipy's parameterization:
  * R: GeneralizedHyperbolic.NIG
    - mu = loc
    - delta = scale
    - alpha = tailweight
    - beta = skewness
  * Python: scipy.stats.norminvgauss
    - a = tailweight
    - b = skewness
    - loc = loc
    - Note that `scipy.stats.norminvgauss` implements the distribution as a
      location-scale family. However, in the original paper, and other
      implementations (such as R) do not implement it this way. Thus the
      `scale` parameters here and scipy don't match unless `scale = 1`.
  
  Warning: As mentioned above, this distribution is __not__ a location-scale
  family. Specifically:
  
  ```none
  NIG(loc, scale, alpha, beta) != loc + scale * NIG(0, 1, alpha, beta).
  ```
docstr: Constructs Normal-inverse Gaussian distribution.
  
  Args:
    loc: Floating point `Tensor`, the location params of the distribution(s).
    scale: Positive floating point `Tensor`, the scale params of the
      distribution(s).
    tailweight: Positive floating point `Tensor`, the tailweight params of the
      distribution(s). Expect `|tailweight| >= |skewness|`.
    skewness: Floating point `Tensor`, the skewness params of the
      distribution(s). Expect `|tailweight| >= |skewness|`.
    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.
      Default value: `False` (i.e. do not validate args).
    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.
      Default value: `True`.
    name: Python `str` name prefixed to Ops created by this class.
      Default value: 'NormalInverseGaussian'.
docstr_tok: ["Constructs","Normal-inverse","Gaussian","distribution",".","Args",":","loc",":","Floating","point","`","Tensor","`",",","the","location","params","of","the","distribution","(","s",")",".","scale",":","Positive","floating","point","`","Tensor","`",",","the","scale","params","of","the","distribution","(","s",")",".","tailweight",":","Positive","floating","point","`","Tensor","`",",","the","tailweight","params","of","the","distribution","(","s",")",".","Expect","`","|tailweight|",">","=","|skewness|","`",".","skewness",":","Floating","point","`","Tensor","`",",","the","skewness","params","of","the","distribution","(","s",")",".","Expect","`","|tailweight|",">","=","|skewness|","`",".","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",".","Default","value",":","`","False","`","(","i.e",".","do","not","validate","args",")",".","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",".","Default","value",":","`","True","`",".","name",":","Python","`","str","`","name","prefixed","to","Ops","created","by","this","class",".","Default","value",":","'NormalInverseGaussian","'","."]
code: def __init__(
      self,
      loc,
      scale,
      tailweight,
      skewness,
      validate_args=False,
      allow_nan_stats=True,
      name="NormalInverseGaussian",
  ):
      """Constructs Normal-inverse Gaussian distribution.
  
      Args:
        loc: Floating point `Tensor`, the location params of the distribution(s).
        scale: Positive floating point `Tensor`, the scale params of the
          distribution(s).
        tailweight: Positive floating point `Tensor`, the tailweight params of the
          distribution(s). Expect `|tailweight| >= |skewness|`.
        skewness: Floating point `Tensor`, the skewness params of the
          distribution(s). Expect `|tailweight| >= |skewness|`.
        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.
          Default value: `False` (i.e. do not validate args).
        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.
          Default value: `True`.
        name: Python `str` name prefixed to Ops created by this class.
          Default value: 'NormalInverseGaussian'.
      """
      parameters = dict(locals())
      with tf.name_scope(name):
          dtype = dtype_util.common_dtype(
              [loc, scale, tailweight, skewness], dtype_hint=tf.float32
          )
          self._loc = tensor_util.convert_nonref_to_tensor(
              loc, dtype=dtype, name="loc"
          )
          self._scale = tensor_util.convert_nonref_to_tensor(
              scale, dtype=dtype, name="scale"
          )
          self._tailweight = tensor_util.convert_nonref_to_tensor(
              tailweight, dtype=dtype, name="tailweight"
          )
          self._skewness = tensor_util.convert_nonref_to_tensor(
              skewness, dtype=dtype, name="skewness"
          )
  
          super(NormalInverseGaussian, self).__init__(
              dtype=dtype,
              reparameterization_type=reparameterization.FULLY_REPARAMETERIZED,
              validate_args=validate_args,
              allow_nan_stats=allow_nan_stats,
              parameters=parameters,
              name=name,
          )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import inverse_gaussian
  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.math import bessel
label_desc: Use image node_id 1 to create a new NormalInverseGaussian object from inherited base classes: distribution with example: obj = NormalInverseGaussian(loc, scale, tailweight, skewness, validate_args, allow_nan_stats, name)