<a id="skfolio-utils-stats-rand-weights"></a>

# skfolio.utils.stats.rand_weights

<a id="skfolio.utils.stats.rand_weights"></a>

### skfolio.utils.stats.rand_weights(n, zeros=0, seed=None)

Produces n random weights that sum to one from a uniform distribution
(non-uniform distribution over a simplex).

* **Parameters:**
  **n** *int*
  : Number of weights.

  **zeros** *int, default=0*
  : The number of weights to randomly set to zeros.

  **seed** *int, optional*
  : Seed for reproducibility. If None, use an unseeded generator.
* **Returns:**
  **weights** *ndarray of shape (n, )*
  : The vector of weights.

