I have this line of code in a MATLAB program:
x(:,i) = gamrnd(a(i),1,dim,1)
I was wondering in what way I could write this same line in Python. I think the equivalent statement is:
gamma.rvs(a, size=1000)
However, this keeps giving me an Index Error.
Here is my full code for this part:
x = np.array([])
for i in range(N-1):
# generates dim random variables
x[:, i] = gamma.rvs(a[i], dim-1) # generates dim random variables
# with gamma distribution
Thanks for the help!