I am a programmer and I have a 4-D matrix M and a 4-D matrix sigma. I want to corrupt each of M's entries with Gaussian noise with an individual stddev per entry (stored in sigma sigma). Doing this brute-force (with loops) is not feasible due to performance limitations.
I have a tool to cheaply generate a 4-D matrix filled with values sampled of a normal distribution with mean m = 0.0 and stddev=1.0 ($\sigma$). I was wondering now: Can I use that to generate Gaussian noise and then do an (also cheap) element-wise multiplication with my 4-D sigma-Matrix to get an "individual" Gaussian for each element? In essence I think this boils down to:
Is $\mathcal{N}(0,\sigma_i^2) = \mathcal{N}(0,1)\cdot\sigma_i^2$
Or is there another operation that can transform a $\mathcal{N}(0,1)$ to a $\mathcal{N}(0,\sigma_i^2)$?