Somewhat related to this post, I am trying to replicate multivariate_normal in dask:
Using numpy I can create a multivariate normal matrix with a specified covariance using:
import numpy as np
n_dim = 5
size = 300
A = np.random.randn(n_dim, n_dim) # a matrix
covm = A.dot(A.T) # A*A^T is positive semi-definite, as a covariance matrix
x = np.random.multivariate_normal(size=300, mean=np.zeros(len(covm)),cov=covm) # generate data
I however need a significantly large matrix with n_dim = 4_500_000 and size = 100000. This will be expensive to compute both with respective to CPU and memory. Fortunately, I have access to a Cloudera DataScience Workbench Cluster and was trying to solve this using dask:
import dask.array as da
n_dim = 4_500_000
size = 100000
A = da.random.standard_normal((n_dim, n_dim))
covm = A.dot(A.T)
#x = da.random.multivariate_normal(size=300, mean=np.zeros(len(covm)),cov=covm) # generate data
In the documentation, I cannot find any function that seem to do what I need it to. Does anyone know a solution / workarround, possibly using xarray or any other module that runs on clusters?