watex.utils.build_random_thickness#

watex.utils.build_random_thickness(depth, /, n_layers=None, h0=1, shuffle=True, dirichlet_dist=False, random_state=None, unit='m')[source]#

Generate a random thickness value for number of layers in deeper.

Parameters:
  • depth (ArrayLike, float) – Depth data. If float the number of layers n_layers must be specified. Otherwise an error occurs.

  • n_layers (int, Optional) – Number of layers that fit the samples in depth. If depth is passed as an ArrayLike, n_layers is ignored instead.

  • h0 (int, default='1m') – Thickness of the first layer.

  • shuffle (bool, default=True) – Shuffle the random generated thicknesses.

  • dirichlet_dis (bool, default=False) – Draw samples from the Dirichlet distribution. A Dirichlet-distributed random variable can be seen as a multivariate generalization of a Beta distribution. The Dirichlet distribution is a conjugate prior of a multinomial distribution in Bayesian inference.

  • random_state (int, array-like, BitGenerator, np.random.RandomState, np.random.Generator, optional) – If int, array-like, or BitGenerator, seed for random number generator. If np.random.RandomState or np.random.Generator, use as given.

  • unit (str, default='m') – The reference unit for generated layer thicknesses. Default is meters

Returns:

thickness – ArrayLike of shape equals to the number of layers.

Return type:

Arraylike of shape (n_layers, )

Examples

>>> from watex.utils.geotools import build_random_thickness
>>> build_random_thickness (7, 10, random_state =42  )
array([0.41865079, 0.31785714, 1.0234127 , 1.12420635, 0.51944444,
       0.92261905, 0.6202381 , 0.8218254 , 0.72103175, 1.225     ])
>>> build_random_thickness (7, 10, random_state =42 , dirichlet_dist=True )
array([1.31628992, 0.83342521, 1.16073915, 1.03137592, 0.79986286,
       0.8967135 , 0.97709521, 1.34502617, 1.01632075, 0.62315132])