random ================ .. py:module:: jaxns.internals.random .. rubric:: :code:`jaxns.internals.random` .. rubric:: Module Contents .. py:function:: random_ortho_matrix(key, n, special_orthogonal = False) Samples a random orthonormal n by n matrix from Stiefels manifold. From https://stackoverflow.com/a/38430739 :param key: PRNG seed :param n: Size of matrix, draws from O(num_options) group. Returns: random [num_options,num_options] matrix with determinant = +-1 .. py:function:: resample_indicies(key, log_weights = None, S = None, replace = True, num_total = None) Get resample indicies according to a given weighting, with or without replacement. :param key: PRNGKey :param log_weights: Optional log weights :param S: Optional number of samples. Computes effective sample size from log weights if not given. :param replace: whether to use replacement or not. :param num_total: Optional total sample size to use, must be given if `replace=False` and `log_weights=None` :returns: index array given the take indicies to resample at.