cr.sparse.data.sparse_normal_blocks¶
- cr.sparse.data.sparse_normal_blocks(key, D, K, B, S=1, cor=0.0, normalize_blocks=False)[source]¶
Generates representations where some blocks have normally distributed coefficients while others are zero.
- Parameters
key – a PRNG key used as the random key.
D (int) – Dimension of the model space
K (int) – Number of nonzero blocks
B (int) – Length of each block
S (int) – Number of sparse model vectors (default 1)
cor (float) – Intra block correlation under AR-1 model
normalize_blocks (bool) – Normalize the nonzero coefficients in each block
- Returns
A tuple consisting of (i) a vector/matrix of sparse model vectors (ii) active block numbers (iii) indices corresponding to the locations of nonzero entries
Notes: - Each active block of samples is normalized to unit norm.