numpy.convolve(a, v, mode='full')
only admits two inputs:
a(N,)
array_like First one-dimensional input array.v(M,)
array_like Second one-dimensional input array.
How can I instead calculate the convolution of more than 2 probability distributions in Python?
Example
The following code generates 3 random variables. I would like to form a convolution of all of them and also extract the weights used to form that convolution:
import numpy as np
from numpy.random import randn
n=100
x=randn(n)
y=randn(n)+0.2
z=randn(n)*0.3
print(np.convolve(x,y))
However, numpy.convolve
only accepts two inputs, and even in the 2-input case, how can I even extract the weights used for forming the convolution?