|
@ -10,7 +10,7 @@ from scipy.stats import norm |
|
|
|
|
|
|
|
|
def train(data): |
|
|
def train(data): |
|
|
D = pd.DataFrame(data) |
|
|
D = pd.DataFrame(data) |
|
|
sd = np.array([1.0, 0.25, 0.5, 0.1]) |
|
|
sd = np.array([1.0, 0.5, 0.2, 0.5]) |
|
|
D["qoi"] = D["obs"].apply(lambda o: np.sum(o, axis=0) / sd / np.sqrt(len(o))) |
|
|
D["qoi"] = D["obs"].apply(lambda o: np.sum(o, axis=0) / sd / np.sqrt(len(o))) |
|
|
D["i"] = D["lam"].apply(lambda l: norm.pdf(l).prod()) |
|
|
D["i"] = D["lam"].apply(lambda l: norm.pdf(l).prod()) |
|
|
D["o"] = D["qoi"].apply(lambda q: norm.pdf(q).prod()) |
|
|
D["o"] = D["qoi"].apply(lambda q: norm.pdf(q).prod()) |
|
|