I have 2 probability density functions pdf1, pdf2. I need to use them to calculate the joint probability, and display it like this:
i've tried using plot_surface, but I couldn't figure out how to calculate the parameters X,Y,Z
import numpy as np
from matplotlib import pyplot as plt
from scipy.stats import norm
x1 = norm.rvs(size=1000)
x2 = list(map(lambda val: val if abs(val)<=1 else -val, x1))
samples = np.linspace(-5, 5, 100)
pdf1 = norm.pdf(samples, np.mean(x1), np.std(x1))
pdf2 = norm.pdf(samples, np.mean(x2), np.std(x2))
X,Y = np.meshgrid(pdf1,pdf2)
fig = plt.figure(figsize =(12, 12))
ax = plt.axes(projection ='3d')
ax.plot_surface(X,Y,?)
plt.show()
Would appreciate any help!