Data generation

mail@pastecode.io avatar
unknown
python
2 years ago
251 B
3
Indexable
Never
A = np.zeros((100, 100), int)
np.fill_diagonal(A, 1)
D = np.diag(1 / np.asarray(A.sum(axis=1)).reshape(-1))

Z = np.random.normal(size=100)
X = (D @ A @ Z) + np.random.normal(scale=0.1, size=100)
Y = (D @ A @ Z) + np.random.normal(scale=0.1, size=100)