Basically I have this:
from scip.stats import norm
import pandas as pd
r = pd.Series([1, 2, 3])
k = pd.Series([0.2, 0.3, 0.4, 0.5])
x = 2
mean = x + k
variance = k
# I'm feeding the gaussian function two vectors.
# I'd like to get a matrix back of all possible combinations. Quickly.
values = norm.pdf(r, mean, variance)
So I'm giving the function norm.pdf two vectors of data, and I'd like a (3x4) matrix returned to me that looks like:
values(1, 0.2) values(1, 0.3) values(1, 0.4) values(1, 0.5)
values(2, 0.2) ...
values(3, 0.2) ...
values(4, 0.2) ........... ........... values(4, 0.5)
I know I could iterate over all items in all arrays, but that takes a lot of time, and I plan on scaling this up quite a bit. I'd like to take advantage of numpy's speed. I've tried vectorizing, but that fails. Any ideas? Thanks!!!