After running several calculations with numpy, I end with the mean vector and covariance matrix for a state vector. Is there a way with numpy or scipy to sample a random vector around this mean and covariance?
1 Answer
If random vector $X$ has variance $S$, then $LX$ has variance $LSL^\top$.
So generate whatever random variables with mean 0 and identity covariance matrix, then transform it $LX+\mu$, where $\mu$ is your mean vector and $LL^\top$ equals to your covariance matrix. You can find $L$ by cholesky decomposition.
numpy.random.multivariate_normal
. $\endgroup$