I am trying to generate n (in this case n=57) random numbers from a normal distribution for a number of sampled mean and standard deviations from a PyMc3 model (in this case 350). So I ultimately want to end up with 350 distributions of 57 length each. I'm sure this is something straightforward and I have a lack of conceptual understanding. Input is:
prior_pc5 =pm.sample_prior_predictive(samples=350,model=model_5,
var_names='μ','σ'],random_seed=21)
n=57
prpc5_μ = np.asarray(prior_pc5['μ'])
prpc5_σ = np.asarray(prior_pc5['σ'])
for x,y in np.nditer([prpc5_μ,prpc5_σ]):
y_prpc5 = np.random.normal(prpc5[:,0],prpc5[:,1], size=n)
Output is:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-180-90195f458d14> in <module>
1 for x,y in np.nditer([prpc5_μ,prpc5_σ]):
----> 2 y_prpc5 = np.random.normal(prpc5[:,0],prpc5[:,1], size=n)
mtrand.pyx in numpy.random.mtrand.RandomState.normal()
_common.pyx in numpy.random._common.cont()
_common.pyx in numpy.random._common.cont_broadcast_2()
__init__.pxd in numpy.PyArray_MultiIterNew3()
ValueError: shape mismatch: objects cannot be broadcast to a single shape
Appreciate any edification you can provide.